Class DeviceRegistryAasTest
java.lang.Object
test.de.iip_ecosphere.platform.support.TestWithPlugin
test.de.iip_ecosphere.platform.support.aas.TestWithPlugin
de.iip_ecosphere.platform.deviceMgt.registry.DeviceRegistryAasTest
public class DeviceRegistryAasTest
extends test.de.iip_ecosphere.platform.support.aas.TestWithPlugin
Tests the
DeviceRegistryAas.- Author:
- Dennis Pidun, University of Hildesheim
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringprivate de.iip_ecosphere.platform.support.aas.Aasprivate de.iip_ecosphere.platform.support.Serverstatic final Stringstatic final Stringprivate static final Class<?> private de.iip_ecosphere.platform.support.aas.SubmodelElementCollectionprivate de.iip_ecosphere.platform.support.Serverprivate MockInterceptorprivate de.iip_ecosphere.platform.support.aas.Submodelstatic final StringFields inherited from class test.de.iip_ecosphere.platform.support.TestWithPlugin
PROP_AAS_PLUGIN -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate de.iip_ecosphere.platform.support.aas.OperationgetOperation(String operationName) Returns an AAS operation from the resources submodel/device registry collection.voidTests that the AAS contribution is deployed.voidTests that the contributor class is loaded.static voidmockDeviceResource(String aDeviceId) Mocks a device resource.voidAdding a valid device exposes the IP.voidAdding a valid device adds the device.voidHardbeat leads to registry entry.voidHeartbeat leads to a callable.voidTests removing an invalid device identifier does not cause removing the device.voidRemoving a device with valid identifier causes removing the device.voidSending telemetry leads to telemetry in the registry.voidSending telemetry leads to a callable.voidsetUp()Sets up the test.voidtearDown()Teardown method, reset mocks.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
-
A_VALID_DEVICE
- See Also:
-
AN_INVALID_DEVICE
- See Also:
-
SOME_TELEMETRY_DATA
- See Also:
-
AN_IP
- See Also:
-
CONTRIBUTOR_CLASS
-
aas
private de.iip_ecosphere.platform.support.aas.Aas aas -
implServer
private de.iip_ecosphere.platform.support.Server implServer -
aasServer
private de.iip_ecosphere.platform.support.Server aasServer -
resourcesSubmodel
private de.iip_ecosphere.platform.support.aas.Submodel resourcesSubmodel -
deviceRegistry
private de.iip_ecosphere.platform.support.aas.SubmodelElementCollection deviceRegistry -
interceptor
-
-
Constructor Details
-
DeviceRegistryAasTest
public DeviceRegistryAasTest()
-
-
Method Details
-
setUp
Sets up the test.- Throws:
Exception- shall not occur
-
tearDown
public void tearDown()Teardown method, reset mocks. -
init_contributorClassLoads
public void init_contributorClassLoads()Tests that the contributor class is loaded. -
init_contributedAasIsDeployed
public void init_contributedAasIsDeployed()Tests that the AAS contribution is deployed. -
op_addDevice_withValidDeviceIdentifier_addsDevice
public void op_addDevice_withValidDeviceIdentifier_addsDevice() throws ExecutionException, IOExceptionAdding a valid device adds the device.- Throws:
ExecutionException- AAS execution problems shall not occurIOException- general IO problems shall not occur
-
op_addDevice_validDevice_exposesIp
Adding a valid device exposes the IP.- Throws:
ExecutionException- AAS execution problems shall not occurIOException- general IO problems shall not occur
-
op_removeDevice_withValidDeviceIdentifier_removesDevice
public void op_removeDevice_withValidDeviceIdentifier_removesDevice() throws ExecutionException, IOExceptionRemoving a device with valid identifier causes removing the device.- Throws:
ExecutionException- AAS execution problems shall not occurIOException- general IO problems shall not occur
-
op_imAlive_isCallable
Heartbeat leads to a callable.- Throws:
IOException- shall not occurExecutionException- AAS execution problems shall not occur
-
getOperation
Returns an AAS operation from the resources submodel/device registry collection.- Parameters:
operationName- the operation name- Returns:
- the operation
-
op_imAlive_callsImAliveFromRegistry
Hardbeat leads to registry entry.- Throws:
ExecutionException- AAS execution problems shall not occur
-
op_sendTelemetry_isCallable
Sending telemetry leads to a callable.- Throws:
ExecutionException- AAS execution problems shall not occur
-
op_sendTelemetry_deliversTelemetryToRegistry
Sending telemetry leads to telemetry in the registry.- Throws:
ExecutionException- AAS execution problems shall not occur
-
op_removeDevice_withInvalidDeviceIdentifier_doesNotRemoveDevice
public void op_removeDevice_withInvalidDeviceIdentifier_doesNotRemoveDevice() throws ExecutionException, IOExceptionTests removing an invalid device identifier does not cause removing the device.- Throws:
ExecutionException- AAS execution problems shall not occurIOException- general IO problems shall not occur
-
mockDeviceResource
Mocks a device resource.- Parameters:
aDeviceId- the id of the device to mock- Throws:
IOException- shall not occur
-