Class ServiceManagerTest

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.services.ServiceManagerTest

public class ServiceManagerTest extends test.de.iip_ecosphere.platform.transport.TestWithQpid
Tests ServiceManager.
Author:
Holger Eichelberger, SSE
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    private static class 
    Availability predicate that always returns true and records tested connection names.
    (package private) static interface 
    A method execution without parameters potentially causing an exception.
  • Field Summary

    Fields inherited from class test.de.iip_ecosphere.platform.transport.TestWithQpid

    qpid

    Fields inherited from class test.de.iip_ecosphere.platform.support.TestWithPlugin

    PROP_AAS_PLUGIN
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    (package private) static <T> void
    assertCollection(Collection<T> collection, T... expected)
    Asserts the contents of a collection without considering the sequence.
    private static void
    assertContains(Set<de.iip_ecosphere.platform.services.AbstractServiceManager.TypedDataConnection> conn, String... cIds)
    Asserts that conn contains all cIds.
    (package private) static void
    Asserts that an exception occurred, e.g., as func is currently not implemented.
    (package private) static <T> void
    assertList(List<T> list, T... expected)
    Asserts the contents of a list with considering the sequence.
    void
    Tests AbstractServiceManager.determineExternalConnections(ServiceManager, String...).
    void
    Tests AbstractServiceManager.determineInternalConnections(ServiceManager, String...).
    void
    Tests AbstractServiceManager.determineInternalConnections(ServiceManager, String...).
    void
    Tests ServiceManager.
    void
    Tests basic application id related functions.
    void
    Tests for AbstractServiceManager.sortByDependency(List, Collection, Predicate, boolean) with other services.
    void
    Basic tests for AbstractServiceManager.sortByDependency(List, Collection, Predicate, boolean).
    void
    Tests for AbstractServiceManager.sortByDependency(List, Collection, Predicate, boolean) for ensembles.

    Methods inherited from class test.de.iip_ecosphere.platform.transport.TestWithQpid

    addPlugin, fromPlugin, stopQpid

    Methods inherited from class test.de.iip_ecosphere.platform.support.aas.TestWithPlugin

    setAasPluginId, setup, setupAASPlugins

    Methods inherited from class test.de.iip_ecosphere.platform.support.TestWithPlugin

    addPluginLocation, addPluginLocation, addPluginLocation, addRunAfterLoading, clear, enableLocalPlugins, loadPlugins, loadPlugins, setInstallDir

    Methods inherited from class java.lang.Object

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

    • ServiceManagerTest

      public ServiceManagerTest()
  • Method Details

    • testMgr

      public void testMgr() throws ExecutionException, URISyntaxException
      Tests ServiceManager.
      Throws:
      ExecutionException - shall not occur
      URISyntaxException - shall not occur
    • testMgrAppId

      public void testMgrAppId() throws ExecutionException, URISyntaxException
      Tests basic application id related functions.
      Throws:
      ExecutionException - shall not occur in a successful run
      URISyntaxException - shall not occur in a successful run
    • testExternalConnections

      public void testExternalConnections() throws ExecutionException, URISyntaxException
      Tests AbstractServiceManager.determineExternalConnections(ServiceManager, String...).
      Throws:
      ExecutionException - shall not occur in a successful run
      URISyntaxException - shall not occur in a successful run
    • testInternalConnections

      public void testInternalConnections() throws ExecutionException, URISyntaxException
      Tests AbstractServiceManager.determineInternalConnections(ServiceManager, String...).
      Throws:
      ExecutionException - shall not occur in a successful run
      URISyntaxException - shall not occur in a successful run
    • testFunctionalConnections

      public void testFunctionalConnections() throws ExecutionException, URISyntaxException
      Tests AbstractServiceManager.determineInternalConnections(ServiceManager, String...).
      Throws:
      ExecutionException - shall not occur in a successful run
      URISyntaxException - shall not occur in a successful run
    • assertContains

      private static void assertContains(Set<de.iip_ecosphere.platform.services.AbstractServiceManager.TypedDataConnection> conn, String... cIds)
      Asserts that conn contains all cIds.
      Parameters:
      conn - the connect to check the ids for
      cIds - the connection ids to assert for
    • assertException

      static void assertException(ServiceManagerTest.WithExecutionException func)
      Asserts that an exception occurred, e.g., as func is currently not implemented.
      Parameters:
      func - the function to execute
    • testSortByDependencyBasic

      public void testSortByDependencyBasic()
      Basic tests for AbstractServiceManager.sortByDependency(List, Collection, Predicate, boolean).
    • testSortByDependency

      public void testSortByDependency() throws URISyntaxException
      Tests for AbstractServiceManager.sortByDependency(List, Collection, Predicate, boolean) with other services.
      Throws:
      URISyntaxException - shall not occur in a successful run
    • testSortByDependencyEnsemble

      public void testSortByDependencyEnsemble() throws URISyntaxException
      Tests for AbstractServiceManager.sortByDependency(List, Collection, Predicate, boolean) for ensembles.
      Throws:
      URISyntaxException - shall not occur
    • assertList

      static <T> void assertList(List<T> list, T... expected)
      Asserts the contents of a list with considering the sequence.
      Type Parameters:
      T - the element type
      Parameters:
      list - the list
      expected - the expected elements and sequence
    • assertCollection

      static <T> void assertCollection(Collection<T> collection, T... expected)
      Asserts the contents of a collection without considering the sequence.
      Type Parameters:
      T - the element type
      Parameters:
      collection - the collection
      expected - the expected elements