Class FactoryTest


  • public class FactoryTest
    extends java.lang.Object
    Tests the factory/descriptor.
    Author:
    Holger Eichelberger, SSE
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      private static class  FactoryTest.DisabledFactory
      A factory that reacts like the DUMMY factory but is a different instance.
    • Constructor Summary

      Constructors 
      Constructor Description
      FactoryTest()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void assertConstants()
      Asserting plain constants is ridiculous.
      private static void assertRegistry​(de.iip_ecosphere.platform.support.aas.Registry reg)
      Asserts a default/dummy registry instance.
      static de.iip_ecosphere.platform.support.aas.AasFactory createDisabledFactory()
      Creates a factory instance that does nothing.
      void langStringTest()
      Tests the LangString.
      void testDummyFactory()
      Tests explicitly setting the dummy factory.
      void testFakeFactory()
      Tests that there is a fake factory through Java Service loader.
      • Methods inherited from class java.lang.Object

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

      • FactoryTest

        public FactoryTest()
    • Method Detail

      • createDisabledFactory

        public static de.iip_ecosphere.platform.support.aas.AasFactory createDisabledFactory()
        Creates a factory instance that does nothing. The instance delegates to AasFactory.DUMMY to keep this instance in the testing loop.
        Returns:
        the factory instance
      • testFakeFactory

        public void testFakeFactory()
                             throws java.io.IOException
        Tests that there is a fake factory through Java Service loader.
        Throws:
        java.io.IOException - shall not occur
      • testDummyFactory

        public void testDummyFactory()
                              throws java.io.IOException
        Tests explicitly setting the dummy factory.
        Throws:
        java.io.IOException - shall not occur
      • assertRegistry

        private static void assertRegistry​(de.iip_ecosphere.platform.support.aas.Registry reg)
                                    throws java.io.IOException
        Asserts a default/dummy registry instance.
        Parameters:
        reg - the registry instance
        Throws:
        java.io.IOException - shall not occur
      • assertConstants

        public void assertConstants()
        Asserting plain constants is ridiculous. Real function happens in implementation components.
      • langStringTest

        public void langStringTest()
        Tests the LangString.