Class ServiceMgrAndDescriptorTest


  • public class ServiceMgrAndDescriptorTest
    extends java.lang.Object
    Tests selected service manager functionality based on simplified instances of a service manager loaded from a descriptor file.
    Author:
    Holger Eichelberger, SSE
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private static void assertFunctionDef​(java.lang.String expected, de.iip_ecosphere.platform.services.ServiceManager mgr, java.lang.String... serviceId)
      Asserts a function definition.
      (package private) static de.iip_ecosphere.platform.services.ServiceManager createServiceManager​(java.io.File descriptor)
      Creates a simple service manager from loading a YAML file.
      void testAppId()
      Tests SpringCloudServiceManager.addAppId(String, List).
      void testInternalConnections()
      Tests AbstractServiceManager.determineInternalConnections(ServiceManager, String...) in combination with SpringCloudServiceDescriptor.toFunctionDefinition(Set).
      void testOptions()
      Tests SpringCloudServiceManager.handleOptions(Map, ServiceManager, String...).
      void testSpringConditionals()
      Tests SpringCloudServiceManager.determineSpringConditionals(ServiceManager, String...).
      void testTopLevel()
      Tests SpringCloudServiceManager.handleOptions(Map, ServiceManager, String...).
      • Methods inherited from class java.lang.Object

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

      • ServiceMgrAndDescriptorTest

        public ServiceMgrAndDescriptorTest()
    • Method Detail

      • createServiceManager

        static de.iip_ecosphere.platform.services.ServiceManager createServiceManager​(java.io.File descriptor)
                                                                               throws java.io.IOException
        Creates a simple service manager from loading a YAML file. Only basic operations referring to the loaded artifact descriptor and the contained services are implemented.
        Parameters:
        descriptor - the descriptor to load
        Returns:
        the service manager instance
        Throws:
        java.io.IOException - if the descriptor cannot be loaded for some reason
      • assertFunctionDef

        private static void assertFunctionDef​(java.lang.String expected,
                                              de.iip_ecosphere.platform.services.ServiceManager mgr,
                                              java.lang.String... serviceId)
        Asserts a function definition.
        Parameters:
        expected - the expected result
        mgr - the service manager instance
        serviceId - the service ids to operate on
      • testInternalConnections

        public void testInternalConnections()
                                     throws java.io.IOException
        Tests AbstractServiceManager.determineInternalConnections(ServiceManager, String...) in combination with SpringCloudServiceDescriptor.toFunctionDefinition(Set).
        Throws:
        java.io.IOException - if loading the test descriptor "ServiceMesh3Deployment.yml" fails
      • testSpringConditionals

        public void testSpringConditionals()
                                    throws java.io.IOException
        Tests SpringCloudServiceManager.determineSpringConditionals(ServiceManager, String...).
        Throws:
        java.io.IOException - if loading the test descriptor "ServiceMesh3Deployment.yml" fails
      • testOptions

        public void testOptions()
                         throws java.io.IOException
        Tests SpringCloudServiceManager.handleOptions(Map, ServiceManager, String...).
        Throws:
        java.io.IOException - if loading the test descriptor "ServiceMesh3Deployment.yml" fails
      • testTopLevel

        public void testTopLevel()
                          throws java.io.IOException
        Tests SpringCloudServiceManager.handleOptions(Map, ServiceManager, String...).
        Throws:
        java.io.IOException - if loading the test descriptor "ServiceMesh3Deployment.yml" fails
      • testAppId

        public void testAppId()
        Tests SpringCloudServiceManager.addAppId(String, List).