Package nl.basjes.modbus.schema.test
Class TestScenario
-
- All Implemented Interfaces:
public final class TestScenario
-
-
Field Summary
Fields Modifier and Type Field Description private final List<ModbusBlock<?, ?, ?>>modbusBlocksprivate final List<ExpectedBlock>expectedBlocksprivate final Stringnameprivate final Stringdescription
-
Constructor Summary
Constructors Constructor Description TestScenario(String name, String description)
-
Method Summary
Modifier and Type Method Description final List<ModbusBlock<?, ?, ?>>getModbusBlocks()final List<ExpectedBlock>getExpectedBlocks()final StringgetName()The name of the test. final StringgetDescription()Human-readable description of the test. final MockedModbusDevicemodbusDevice()final UnitaddModbusBlock(ModbusBlock<?, ?, ?> modbusBlock)final UnitaddExpectedBlock(ExpectedBlock block)final TestScenarioResultsverify(SchemaDevice schemaDevice)Verify if the schema matches this test scenario. final UnitloadTestModbusValues(SchemaDevice schemaDevice)Load the test input modbus values in this test into the schema device. final UnitrecreateExpectedValues(SchemaDevice schemaDevice)StringtoString()-
-
Method Detail
-
getModbusBlocks
final List<ModbusBlock<?, ?, ?>> getModbusBlocks()
-
getExpectedBlocks
final List<ExpectedBlock> getExpectedBlocks()
-
getName
final String getName()
The name of the test. Must be usable as an identifier in 'all' common programming languages. So "CamelCase" (without spaces) is a good choice.
-
getDescription
final String getDescription()
Human-readable description of the test.
-
modbusDevice
final MockedModbusDevice modbusDevice()
-
addModbusBlock
final Unit addModbusBlock(ModbusBlock<?, ?, ?> modbusBlock)
-
addExpectedBlock
final Unit addExpectedBlock(ExpectedBlock block)
-
verify
final TestScenarioResults verify(SchemaDevice schemaDevice)
Verify if the schema matches this test scenario. NOTE: The previously cached modbus values in the provided SchemaDevice are WIPED!
- Returns:
The results object
-
loadTestModbusValues
final Unit loadTestModbusValues(SchemaDevice schemaDevice)
Load the test input modbus values in this test into the schema device. NOTE: The previously cached modbus values in the provided SchemaDevice are WIPED!
-
recreateExpectedValues
final Unit recreateExpectedValues(SchemaDevice schemaDevice)
-
-
-
-