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 Details

    • A_VALID_DEVICE

      public static final String A_VALID_DEVICE
      See Also:
    • AN_INVALID_DEVICE

      public static final String AN_INVALID_DEVICE
      See Also:
    • SOME_TELEMETRY_DATA

      public static final String SOME_TELEMETRY_DATA
      See Also:
    • AN_IP

      public static final String AN_IP
      See Also:
    • CONTRIBUTOR_CLASS

      private static final Class<?> 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

      private MockInterceptor interceptor
  • Constructor Details

    • DeviceRegistryAasTest

      public DeviceRegistryAasTest()
  • Method Details

    • setUp

      public void setUp() throws Exception
      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, IOException
      Adding a valid device adds the device.
      Throws:
      ExecutionException - AAS execution problems shall not occur
      IOException - general IO problems shall not occur
    • op_addDevice_validDevice_exposesIp

      public void op_addDevice_validDevice_exposesIp() throws IOException, ExecutionException
      Adding a valid device exposes the IP.
      Throws:
      ExecutionException - AAS execution problems shall not occur
      IOException - general IO problems shall not occur
    • op_removeDevice_withValidDeviceIdentifier_removesDevice

      public void op_removeDevice_withValidDeviceIdentifier_removesDevice() throws ExecutionException, IOException
      Removing a device with valid identifier causes removing the device.
      Throws:
      ExecutionException - AAS execution problems shall not occur
      IOException - general IO problems shall not occur
    • op_imAlive_isCallable

      public void op_imAlive_isCallable() throws IOException, ExecutionException
      Heartbeat leads to a callable.
      Throws:
      IOException - shall not occur
      ExecutionException - AAS execution problems shall not occur
    • getOperation

      private de.iip_ecosphere.platform.support.aas.Operation getOperation(String operationName)
      Returns an AAS operation from the resources submodel/device registry collection.
      Parameters:
      operationName - the operation name
      Returns:
      the operation
    • op_imAlive_callsImAliveFromRegistry

      public void op_imAlive_callsImAliveFromRegistry() throws ExecutionException
      Hardbeat leads to registry entry.
      Throws:
      ExecutionException - AAS execution problems shall not occur
    • op_sendTelemetry_isCallable

      public void op_sendTelemetry_isCallable() throws ExecutionException
      Sending telemetry leads to a callable.
      Throws:
      ExecutionException - AAS execution problems shall not occur
    • op_sendTelemetry_deliversTelemetryToRegistry

      public void op_sendTelemetry_deliversTelemetryToRegistry() throws ExecutionException
      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, IOException
      Tests removing an invalid device identifier does not cause removing the device.
      Throws:
      ExecutionException - AAS execution problems shall not occur
      IOException - general IO problems shall not occur
    • mockDeviceResource

      public static void mockDeviceResource(String aDeviceId) throws IOException
      Mocks a device resource.
      Parameters:
      aDeviceId - the id of the device to mock
      Throws:
      IOException - shall not occur