Class AasConnectorTest

  • All Implemented Interfaces:
    test.de.iip_ecosphere.platform.connectors.MachineCommandInputTranslator.InputCustomizer, test.de.iip_ecosphere.platform.connectors.MachineDataOutputTranslator.OutputCustomizer
    Direct Known Subclasses:
    TlsAasConnectorTest

    public class AasConnectorTest
    extends test.de.iip_ecosphere.platform.connectors.AbstractInformationModelConnectorTest<java.lang.Object>
    Tests AasConnector with polling and no security.
    Author:
    Holger Eichelberger, SSE
    • Nested Class Summary

      • Nested classes/interfaces inherited from class test.de.iip_ecosphere.platform.connectors.AbstractInformationModelConnectorTest

        test.de.iip_ecosphere.platform.connectors.AbstractInformationModelConnectorTest.Step
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.lang.String AAS_URN  
      private static de.iip_ecosphere.platform.support.ServerAddress aasServer  
      private static de.iip_ecosphere.platform.support.Server ccServer  
      private static de.iip_ecosphere.platform.support.Server httpServer  
      private static de.iip_ecosphere.platform.support.net.KeyStoreDescriptor keyDesc  
      private static org.slf4j.Logger LOGGER  
      private static de.iip_ecosphere.platform.support.iip_aas.ActiveAasBase.NotificationMode oldNotificationMode  
      private static de.iip_ecosphere.platform.support.iip_aas.AasPartRegistry.AasSetup oldSetup  
      private static de.iip_ecosphere.platform.support.Server platformAasServer  
      private static de.iip_ecosphere.platform.support.Server repository  
      private static de.iip_ecosphere.platform.support.ServerAddress VAB_SERVER  
    • Constructor Summary

      Constructors 
      Constructor Description
      AasConnectorTest()
      Creates an instance of this test.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void additionalFromActions​(de.iip_ecosphere.platform.connectors.model.ModelAccess access, test.de.iip_ecosphere.platform.connectors.MachineCommand data)  
      void afterActions​(de.iip_ecosphere.platform.connectors.Connector<java.lang.Object,​java.lang.Object,​test.de.iip_ecosphere.platform.connectors.MachineData,​test.de.iip_ecosphere.platform.connectors.MachineCommand> connector)  
      void assertAdditionalProperties​(test.de.iip_ecosphere.platform.connectors.AbstractInformationModelConnectorTest.Step step, test.de.iip_ecosphere.platform.connectors.MachineData received)  
      static de.iip_ecosphere.platform.support.aas.Aas createAAS()
      This method creates and starts the Asset Administration Shell.
      protected de.iip_ecosphere.platform.connectors.Connector<java.lang.Object,​java.lang.Object,​test.de.iip_ecosphere.platform.connectors.MachineData,​test.de.iip_ecosphere.platform.connectors.MachineCommand> createConnector​(de.iip_ecosphere.platform.connectors.types.ProtocolAdapter<java.lang.Object,​java.lang.Object,​test.de.iip_ecosphere.platform.connectors.MachineData,​test.de.iip_ecosphere.platform.connectors.MachineCommand> adapter)  
      protected java.lang.Class<? extends de.iip_ecosphere.platform.connectors.ConnectorDescriptor> getConnectorDescriptor()  
      protected de.iip_ecosphere.platform.connectors.ConnectorParameter getConnectorParameter()  
      java.lang.String getQNameOperationStartMachine()  
      java.lang.String getQNameOperationStopMachine()  
      java.lang.String getQNameVarLotSize()  
      java.lang.String getQNameVarPowerConsumption()  
      private static de.iip_ecosphere.platform.support.Endpoint getRegistryEndpoint()
      Returns the registry endpoint for aasServer.
      java.lang.String getTopLevelModelPartName()  
      java.lang.String getVendor​(de.iip_ecosphere.platform.connectors.model.ModelAccess access)  
      static void init()
      Sets the test up by starting an embedded OPC UA server.
      void initializeModelAccess​(de.iip_ecosphere.platform.connectors.model.ModelAccess access, boolean withNotifications)  
      protected static void setKeystoreDescriptor​(de.iip_ecosphere.platform.support.net.KeyStoreDescriptor desc)
      Changes the keystore descriptor, e.g., to go for HTTPS/TLS.
      static void shutdown()
      Shuts down the test server.
      void testWithPolling()
      Tests the connector in polling mode.
      • Methods inherited from class test.de.iip_ecosphere.platform.connectors.AbstractInformationModelConnectorTest

        block, testConnector
      • Methods inherited from class java.lang.Object

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

      • LOGGER

        private static final org.slf4j.Logger LOGGER
      • VAB_SERVER

        private static final de.iip_ecosphere.platform.support.ServerAddress VAB_SERVER
      • keyDesc

        private static de.iip_ecosphere.platform.support.net.KeyStoreDescriptor keyDesc
      • platformAasServer

        private static de.iip_ecosphere.platform.support.Server platformAasServer
      • httpServer

        private static de.iip_ecosphere.platform.support.Server httpServer
      • ccServer

        private static de.iip_ecosphere.platform.support.Server ccServer
      • repository

        private static de.iip_ecosphere.platform.support.Server repository
      • oldNotificationMode

        private static de.iip_ecosphere.platform.support.iip_aas.ActiveAasBase.NotificationMode oldNotificationMode
      • oldSetup

        private static de.iip_ecosphere.platform.support.iip_aas.AasPartRegistry.AasSetup oldSetup
      • aasServer

        private static de.iip_ecosphere.platform.support.ServerAddress aasServer
    • Constructor Detail

      • AasConnectorTest

        public AasConnectorTest()
        Creates an instance of this test.
    • Method Detail

      • setKeystoreDescriptor

        protected static void setKeystoreDescriptor​(de.iip_ecosphere.platform.support.net.KeyStoreDescriptor desc)
        Changes the keystore descriptor, e.g., to go for HTTPS/TLS.
        Parameters:
        desc - the keystore descriptor to use
      • init

        public static void init()
                         throws java.net.SocketException,
                                java.net.UnknownHostException
        Sets the test up by starting an embedded OPC UA server.
        Throws:
        java.net.SocketException - if the port to be used for the AAS is occupied
        java.net.UnknownHostException - shall not occur
      • getRegistryEndpoint

        private static de.iip_ecosphere.platform.support.Endpoint getRegistryEndpoint()
        Returns the registry endpoint for aasServer.
        Returns:
        the endpoint
      • shutdown

        public static void shutdown()
        Shuts down the test server.
      • createAAS

        public static de.iip_ecosphere.platform.support.aas.Aas createAAS()
                                                                   throws java.net.SocketException,
                                                                          java.net.UnknownHostException
        This method creates and starts the Asset Administration Shell.
        Returns:
        the created AAS instance
        Throws:
        java.net.SocketException - if the port to be used for the AAS is occupied
        java.net.UnknownHostException - shall not occur
      • testWithPolling

        public void testWithPolling()
                             throws java.io.IOException
        Tests the connector in polling mode.
        Throws:
        java.io.IOException - in case that creating the connector fails
      • getConnectorDescriptor

        protected java.lang.Class<? extends de.iip_ecosphere.platform.connectors.ConnectorDescriptor> getConnectorDescriptor()
        Specified by:
        getConnectorDescriptor in class test.de.iip_ecosphere.platform.connectors.AbstractInformationModelConnectorTest<java.lang.Object>
      • createConnector

        protected de.iip_ecosphere.platform.connectors.Connector<java.lang.Object,​java.lang.Object,​test.de.iip_ecosphere.platform.connectors.MachineData,​test.de.iip_ecosphere.platform.connectors.MachineCommand> createConnector​(de.iip_ecosphere.platform.connectors.types.ProtocolAdapter<java.lang.Object,​java.lang.Object,​test.de.iip_ecosphere.platform.connectors.MachineData,​test.de.iip_ecosphere.platform.connectors.MachineCommand> adapter)
        Specified by:
        createConnector in class test.de.iip_ecosphere.platform.connectors.AbstractInformationModelConnectorTest<java.lang.Object>
      • getConnectorParameter

        protected de.iip_ecosphere.platform.connectors.ConnectorParameter getConnectorParameter()
        Specified by:
        getConnectorParameter in class test.de.iip_ecosphere.platform.connectors.AbstractInformationModelConnectorTest<java.lang.Object>
      • getQNameOperationStartMachine

        public java.lang.String getQNameOperationStartMachine()
      • getQNameOperationStopMachine

        public java.lang.String getQNameOperationStopMachine()
      • getQNameVarLotSize

        public java.lang.String getQNameVarLotSize()
      • getTopLevelModelPartName

        public java.lang.String getTopLevelModelPartName()
      • additionalFromActions

        public void additionalFromActions​(de.iip_ecosphere.platform.connectors.model.ModelAccess access,
                                          test.de.iip_ecosphere.platform.connectors.MachineCommand data)
                                   throws java.io.IOException
        Throws:
        java.io.IOException
      • initializeModelAccess

        public void initializeModelAccess​(de.iip_ecosphere.platform.connectors.model.ModelAccess access,
                                          boolean withNotifications)
                                   throws java.io.IOException
        Throws:
        java.io.IOException
      • getVendor

        public java.lang.String getVendor​(de.iip_ecosphere.platform.connectors.model.ModelAccess access)
                                   throws java.io.IOException
        Throws:
        java.io.IOException
      • getQNameVarPowerConsumption

        public java.lang.String getQNameVarPowerConsumption()
      • assertAdditionalProperties

        public void assertAdditionalProperties​(test.de.iip_ecosphere.platform.connectors.AbstractInformationModelConnectorTest.Step step,
                                               test.de.iip_ecosphere.platform.connectors.MachineData received)
        Specified by:
        assertAdditionalProperties in class test.de.iip_ecosphere.platform.connectors.AbstractInformationModelConnectorTest<java.lang.Object>
      • afterActions

        public void afterActions​(de.iip_ecosphere.platform.connectors.Connector<java.lang.Object,​java.lang.Object,​test.de.iip_ecosphere.platform.connectors.MachineData,​test.de.iip_ecosphere.platform.connectors.MachineCommand> connector)
        Specified by:
        afterActions in class test.de.iip_ecosphere.platform.connectors.AbstractInformationModelConnectorTest<java.lang.Object>