Class EcsAasTest
java.lang.Object
test.de.iip_ecosphere.platform.support.TestWithPlugin
test.de.iip_ecosphere.platform.support.aas.TestWithPlugin
test.de.iip_ecosphere.platform.transport.TestWithQpid
test.de.iip_ecosphere.platform.ecsRuntime.EcsAasTest
public class EcsAasTest
extends test.de.iip_ecosphere.platform.transport.TestWithQpid
Tests the
EcsAas.- Author:
- Holger Eichelberger, SSE
-
Field Summary
FieldsModifier and TypeFieldDescriptionA predicate testing whether the value of a JSON gauge is positive.private static de.iip_ecosphere.platform.support.ServerFields inherited from class test.de.iip_ecosphere.platform.support.TestWithPlugin
PROP_AAS_PLUGIN -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidassertMetrics(Map<String, Predicate<Object>> expected) Asserts the existence of selected AAS metrics and/or their values.static voidshutdown()Shuts down the test.static voidstartup()Initializes the test.private voidtest(de.iip_ecosphere.platform.ecsRuntime.EcsAasClient client) Tests the givenclient.voidtestAas()Tests theEcsAas.voidTests theEcsAasvia the lifecycle descriptors.Methods inherited from class test.de.iip_ecosphere.platform.transport.TestWithQpid
addPlugin, fromPlugin, stopQpidMethods 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
-
qpid
private static de.iip_ecosphere.platform.support.Server qpid -
POSITIVE_GAUGE_VALUE
A predicate testing whether the value of a JSON gauge is positive.
-
-
Constructor Details
-
EcsAasTest
public EcsAasTest()
-
-
Method Details
-
startup
public static void startup()Initializes the test. -
shutdown
public static void shutdown()Shuts down the test. -
testAas
Tests theEcsAas.- Throws:
IOException- shall not occurExecutionException- shall not occurURISyntaxException- shall not occur
-
testLifecycle
Tests theEcsAasvia the lifecycle descriptors.- Throws:
IOException- shall not occurExecutionException- shall not occurURISyntaxException- shall not occur
-
assertMetrics
private void assertMetrics(Map<String, Predicate<Object>> expected) throws IOException, ExecutionExceptionAsserts the existence of selected AAS metrics and/or their values.- Parameters:
expected- the expected metrics as key-predicate pairs, whereby the predicate may be null to indicated that the value shall not be tested- Throws:
IOException- if the AAS cannot be retrievedExecutionException- if a property cannot be queried
-
test
private void test(de.iip_ecosphere.platform.ecsRuntime.EcsAasClient client) throws ExecutionException, URISyntaxException, IOException Tests the givenclient.- Parameters:
client- the client to test- Throws:
ExecutionException- shall not occurURISyntaxException- shall not occurIOException- shall not occur
-