Class JSerialCommConnectorTest
java.lang.Object
test.de.oktoflow.platform.connectors.serial.JSerialCommConnectorTest
Implements a test for
JSerialCommConnector, app and machine playing ping-ping via two bridged a virtual
serial ports. Requires a virtual port emulator on windows (bridging COM1 and COM2) like HDD Virtual Serial
Port Tools. Testing under Linux requires an installed ``socat``.- Author:
- Holger Eichelberger, SSE
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate de.iip_ecosphere.platform.connectors.Connector<byte[],byte[], test.de.iip_ecosphere.platform.transport.Product, test.de.iip_ecosphere.platform.transport.Command> private de.iip_ecosphere.platform.connectors.ConnectorParameterprivate static final Stringprivate Processprivate de.iip_ecosphere.platform.connectors.Connector<byte[],byte[], test.de.iip_ecosphere.platform.transport.Command, test.de.iip_ecosphere.platform.transport.Product> private de.iip_ecosphere.platform.connectors.ConnectorParameterprivate static final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidcreateCallbacks(List<test.de.iip_ecosphere.platform.transport.Product> received) Creates the linked ping-pong connector callbacks.protected de.iip_ecosphere.platform.connectors.ConnectorParametercreateConnectorParameter(String portDescriptor) Creates the connector parameter instance.private voidCreates the connector parameters.voidTests the connector through explicitly setting/resetting the factory implementation.
-
Field Details
-
CMD_CHANNEL
- See Also:
-
PROD_CHANNEL
- See Also:
-
appParams
private de.iip_ecosphere.platform.connectors.ConnectorParameter appParams -
machineParams
private de.iip_ecosphere.platform.connectors.ConnectorParameter machineParams -
app
private de.iip_ecosphere.platform.connectors.Connector<byte[],byte[], apptest.de.iip_ecosphere.platform.transport.Product, test.de.iip_ecosphere.platform.transport.Command> -
machine
private de.iip_ecosphere.platform.connectors.Connector<byte[],byte[], machinetest.de.iip_ecosphere.platform.transport.Command, test.de.iip_ecosphere.platform.transport.Product> -
comEmulator
-
-
Constructor Details
-
JSerialCommConnectorTest
public JSerialCommConnectorTest()
-
-
Method Details
-
createParameters
Creates the connector parameters.- Throws:
IOException- if creating the parameters fails
-
testConnector
Tests the connector through explicitly setting/resetting the factory implementation.- Throws:
IOException- in case that connection/communication fails
-
createCallbacks
private void createCallbacks(List<test.de.iip_ecosphere.platform.transport.Product> received) throws IOException Creates the linked ping-pong connector callbacks.- Parameters:
received- the received products, modified as a side effect- Throws:
IOException- if registring the callbacks fails
-
createConnectorParameter
protected de.iip_ecosphere.platform.connectors.ConnectorParameter createConnectorParameter(String portDescriptor) Creates the connector parameter instance.- Parameters:
portDescriptor- the comm port descriptor to use- Returns:
- the transport parameter
-