Class EcsAasTest


  • public class EcsAasTest
    extends java.lang.Object
    Tests the EcsAas.
    Author:
    Holger Eichelberger, SSE
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.util.function.Predicate<java.lang.Object> POSITIVE_GAUGE_VALUE
      A predicate testing whether the value of a JSON gauge is positive.
      private static de.iip_ecosphere.platform.support.Server qpid  
    • Constructor Summary

      Constructors 
      Constructor Description
      EcsAasTest()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private void assertMetrics​(java.util.Map<java.lang.String,​java.util.function.Predicate<java.lang.Object>> expected)
      Asserts the existence of selected AAS metrics and/or their values.
      static void shutdown()
      Shuts down the test.
      static void startup()
      Initializes the test.
      private void test​(de.iip_ecosphere.platform.ecsRuntime.EcsAasClient client)
      Tests the given client.
      void testAas()
      Tests the EcsAas.
      void testLifecycle()
      Tests the EcsAas via the lifecycle descriptors.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • qpid

        private static de.iip_ecosphere.platform.support.Server qpid
      • POSITIVE_GAUGE_VALUE

        private static final java.util.function.Predicate<java.lang.Object> POSITIVE_GAUGE_VALUE
        A predicate testing whether the value of a JSON gauge is positive.
    • Constructor Detail

      • EcsAasTest

        public EcsAasTest()
    • Method Detail

      • startup

        public static void startup()
        Initializes the test.
      • shutdown

        public static void shutdown()
        Shuts down the test.
      • testAas

        public void testAas()
                     throws java.io.IOException,
                            java.util.concurrent.ExecutionException,
                            java.net.URISyntaxException
        Tests the EcsAas.
        Throws:
        java.io.IOException - shall not occur
        java.util.concurrent.ExecutionException - shall not occur
        java.net.URISyntaxException - shall not occur
      • testLifecycle

        public void testLifecycle()
                           throws java.io.IOException,
                                  java.util.concurrent.ExecutionException,
                                  java.net.URISyntaxException
        Tests the EcsAas via the lifecycle descriptors.
        Throws:
        java.io.IOException - shall not occur
        java.util.concurrent.ExecutionException - shall not occur
        java.net.URISyntaxException - shall not occur
      • assertMetrics

        private void assertMetrics​(java.util.Map<java.lang.String,​java.util.function.Predicate<java.lang.Object>> expected)
                            throws java.io.IOException,
                                   java.util.concurrent.ExecutionException
        Asserts 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:
        java.io.IOException - if the AAS cannot be retrieved
        java.util.concurrent.ExecutionException - if a property cannot be queried
      • test

        private void test​(de.iip_ecosphere.platform.ecsRuntime.EcsAasClient client)
                   throws java.util.concurrent.ExecutionException,
                          java.net.URISyntaxException,
                          java.io.IOException
        Tests the given client.
        Parameters:
        client - the client to test
        Throws:
        java.util.concurrent.ExecutionException - shall not occur
        java.net.URISyntaxException - shall not occur
        java.io.IOException - shall not occur