Class ServiceMgrAndDescriptorTest

java.lang.Object
test.de.iip_ecosphere.platform.services.spring.AbstractTest
test.de.iip_ecosphere.platform.services.spring.ServiceMgrAndDescriptorTest

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

    Nested Classes
    Modifier and Type
    Class
    Description
    private static class 
    A mocking service manager for a given service artifact.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    private static void
    assertFunctionDef(String expected, de.iip_ecosphere.platform.services.ServiceManager mgr, String... serviceId)
    Asserts a function definition.
    (package private) static de.iip_ecosphere.platform.services.ServiceManager
    Creates a simple service manager from loading a YAML file.
    void
    Tests SpringCloudServiceManager.addAppId(String, List).
    void
    Tests SpringCloudServiceDescriptor.instantiate(String) with AbstractServiceManager.determineExternalConnections(ServiceManager, String...).
    void
    Tests AbstractServiceManager.determineInternalConnections(ServiceManager, String...) in combination with SpringCloudServiceDescriptor.toFunctionDefinition(Set).
    void
    Tests SpringCloudServiceManager.handleOptions(Map, ServiceManager, String...).
    void
    Tests SpringCloudServiceManager.determineSpringConditionals(ServiceManager, String...).
    void
    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 Details

    • ServiceMgrAndDescriptorTest

      public ServiceMgrAndDescriptorTest()
  • Method Details

    • createServiceManager

      static de.iip_ecosphere.platform.services.ServiceManager createServiceManager(File descriptor) throws 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:
      IOException - if the descriptor cannot be loaded for some reason
    • assertFunctionDef

      private static void assertFunctionDef(String expected, de.iip_ecosphere.platform.services.ServiceManager mgr, 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 IOException
      Tests AbstractServiceManager.determineInternalConnections(ServiceManager, String...) in combination with SpringCloudServiceDescriptor.toFunctionDefinition(Set).
      Throws:
      IOException - if loading the test descriptor "ServiceMesh3Deployment.yml" fails
    • testSpringConditionals

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

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

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

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

      public void testInstantiate() throws IOException
      Tests SpringCloudServiceDescriptor.instantiate(String) with AbstractServiceManager.determineExternalConnections(ServiceManager, String...).
      Throws:
      IOException - shall not occur