Class DeviceManagementAasTest
java.lang.Object
test.de.iip_ecosphere.platform.support.TestWithPlugin
test.de.iip_ecosphere.platform.support.aas.TestWithPlugin
de.iip_ecosphere.platform.deviceMgt.DeviceManagementAasTest
public class DeviceManagementAasTest
extends test.de.iip_ecosphere.platform.support.aas.TestWithPlugin
Tests the
DeviceManagementAas with respect to DeviceManagementAasClient.- Author:
- Dennis Pidun, University of Hildesheim
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringprivate static de.iip_ecosphere.platform.support.aas.Aasprivate static de.iip_ecosphere.platform.support.Serverprivate static de.iip_ecosphere.platform.support.Serverprivate static MockInterceptorprivate static org.mockito.MockedStatic<de.iip_ecosphere.platform.support.jsl.ServiceLoaderUtils> Fields inherited from class test.de.iip_ecosphere.platform.support.TestWithPlugin
PROP_AAS_PLUGIN -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidTests if the kind is set to active.voidTests if the AasContributor is deployed.voidTests if the AasContributorClass is loaded.(package private) static voidRegisters a device and turns it into a managed device Uses mock DeviceRegistry.voidTests if the AAS Operation "establishSSH" returns valid connection details under the condition that its a valid device and using the default implementation.voidTests if the AAS Operation "establishSSH" returns null under the condition that a real device is given, which responses with an invalid result.voidTests if the AAS Operation "establishSSH" returns valid ssh details under the condition that a real device is given, which responses with a valid result.voidTests if the AAS Operation "setConfig" won't set the config on an invalid device through internal aas DeviceManagement.voidTests if the AAS Operation "setConfig" won't set the config on an invalid device.voidTests if the AAS Operation "setConfig" set the config on a valid device through internal aas DeviceManagement.voidTests if the AAS Operation "setConfig" sets the config on a valid device.voidTests if the AAS Operation "updateRuntime" won't update the runtime on an invalid device through internal aas deviceManagement.voidTests if the AAS Operation "updateRuntime" won't update the runtime on an invalid device.voidTests if the AAS Operation "updateRuntime" updates the runtime on a valid device through internal aas deviceManagement.voidTests if the AAS Operation "updateRuntime" updates the runtime on a valid device.private static voidResets the device management.voidsetUp()Test setup method.static voidshutdown()Shuts down the test.static voidstartup()Initializes the test.voidtearDown()Test teardown method, basically resets all mocks and the service loader mechanism.(package private) static voidRemoves loaded FirmwareOperations from ServiceLoaderMechanism Uses static mocks for this process, which should be avoided, but needed in this case.(package private) static voidRemoves loaded RemoteAccessOperations from ServiceLoaderMechanism Uses static mocks for this process, which should be avoided, but needed in this case.(package private) static voidRemoves loaded ResourceConfigOperations from ServiceLoaderMechanism Uses static mocks for this process, which should be avoided, but needed in this case.Returns a listing of valid runtimes.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_DEVICE_ID
- See Also:
-
A_DEVICE_IP
- See Also:
-
A_CONFIG_PATH
- See Also:
-
A_CONFIG_DOWNLOAD_URI
- See Also:
-
A_LOCATION
- See Also:
-
A_DOWNLOADURL
- See Also:
-
aas
private static de.iip_ecosphere.platform.support.aas.Aas aas -
implServer
private static de.iip_ecosphere.platform.support.Server implServer -
aasServer
private static de.iip_ecosphere.platform.support.Server aasServer -
serviceLoader
private static org.mockito.MockedStatic<de.iip_ecosphere.platform.support.jsl.ServiceLoaderUtils> serviceLoader -
interceptor
-
-
Constructor Details
-
DeviceManagementAasTest
public DeviceManagementAasTest()
-
-
Method Details
-
startup
Initializes the test.- Throws:
IOException- shouldn't be thrown
-
shutdown
public static void shutdown()Shuts down the test. -
tearDown
Test teardown method, basically resets all mocks and the service loader mechanism.- Throws:
Exception- shouldn't be thrown
-
setUp
Test setup method.- Throws:
Exception- shouldn't be thrown
-
init_contributorClassLoads
public void init_contributorClassLoads()Tests if the AasContributorClass is loaded. -
init_contributedAasIsDeployed
Tests if the AasContributor is deployed.- Throws:
IOException- shouldn't be thrown
-
getKind_shouldBeActive
public void getKind_shouldBeActive()Tests if the kind is set to active. -
op_updateRuntime_withInvalidDeviceAndAasDevManager_wontUpdateRuntime
public void op_updateRuntime_withInvalidDeviceAndAasDevManager_wontUpdateRuntime() throws IOException, ExecutionExceptionTests if the AAS Operation "updateRuntime" won't update the runtime on an invalid device through internal aas deviceManagement. It is using the default implementation for runtime management (eg. AAS connection).- Throws:
IOException- shouldn't be thrownExecutionException- shouldn't be thrown
-
op_updateRuntime_withValidDeviceAndAasDevManager_updatesRuntimeOnDevice
public void op_updateRuntime_withValidDeviceAndAasDevManager_updatesRuntimeOnDevice() throws IOException, ExecutionExceptionTests if the AAS Operation "updateRuntime" updates the runtime on a valid device through internal aas deviceManagement. It is using the default implementation for runtime management (eg. AAS connection)- Throws:
IOException- shouldn't be thrownExecutionException- shouldn't be thrown
-
validRuntimesReducedListing
Returns a listing of valid runtimes.- Returns:
- the listing
-
op_updateRuntime_withInvalidDeviceAndLoadedDevManager_wontUpdateRuntime
public void op_updateRuntime_withInvalidDeviceAndLoadedDevManager_wontUpdateRuntime() throws IOException, ExecutionExceptionTests if the AAS Operation "updateRuntime" won't update the runtime on an invalid device. It is using a third party implementation for runtime management- Throws:
IOException- shouldn't be thrownExecutionException- shouldn't be thrown
-
op_updateRuntime_withValidDeviceAndLoadedDevManager_updatesRuntimeOnDevice
public void op_updateRuntime_withValidDeviceAndLoadedDevManager_updatesRuntimeOnDevice() throws IOException, ExecutionExceptionTests if the AAS Operation "updateRuntime" updates the runtime on a valid device. It is using a third party implementation for runtime management- Throws:
IOException- shouldn't be thrownExecutionException- shouldn't be thrown
-
op_setConfig_withInvalidDeviceAndAasDevManager_wontSetConfig
public void op_setConfig_withInvalidDeviceAndAasDevManager_wontSetConfig() throws IOException, ExecutionExceptionTests if the AAS Operation "setConfig" won't set the config on an invalid device through internal aas DeviceManagement. It is using the default implementation for configuration management (eg. AAS connection)- Throws:
IOException- shouldn't be thrownExecutionException- shouldn't be thrown
-
op_setConfig_withValidDeviceAndAasDevManager_setsConfigOnDevice
public void op_setConfig_withValidDeviceAndAasDevManager_setsConfigOnDevice() throws IOException, ExecutionExceptionTests if the AAS Operation "setConfig" set the config on a valid device through internal aas DeviceManagement. It is using the default implementation for configuration management (eg. AAS connection)- Throws:
IOException- shouldn't be thrownExecutionException- shouldn't be thrown
-
op_setConfig_withInvalidDeviceAndLoadedDevManager_wontSetConfig
public void op_setConfig_withInvalidDeviceAndLoadedDevManager_wontSetConfig() throws IOException, ExecutionExceptionTests if the AAS Operation "setConfig" won't set the config on an invalid device. It is using a third party implementation for configuration management- Throws:
IOException- shouldn't be thrownExecutionException- shouldn't be thrown
-
op_setConfig_withValidDeviceAndLoadedDevManager_setsConfigOnDevice
public void op_setConfig_withValidDeviceAndLoadedDevManager_setsConfigOnDevice() throws IOException, ExecutionExceptionTests if the AAS Operation "setConfig" sets the config on a valid device. It is using a third party implementation for configuration management- Throws:
IOException- shouldn't be thrownExecutionException- shouldn't be thrown
-
op_establishSsh_withValidDeviceAndLoadedDevManager_createsConnectionDetails
public void op_establishSsh_withValidDeviceAndLoadedDevManager_createsConnectionDetails() throws IOException, ExecutionExceptionTests if the AAS Operation "establishSSH" returns valid ssh details under the condition that a real device is given, which responses with a valid result. It is using a third party implementation for ssh servers.- Throws:
IOException- shouldn't be thrownExecutionException- shouldn't be thrown
-
op_establishSsh_withValidDeviceAndDefaultDevManager_letsDeviceCreateCredentials
public void op_establishSsh_withValidDeviceAndDefaultDevManager_letsDeviceCreateCredentials() throws IOException, ExecutionExceptionTests if the AAS Operation "establishSSH" returns valid connection details under the condition that its a valid device and using the default implementation. It is using the default implementation for ssh servers (proxy <-> apachesshd)- Throws:
IOException- shouldn't be thrownExecutionException- shouldn't be thrown
-
op_establishSsh_withValidDeviceAndInvalidDeviceResponse_returnsNull
public void op_establishSsh_withValidDeviceAndInvalidDeviceResponse_returnsNull() throws IOException, ExecutionExceptionTests if the AAS Operation "establishSSH" returns null under the condition that a real device is given, which responses with an invalid result. It is using the default implementation for ssh servers (proxy <-> apachesshd)- Throws:
IOException- shouldn't be thrownExecutionException- shouldn't be thrown
-
unloadFirmwareOperations
static void unloadFirmwareOperations()Removes loaded FirmwareOperations from ServiceLoaderMechanism Uses static mocks for this process, which should be avoided, but needed in this case. -
unloadResourceConfigOperations
static void unloadResourceConfigOperations()Removes loaded ResourceConfigOperations from ServiceLoaderMechanism Uses static mocks for this process, which should be avoided, but needed in this case. -
unloadRemoteAccessOperations
static void unloadRemoteAccessOperations()Removes loaded RemoteAccessOperations from ServiceLoaderMechanism Uses static mocks for this process, which should be avoided, but needed in this case. -
makeDeviceAvailable
Registers a device and turns it into a managed device Uses mock DeviceRegistry.- Throws:
ExecutionException- shouldn't be thrownIOException- shouldn't be thrown
-
resetDeviceManagement
private static void resetDeviceManagement()Resets the device management.
-