Class JSerialCommConnectorTest

java.lang.Object
test.de.oktoflow.platform.connectors.serial.JSerialCommConnectorTest

public class JSerialCommConnectorTest extends Object
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

    Fields
    Modifier and Type
    Field
    Description
    private 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.ConnectorParameter
     
    private static final String
     
    private Process
     
    private 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.ConnectorParameter
     
    private static final String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    private void
    createCallbacks(List<test.de.iip_ecosphere.platform.transport.Product> received)
    Creates the linked ping-pong connector callbacks.
    protected de.iip_ecosphere.platform.connectors.ConnectorParameter
    Creates the connector parameter instance.
    private void
    Creates the connector parameters.
    void
    Tests the connector through explicitly setting/resetting the factory implementation.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • CMD_CHANNEL

      private static final String CMD_CHANNEL
      See Also:
    • PROD_CHANNEL

      private static final String 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[],test.de.iip_ecosphere.platform.transport.Product,test.de.iip_ecosphere.platform.transport.Command> app
    • machine

      private de.iip_ecosphere.platform.connectors.Connector<byte[],byte[],test.de.iip_ecosphere.platform.transport.Command,test.de.iip_ecosphere.platform.transport.Product> machine
    • comEmulator

      private Process comEmulator
  • Constructor Details

    • JSerialCommConnectorTest

      public JSerialCommConnectorTest()
  • Method Details

    • createParameters

      private void createParameters() throws IOException
      Creates the connector parameters.
      Throws:
      IOException - if creating the parameters fails
    • testConnector

      public void testConnector() throws IOException
      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