Class ModbusTcpIpConnectorTest
java.lang.Object
test.de.iip_ecosphere.platform.connectors.modbustcpipv1.AbstractModbusInformationModelConnectorTest<de.iip_ecosphere.platform.connectors.modbustcpipv1.ModbusItem>
test.de.iip_ecosphere.platform.connectors.modbustcpipv1.AbstractModbusTcpIpConnectorTest
test.de.iip_ecosphere.platform.connectors.modbustcpipv1.ModbusTcpIpConnectorTest
- All Implemented Interfaces:
test.de.iip_ecosphere.platform.connectors.MachineCommandInputTranslator.InputCustomizer,test.de.iip_ecosphere.platform.connectors.MachineDataOutputTranslator.OutputCustomizer
Tests the MODBUS TCP/IP connector (not secure, polling).
- Author:
- Christian Nikolajew
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final de.iip_ecosphere.platform.support.logging.Loggerprivate static TestServer -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected de.iip_ecosphere.platform.connectors.Connector<de.iip_ecosphere.platform.connectors.modbustcpipv1.ModbusItem, Object, ModbusDataC, ModbusCommandC> createConnector(de.iip_ecosphere.platform.connectors.types.ProtocolAdapter<de.iip_ecosphere.platform.connectors.modbustcpipv1.ModbusItem, Object, ModbusDataC, ModbusCommandC> adapter) Creates the connector to be tested.protected Class<? extends de.iip_ecosphere.platform.connectors.ConnectorDescriptor> Returns the connector descriptor forAbstractModbusInformationModelConnectorTest.createConnector(ProtocolAdapter).protected de.iip_ecosphere.platform.connectors.ConnectorParameterReturns the connector parameters forConnector.connect(ConnectorParameter).static TestServerReturns the TestServer.static voidinit()Sets the test up by starting an embedded MODBUS TCP/IP server.static voidshutdown()Shuts down the test server.voidTests the connector in polling mode.Methods inherited from class test.de.iip_ecosphere.platform.connectors.modbustcpipv1.AbstractModbusTcpIpConnectorTest
additionalFromActions, getQNameOperationStartMachine, getQNameOperationStopMachine, getQNameVarLotSize, getQNameVarPowerConsumption, getTopLevelModelPartName, getVendor, initializeModelAccessMethods inherited from class test.de.iip_ecosphere.platform.connectors.modbustcpipv1.AbstractModbusInformationModelConnectorTest
block, testConnectorMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface test.de.iip_ecosphere.platform.connectors.MachineCommandInputTranslator.InputCustomizer
assertOperationExceptions, assertSetExceptions, getQNameStart, getQNameStopMethods inherited from interface test.de.iip_ecosphere.platform.connectors.MachineDataOutputTranslator.OutputCustomizer
assertNotExistingProperties
-
Field Details
-
testServer
-
LOGGER
private static final de.iip_ecosphere.platform.support.logging.Logger LOGGER
-
-
Constructor Details
-
ModbusTcpIpConnectorTest
public ModbusTcpIpConnectorTest()Creates an instance of this test.
-
-
Method Details
-
init
public static void init()Sets the test up by starting an embedded MODBUS TCP/IP server. -
shutdown
public static void shutdown()Shuts down the test server. -
testWithPolling
Tests the connector in polling mode.- Throws:
IOException- in case that creating the connector fails
-
getConnectorDescriptor
protected Class<? extends de.iip_ecosphere.platform.connectors.ConnectorDescriptor> getConnectorDescriptor()Description copied from class:AbstractModbusInformationModelConnectorTestReturns the connector descriptor forAbstractModbusInformationModelConnectorTest.createConnector(ProtocolAdapter).- Specified by:
getConnectorDescriptorin classAbstractModbusInformationModelConnectorTest<de.iip_ecosphere.platform.connectors.modbustcpipv1.ModbusItem>- Returns:
- the connector descriptor
-
getConnectorParameter
protected de.iip_ecosphere.platform.connectors.ConnectorParameter getConnectorParameter()Description copied from class:AbstractModbusInformationModelConnectorTestReturns the connector parameters forConnector.connect(ConnectorParameter).- Specified by:
getConnectorParameterin classAbstractModbusInformationModelConnectorTest<de.iip_ecosphere.platform.connectors.modbustcpipv1.ModbusItem>- Returns:
- the connector parameters
-
createConnector
protected de.iip_ecosphere.platform.connectors.Connector<de.iip_ecosphere.platform.connectors.modbustcpipv1.ModbusItem,Object, createConnectorModbusDataC, ModbusCommandC> (de.iip_ecosphere.platform.connectors.types.ProtocolAdapter<de.iip_ecosphere.platform.connectors.modbustcpipv1.ModbusItem, Object, ModbusDataC, ModbusCommandC> adapter) Description copied from class:AbstractModbusInformationModelConnectorTestCreates the connector to be tested.- Specified by:
createConnectorin classAbstractModbusInformationModelConnectorTest<de.iip_ecosphere.platform.connectors.modbustcpipv1.ModbusItem>- Parameters:
adapter- the protocol adapter to use- Returns:
- the connector instance to test
-
getTestServer
Returns the TestServer.- Returns:
- the TestServer
-