Class PythonProcessServiceTest

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.environment.PythonProcessServiceTest

public class PythonProcessServiceTest extends test.de.iip_ecosphere.platform.transport.TestWithQpid
Tests the generic Python process service AbstractPythonProcessService.
Author:
Holger Eichelberger, SSE
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    private class 
    Extension of python async process service to count the number of processed items for asserting.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private String
     

    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
    private List<String>
    Composes the basic command line arguments for this test.
    private List<String>
    composeCmdLineArguments(String serviceId, String mode, int port)
    Composes the basic command line arguments for this test.
    void
    Tests an client-server communication with PythonAsyncProcessService.
    void
    Tests the process-based service classes.
    private void
    testService(de.iip_ecosphere.platform.services.environment.PythonAsyncProcessService service)
    Tests the Python service environment integration.
    void
    Tests the process-based service classes.
    void
    Tests the Websocket-based service classes.

    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, setInstallDir

    Methods inherited from class java.lang.Object

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

    • stringParam

      private String stringParam
  • Constructor Details

    • PythonProcessServiceTest

      public PythonProcessServiceTest()
  • Method Details

    • composeCmdLineArguments

      private List<String> composeCmdLineArguments(String serviceId)
      Composes the basic command line arguments for this test. We assume that the service modules are in the "src/test/python" folder and we set the home folder of the Python process to "src/main/python" where the service environment is located. This may differ in a real integration, e.g., both parts in one sub-folder of temp.
      Parameters:
      serviceId - the service id to use
      Returns:
      the basic command line arguments
    • composeCmdLineArguments

      private List<String> composeCmdLineArguments(String serviceId, String mode, int port)
      Composes the basic command line arguments for this test. We assume that the service modules are in the "src/test/python" folder and we set the home folder of the Python process to "src/main/python" where the service environment is located. This may differ in a real integration, e.g., both parts in one sub-folder of temp.
      Parameters:
      serviceId - the service id to use
      mode - the service environment mode, e.g., "console" or "REST"
      port - the port for "REST", ignored if zero or negative
      Returns:
      the basic command line arguments
    • testAsyncProcessService

      public void testAsyncProcessService() throws ExecutionException, IOException
      Tests the process-based service classes.
      Throws:
      ExecutionException - shall not occur
      IOException - shall not occur
    • testWsProcessService

      public void testWsProcessService() throws ExecutionException, IOException
      Tests the Websocket-based service classes.
      Throws:
      ExecutionException - shall not occur
      IOException - shall not occur
    • testService

      private void testService(de.iip_ecosphere.platform.services.environment.PythonAsyncProcessService service) throws ExecutionException, IOException
      Tests the Python service environment integration.
      Parameters:
      service - the service instance to test
      Throws:
      ExecutionException - shall not occur
      IOException - shall not occur
    • testAsyncClientServer

      public void testAsyncClientServer() throws IOException, ExecutionException
      Tests an client-server communication with PythonAsyncProcessService.
      Throws:
      IOException - shall not occur
      ExecutionException - shall not occur
    • testSyncProcessService

      public void testSyncProcessService() throws ExecutionException, IOException
      Tests the process-based service classes.
      Throws:
      ExecutionException - shall not occur
      IOException - shall not occur