Class AasConnectorTest
- java.lang.Object
-
- test.de.iip_ecosphere.platform.connectors.AbstractInformationModelConnectorTest<java.lang.Object>
-
- test.de.iip_ecosphere.platform.connectors.aas.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>TestsAasConnectorwith polling and no security.- Author:
- Holger Eichelberger, SSE
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.StringAAS_URNprivate static de.iip_ecosphere.platform.support.ServerAddressaasServerprivate static de.iip_ecosphere.platform.support.ServerccServerprivate static de.iip_ecosphere.platform.support.ServerhttpServerprivate static de.iip_ecosphere.platform.support.net.KeyStoreDescriptorkeyDescprivate static org.slf4j.LoggerLOGGERprivate static de.iip_ecosphere.platform.support.iip_aas.ActiveAasBase.NotificationModeoldNotificationModeprivate static de.iip_ecosphere.platform.support.iip_aas.AasPartRegistry.AasSetupoldSetupprivate static de.iip_ecosphere.platform.support.ServerplatformAasServerprivate static de.iip_ecosphere.platform.support.Serverrepositoryprivate static de.iip_ecosphere.platform.support.ServerAddressVAB_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 voidadditionalFromActions(de.iip_ecosphere.platform.connectors.model.ModelAccess access, test.de.iip_ecosphere.platform.connectors.MachineCommand data)voidafterActions(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)voidassertAdditionalProperties(test.de.iip_ecosphere.platform.connectors.AbstractInformationModelConnectorTest.Step step, test.de.iip_ecosphere.platform.connectors.MachineData received)static de.iip_ecosphere.platform.support.aas.AascreateAAS()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.ConnectorParametergetConnectorParameter()java.lang.StringgetQNameOperationStartMachine()java.lang.StringgetQNameOperationStopMachine()java.lang.StringgetQNameVarLotSize()java.lang.StringgetQNameVarPowerConsumption()private static de.iip_ecosphere.platform.support.EndpointgetRegistryEndpoint()Returns the registry endpoint foraasServer.java.lang.StringgetTopLevelModelPartName()java.lang.StringgetVendor(de.iip_ecosphere.platform.connectors.model.ModelAccess access)static voidinit()Sets the test up by starting an embedded OPC UA server.voidinitializeModelAccess(de.iip_ecosphere.platform.connectors.model.ModelAccess access, boolean withNotifications)protected static voidsetKeystoreDescriptor(de.iip_ecosphere.platform.support.net.KeyStoreDescriptor desc)Changes the keystore descriptor, e.g., to go for HTTPS/TLS.static voidshutdown()Shuts down the test server.voidtestWithPolling()Tests the connector in polling mode.
-
-
-
Field Detail
-
LOGGER
private static final org.slf4j.Logger LOGGER
-
AAS_URN
private static final java.lang.String AAS_URN
- See Also:
- Constant Field Values
-
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
-
-
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.UnknownHostExceptionSets the test up by starting an embedded OPC UA server.- Throws:
java.net.SocketException- if the port to be used for the AAS is occupiedjava.net.UnknownHostException- shall not occur
-
getRegistryEndpoint
private static de.iip_ecosphere.platform.support.Endpoint getRegistryEndpoint()
Returns the registry endpoint foraasServer.- 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.UnknownHostExceptionThis 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 occupiedjava.net.UnknownHostException- shall not occur
-
testWithPolling
public void testWithPolling() throws java.io.IOExceptionTests 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:
getConnectorDescriptorin classtest.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:
createConnectorin classtest.de.iip_ecosphere.platform.connectors.AbstractInformationModelConnectorTest<java.lang.Object>
-
getConnectorParameter
protected de.iip_ecosphere.platform.connectors.ConnectorParameter getConnectorParameter()
- Specified by:
getConnectorParameterin classtest.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:
assertAdditionalPropertiesin classtest.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:
afterActionsin classtest.de.iip_ecosphere.platform.connectors.AbstractInformationModelConnectorTest<java.lang.Object>
-
-