Class ConnectorsAasTest
java.lang.Object
test.de.iip_ecosphere.platform.support.TestWithPlugin
test.de.iip_ecosphere.platform.support.aas.TestWithPlugin
test.de.iip_ecosphere.platform.connectors.ConnectorsAasTest
public class ConnectorsAasTest
extends test.de.iip_ecosphere.platform.support.aas.TestWithPlugin
Tests the connectors AAS.
- Author:
- Holger Eichelberger, SSE
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classImplements a fake/mock connector withMachineConnector.static classA test descriptor.private static classImplements a fake/mock connector withoutMachineConnector.static classA test descriptor.private static classSome input data.private static classSome input data.private static classSome output data.private static classSome output data. -
Field Summary
FieldsFields inherited from class test.de.iip_ecosphere.platform.support.TestWithPlugin
PROP_AAS_PLUGIN -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static voidassertBooleanProperty(boolean expected, de.iip_ecosphere.platform.support.aas.SubmodelElementCollection sec, String propertyName) Asserts a boolean property on a sub-model element collection.private static voidassertReferenceElement(boolean hasRef, de.iip_ecosphere.platform.support.aas.SubmodelElementCollection sec, String propertyName) Asserts a reference element.private static voidassertStringProperty(String expected, de.iip_ecosphere.platform.support.aas.SubmodelElementCollection sec, String propertyName) Asserts a String property on a sub-model element collection.Creates an instance ofConnectorsAasTest.Connector1.Creates an instance ofConnectorsAasTest.Connector1.private voidprintOut(de.iip_ecosphere.platform.support.aas.Aas aas) Print the AAS to the console.voidtestAas()Tests the connectors AAS.private voidtestActiveDescriptors(List<de.iip_ecosphere.platform.connectors.Connector<?, ?, ?, ?>> connectors, int expectedActive) Tests the connector descriptors in their sub-model.private voidtestDescriptorsSubmodel(de.iip_ecosphere.platform.support.aas.Aas aas) Tests the connector descriptors in their sub model.Methods inherited from class test.de.iip_ecosphere.platform.support.aas.TestWithPlugin
setAasPluginId, setup, setupAASPluginsMethods inherited from class test.de.iip_ecosphere.platform.support.TestWithPlugin
addPluginLocation, addRunAfterLoading, clear, enableLocalPlugins, loadPlugins, setInstallDir
-
Field Details
-
NAME_CONN1
- See Also:
-
NAME_CONN2
- See Also:
-
-
Constructor Details
-
ConnectorsAasTest
public ConnectorsAasTest()
-
-
Method Details
-
printOut
private void printOut(de.iip_ecosphere.platform.support.aas.Aas aas) Print the AAS to the console.- Parameters:
aas- the AAS to print
-
testAas
Tests the connectors AAS.- Throws:
IOException- shall not occur
-
createConnector1Instance
private static ConnectorsAasTest.Connector1<ConnectorsAasTest.DataOut1,ConnectorsAasTest.DataIn1> createConnector1Instance()Creates an instance ofConnectorsAasTest.Connector1.- Returns:
- the instance
-
createConnector2Instance
private static ConnectorsAasTest.Connector2<ConnectorsAasTest.DataOut2,ConnectorsAasTest.DataIn2> createConnector2Instance()Creates an instance ofConnectorsAasTest.Connector1.- Returns:
- the instance
-
testDescriptorsSubmodel
private void testDescriptorsSubmodel(de.iip_ecosphere.platform.support.aas.Aas aas) Tests the connector descriptors in their sub model.- Parameters:
aas- the AAS to inspect
-
assertBooleanProperty
private static void assertBooleanProperty(boolean expected, de.iip_ecosphere.platform.support.aas.SubmodelElementCollection sec, String propertyName) throws ExecutionException Asserts a boolean property on a sub-model element collection.- Parameters:
expected- the expected valuesec- the sub-model element collectionpropertyName- the property name- Throws:
ExecutionException- in case that the property cannot be read
-
assertStringProperty
private static void assertStringProperty(String expected, de.iip_ecosphere.platform.support.aas.SubmodelElementCollection sec, String propertyName) throws ExecutionException Asserts a String property on a sub-model element collection.- Parameters:
expected- the expected valuesec- the sub-model element collectionpropertyName- the property name- Throws:
ExecutionException- in case that the property cannot be read
-
assertReferenceElement
private static void assertReferenceElement(boolean hasRef, de.iip_ecosphere.platform.support.aas.SubmodelElementCollection sec, String propertyName) throws ExecutionException Asserts a reference element.- Parameters:
hasRef- whether there shall be a reference valuesec- the sub-model element collectionpropertyName- the property name- Throws:
ExecutionException- in case that the property cannot be read
-
testActiveDescriptors
private void testActiveDescriptors(List<de.iip_ecosphere.platform.connectors.Connector<?, ?, throws IOException?, ?>> connectors, int expectedActive) Tests the connector descriptors in their sub-model. As we operate on a deployed modified AAS, it is important to retrieve a new one.- Parameters:
connectors- all connectors instantiated for this test, active an non-activeexpectedActive- the expected number of connectors in the active sub-model- Throws:
IOException- shall not occur
-