From b3c74c689aa32db5682f6291d49faa71086198a9 Mon Sep 17 00:00:00 2001 From: GIlca Date: Fri, 31 Mar 2023 12:23:54 +0300 Subject: [PATCH] port python executor code --- .../bindings/scripts/ScriptEvaluator.java | 2 +- .../runtime/bindings/ArgumentsBindingTest.java | 18 ++++++++---------- .../runtime/bindings/InputsBindingTest.java | 18 ++++++++---------- .../runtime/bindings/OutputsBindingTest.java | 18 ++++++++---------- .../runtime/bindings/ResultBindingTest.java | 18 ++++++++---------- .../bindings/scripts/ScriptEvaluatorTest.java | 18 ++++++++---------- .../bindings/scripts/ScriptExecutorTest.java | 18 ++++++++---------- .../lang/runtime/steps/ActionStepsTest.java | 14 ++++++-------- .../runtime/steps/ExecutableStepsTest.java | 18 ++++++++---------- .../runtime/steps/ParallelLoopStepsTest.java | 18 ++++++++---------- .../runtime/steps/StepExecutionDataTest.java | 18 ++++++++---------- .../META-INF/spring/systemTestContext.xml | 5 +++-- 12 files changed, 82 insertions(+), 101 deletions(-) diff --git a/cloudslang-runtime/src/main/java/io/cloudslang/lang/runtime/bindings/scripts/ScriptEvaluator.java b/cloudslang-runtime/src/main/java/io/cloudslang/lang/runtime/bindings/scripts/ScriptEvaluator.java index 5f1e7e903..1764cf5b5 100644 --- a/cloudslang-runtime/src/main/java/io/cloudslang/lang/runtime/bindings/scripts/ScriptEvaluator.java +++ b/cloudslang-runtime/src/main/java/io/cloudslang/lang/runtime/bindings/scripts/ScriptEvaluator.java @@ -16,7 +16,7 @@ import io.cloudslang.lang.entities.bindings.values.ValueFactory; import io.cloudslang.lang.runtime.services.ScriptsService; import io.cloudslang.runtime.api.python.PythonEvaluationResult; -import io.cloudslang.runtime.api.python.PythonExecutorLifecycleManagerService; +import io.cloudslang.runtime.api.python.executor.services.PythonExecutorLifecycleManagerService; import io.cloudslang.runtime.api.python.PythonRuntimeService; import io.cloudslang.runtime.api.python.enums.PythonStrategy; import io.cloudslang.runtime.impl.python.external.ExternalPythonScriptException; diff --git a/cloudslang-runtime/src/test/java/io/cloudslang/lang/runtime/bindings/ArgumentsBindingTest.java b/cloudslang-runtime/src/test/java/io/cloudslang/lang/runtime/bindings/ArgumentsBindingTest.java index f3873e0ca..3c1b4a4d8 100644 --- a/cloudslang-runtime/src/test/java/io/cloudslang/lang/runtime/bindings/ArgumentsBindingTest.java +++ b/cloudslang-runtime/src/test/java/io/cloudslang/lang/runtime/bindings/ArgumentsBindingTest.java @@ -22,20 +22,19 @@ import io.cloudslang.lang.entities.bindings.values.ValueFactory; import io.cloudslang.lang.runtime.bindings.scripts.ScriptEvaluator; import io.cloudslang.lang.runtime.services.ScriptsService; -import io.cloudslang.runtime.api.python.PythonExecutorConfigurationDataService; -import io.cloudslang.runtime.api.python.PythonExecutorLifecycleManagerService; +import io.cloudslang.runtime.api.python.executor.services.PythonExecutorCommunicationService; +import io.cloudslang.runtime.api.python.executor.services.PythonExecutorConfigurationDataService; +import io.cloudslang.runtime.api.python.executor.services.PythonExecutorLifecycleManagerService; import io.cloudslang.runtime.api.python.PythonRuntimeService; -import io.cloudslang.runtime.api.python.entities.PythonExecutorDetails; +import io.cloudslang.runtime.api.python.executor.entities.PythonExecutorDetails; import io.cloudslang.runtime.impl.python.PythonExecutionCachedEngine; import io.cloudslang.runtime.impl.python.PythonExecutionEngine; import io.cloudslang.runtime.impl.python.PythonExecutionNotCachedEngine; import io.cloudslang.runtime.impl.python.PythonRuntimeServiceImpl; -import io.cloudslang.runtime.impl.python.executor.ExternalPythonExecutorServiceImpl; -import io.cloudslang.runtime.impl.python.executor.PythonExecutorCommunicationServiceImpl; -import io.cloudslang.runtime.impl.python.executor.PythonExecutorLifecycleManagerServiceImpl; +import io.cloudslang.runtime.impl.python.executor.services.ExternalPythonExecutorServiceImpl; +import io.cloudslang.runtime.impl.python.executor.services.PythonExecutorLifecycleManagerServiceImpl; import io.cloudslang.runtime.impl.python.external.ExternalPythonExecutionEngine; import io.cloudslang.runtime.impl.python.external.ExternalPythonRuntimeServiceImpl; -import io.cloudslang.runtime.impl.python.external.StatefulRestEasyClientsHolder; import io.cloudslang.score.events.EventBus; import io.cloudslang.score.events.EventBusImpl; import org.junit.Assert; @@ -470,9 +469,8 @@ public PythonExecutorConfigurationDataService pythonExecutorConfigurationDataSer } @Bean(name = "pythonExecutorCommunicationService") - public PythonExecutorCommunicationServiceImpl pythonExecutorCommunicationService() { - return new PythonExecutorCommunicationServiceImpl( - mock(StatefulRestEasyClientsHolder.class), mock(PythonExecutorConfigurationDataService.class)); + public PythonExecutorCommunicationService pythonExecutorCommunicationService() { + return mock(PythonExecutorCommunicationService.class); } @Bean(name = "pythonExecutorLifecycleManagerService") diff --git a/cloudslang-runtime/src/test/java/io/cloudslang/lang/runtime/bindings/InputsBindingTest.java b/cloudslang-runtime/src/test/java/io/cloudslang/lang/runtime/bindings/InputsBindingTest.java index 04e4f9c7f..5cd2d2472 100644 --- a/cloudslang-runtime/src/test/java/io/cloudslang/lang/runtime/bindings/InputsBindingTest.java +++ b/cloudslang-runtime/src/test/java/io/cloudslang/lang/runtime/bindings/InputsBindingTest.java @@ -21,19 +21,18 @@ import io.cloudslang.lang.entities.bindings.values.ValueFactory; import io.cloudslang.lang.runtime.bindings.scripts.ScriptEvaluator; import io.cloudslang.lang.runtime.services.ScriptsService; -import io.cloudslang.runtime.api.python.PythonExecutorConfigurationDataService; -import io.cloudslang.runtime.api.python.PythonExecutorLifecycleManagerService; +import io.cloudslang.runtime.api.python.executor.services.PythonExecutorCommunicationService; +import io.cloudslang.runtime.api.python.executor.services.PythonExecutorConfigurationDataService; +import io.cloudslang.runtime.api.python.executor.services.PythonExecutorLifecycleManagerService; import io.cloudslang.runtime.api.python.PythonRuntimeService; -import io.cloudslang.runtime.api.python.entities.PythonExecutorDetails; +import io.cloudslang.runtime.api.python.executor.entities.PythonExecutorDetails; import io.cloudslang.runtime.impl.python.PythonExecutionCachedEngine; import io.cloudslang.runtime.impl.python.PythonExecutionEngine; import io.cloudslang.runtime.impl.python.PythonRuntimeServiceImpl; -import io.cloudslang.runtime.impl.python.executor.ExternalPythonExecutorServiceImpl; -import io.cloudslang.runtime.impl.python.executor.PythonExecutorCommunicationServiceImpl; -import io.cloudslang.runtime.impl.python.executor.PythonExecutorLifecycleManagerServiceImpl; +import io.cloudslang.runtime.impl.python.executor.services.ExternalPythonExecutorServiceImpl; +import io.cloudslang.runtime.impl.python.executor.services.PythonExecutorLifecycleManagerServiceImpl; import io.cloudslang.runtime.impl.python.external.ExternalPythonExecutionEngine; import io.cloudslang.runtime.impl.python.external.ExternalPythonRuntimeServiceImpl; -import io.cloudslang.runtime.impl.python.external.StatefulRestEasyClientsHolder; import io.cloudslang.score.events.EventBus; import io.cloudslang.score.events.EventBusImpl; import org.junit.Assert; @@ -569,9 +568,8 @@ public PythonExecutorConfigurationDataService pythonExecutorConfigurationDataSer } @Bean(name = "pythonExecutorCommunicationService") - public PythonExecutorCommunicationServiceImpl pythonExecutorCommunicationService() { - return new PythonExecutorCommunicationServiceImpl( - mock(StatefulRestEasyClientsHolder.class), mock(PythonExecutorConfigurationDataService.class)); + public PythonExecutorCommunicationService pythonExecutorCommunicationService() { + return mock(PythonExecutorCommunicationService.class); } @Bean(name = "pythonExecutorLifecycleManagerService") diff --git a/cloudslang-runtime/src/test/java/io/cloudslang/lang/runtime/bindings/OutputsBindingTest.java b/cloudslang-runtime/src/test/java/io/cloudslang/lang/runtime/bindings/OutputsBindingTest.java index 9657bdd22..3c971fc43 100644 --- a/cloudslang-runtime/src/test/java/io/cloudslang/lang/runtime/bindings/OutputsBindingTest.java +++ b/cloudslang-runtime/src/test/java/io/cloudslang/lang/runtime/bindings/OutputsBindingTest.java @@ -20,19 +20,18 @@ import io.cloudslang.lang.runtime.bindings.scripts.ScriptEvaluator; import io.cloudslang.lang.runtime.services.ScriptsService; import io.cloudslang.lang.runtime.steps.ReadOnlyContextAccessor; -import io.cloudslang.runtime.api.python.PythonExecutorConfigurationDataService; -import io.cloudslang.runtime.api.python.PythonExecutorLifecycleManagerService; +import io.cloudslang.runtime.api.python.executor.services.PythonExecutorCommunicationService; +import io.cloudslang.runtime.api.python.executor.services.PythonExecutorConfigurationDataService; +import io.cloudslang.runtime.api.python.executor.services.PythonExecutorLifecycleManagerService; import io.cloudslang.runtime.api.python.PythonRuntimeService; -import io.cloudslang.runtime.api.python.entities.PythonExecutorDetails; +import io.cloudslang.runtime.api.python.executor.entities.PythonExecutorDetails; import io.cloudslang.runtime.impl.python.PythonExecutionCachedEngine; import io.cloudslang.runtime.impl.python.PythonExecutionEngine; import io.cloudslang.runtime.impl.python.PythonRuntimeServiceImpl; -import io.cloudslang.runtime.impl.python.executor.ExternalPythonExecutorServiceImpl; -import io.cloudslang.runtime.impl.python.executor.PythonExecutorCommunicationServiceImpl; -import io.cloudslang.runtime.impl.python.executor.PythonExecutorLifecycleManagerServiceImpl; +import io.cloudslang.runtime.impl.python.executor.services.ExternalPythonExecutorServiceImpl; +import io.cloudslang.runtime.impl.python.executor.services.PythonExecutorLifecycleManagerServiceImpl; import io.cloudslang.runtime.impl.python.external.ExternalPythonExecutionEngine; import io.cloudslang.runtime.impl.python.external.ExternalPythonRuntimeServiceImpl; -import io.cloudslang.runtime.impl.python.external.StatefulRestEasyClientsHolder; import io.cloudslang.score.events.EventBus; import io.cloudslang.score.events.EventBusImpl; import junit.framework.Assert; @@ -277,9 +276,8 @@ public PythonExecutorConfigurationDataService pythonExecutorConfigurationDataSer } @Bean(name = "pythonExecutorCommunicationService") - public PythonExecutorCommunicationServiceImpl pythonExecutorCommunicationService() { - return new PythonExecutorCommunicationServiceImpl( - mock(StatefulRestEasyClientsHolder.class), mock(PythonExecutorConfigurationDataService.class)); + public PythonExecutorCommunicationService pythonExecutorCommunicationService() { + return mock(PythonExecutorCommunicationService.class); } @Bean(name = "pythonExecutorLifecycleManagerService") diff --git a/cloudslang-runtime/src/test/java/io/cloudslang/lang/runtime/bindings/ResultBindingTest.java b/cloudslang-runtime/src/test/java/io/cloudslang/lang/runtime/bindings/ResultBindingTest.java index 330e3e775..9c1e577ed 100644 --- a/cloudslang-runtime/src/test/java/io/cloudslang/lang/runtime/bindings/ResultBindingTest.java +++ b/cloudslang-runtime/src/test/java/io/cloudslang/lang/runtime/bindings/ResultBindingTest.java @@ -21,19 +21,18 @@ import io.cloudslang.lang.entities.bindings.values.ValueFactory; import io.cloudslang.lang.runtime.bindings.scripts.ScriptEvaluator; import io.cloudslang.lang.runtime.services.ScriptsService; -import io.cloudslang.runtime.api.python.PythonExecutorConfigurationDataService; -import io.cloudslang.runtime.api.python.PythonExecutorLifecycleManagerService; +import io.cloudslang.runtime.api.python.executor.services.PythonExecutorCommunicationService; +import io.cloudslang.runtime.api.python.executor.services.PythonExecutorConfigurationDataService; +import io.cloudslang.runtime.api.python.executor.services.PythonExecutorLifecycleManagerService; import io.cloudslang.runtime.api.python.PythonRuntimeService; -import io.cloudslang.runtime.api.python.entities.PythonExecutorDetails; +import io.cloudslang.runtime.api.python.executor.entities.PythonExecutorDetails; import io.cloudslang.runtime.impl.python.PythonExecutionCachedEngine; import io.cloudslang.runtime.impl.python.PythonExecutionEngine; import io.cloudslang.runtime.impl.python.PythonRuntimeServiceImpl; -import io.cloudslang.runtime.impl.python.executor.ExternalPythonExecutorServiceImpl; -import io.cloudslang.runtime.impl.python.executor.PythonExecutorCommunicationServiceImpl; -import io.cloudslang.runtime.impl.python.executor.PythonExecutorLifecycleManagerServiceImpl; +import io.cloudslang.runtime.impl.python.executor.services.ExternalPythonExecutorServiceImpl; +import io.cloudslang.runtime.impl.python.executor.services.PythonExecutorLifecycleManagerServiceImpl; import io.cloudslang.runtime.impl.python.external.ExternalPythonExecutionEngine; import io.cloudslang.runtime.impl.python.external.ExternalPythonRuntimeServiceImpl; -import io.cloudslang.runtime.impl.python.external.StatefulRestEasyClientsHolder; import io.cloudslang.score.events.EventBus; import io.cloudslang.score.events.EventBusImpl; import org.junit.Assert; @@ -254,9 +253,8 @@ public PythonExecutorConfigurationDataService pythonExecutorConfigurationDataSer } @Bean(name = "pythonExecutorCommunicationService") - public PythonExecutorCommunicationServiceImpl pythonExecutorCommunicationService() { - return new PythonExecutorCommunicationServiceImpl( - mock(StatefulRestEasyClientsHolder.class), mock(PythonExecutorConfigurationDataService.class)); + public PythonExecutorCommunicationService pythonExecutorCommunicationService() { + return mock(PythonExecutorCommunicationService.class); } @Bean(name = "pythonExecutorLifecycleManagerService") diff --git a/cloudslang-runtime/src/test/java/io/cloudslang/lang/runtime/bindings/scripts/ScriptEvaluatorTest.java b/cloudslang-runtime/src/test/java/io/cloudslang/lang/runtime/bindings/scripts/ScriptEvaluatorTest.java index 29ebe367a..2f6a680a7 100644 --- a/cloudslang-runtime/src/test/java/io/cloudslang/lang/runtime/bindings/scripts/ScriptEvaluatorTest.java +++ b/cloudslang-runtime/src/test/java/io/cloudslang/lang/runtime/bindings/scripts/ScriptEvaluatorTest.java @@ -19,19 +19,18 @@ import io.cloudslang.lang.entities.bindings.values.ValueFactory; import io.cloudslang.lang.runtime.services.ScriptsService; import io.cloudslang.runtime.api.python.PythonEvaluationResult; -import io.cloudslang.runtime.api.python.PythonExecutorConfigurationDataService; -import io.cloudslang.runtime.api.python.PythonExecutorLifecycleManagerService; +import io.cloudslang.runtime.api.python.executor.services.PythonExecutorCommunicationService; +import io.cloudslang.runtime.api.python.executor.services.PythonExecutorConfigurationDataService; +import io.cloudslang.runtime.api.python.executor.services.PythonExecutorLifecycleManagerService; import io.cloudslang.runtime.api.python.PythonRuntimeService; -import io.cloudslang.runtime.api.python.entities.PythonExecutorDetails; +import io.cloudslang.runtime.api.python.executor.entities.PythonExecutorDetails; import io.cloudslang.runtime.impl.python.PythonExecutionCachedEngine; import io.cloudslang.runtime.impl.python.PythonExecutionEngine; import io.cloudslang.runtime.impl.python.PythonExecutor; -import io.cloudslang.runtime.impl.python.executor.ExternalPythonExecutorServiceImpl; -import io.cloudslang.runtime.impl.python.executor.PythonExecutorCommunicationServiceImpl; -import io.cloudslang.runtime.impl.python.executor.PythonExecutorLifecycleManagerServiceImpl; +import io.cloudslang.runtime.impl.python.executor.services.ExternalPythonExecutorServiceImpl; +import io.cloudslang.runtime.impl.python.executor.services.PythonExecutorLifecycleManagerServiceImpl; import io.cloudslang.runtime.impl.python.external.ExternalPythonExecutionEngine; import io.cloudslang.runtime.impl.python.external.ExternalPythonRuntimeServiceImpl; -import io.cloudslang.runtime.impl.python.external.StatefulRestEasyClientsHolder; import io.cloudslang.score.events.EventBus; import io.cloudslang.score.events.EventBusImpl; import org.junit.Assert; @@ -220,9 +219,8 @@ public PythonExecutorConfigurationDataService pythonExecutorConfigurationDataSer } @Bean(name = "pythonExecutorCommunicationService") - public PythonExecutorCommunicationServiceImpl pythonExecutorCommunicationService() { - return new PythonExecutorCommunicationServiceImpl( - mock(StatefulRestEasyClientsHolder.class), mock(PythonExecutorConfigurationDataService.class)); + public PythonExecutorCommunicationService pythonExecutorCommunicationService() { + return mock(PythonExecutorCommunicationService.class); } @Bean(name = "pythonExecutorLifecycleManagerService") diff --git a/cloudslang-runtime/src/test/java/io/cloudslang/lang/runtime/bindings/scripts/ScriptExecutorTest.java b/cloudslang-runtime/src/test/java/io/cloudslang/lang/runtime/bindings/scripts/ScriptExecutorTest.java index c3cd05dc8..fabf31c07 100644 --- a/cloudslang-runtime/src/test/java/io/cloudslang/lang/runtime/bindings/scripts/ScriptExecutorTest.java +++ b/cloudslang-runtime/src/test/java/io/cloudslang/lang/runtime/bindings/scripts/ScriptExecutorTest.java @@ -17,20 +17,19 @@ import io.cloudslang.lang.entities.bindings.values.ValueFactory; import io.cloudslang.lang.runtime.services.ScriptsService; import io.cloudslang.runtime.api.python.PythonExecutionResult; -import io.cloudslang.runtime.api.python.PythonExecutorConfigurationDataService; -import io.cloudslang.runtime.api.python.PythonExecutorLifecycleManagerService; +import io.cloudslang.runtime.api.python.executor.services.PythonExecutorCommunicationService; +import io.cloudslang.runtime.api.python.executor.services.PythonExecutorConfigurationDataService; +import io.cloudslang.runtime.api.python.executor.services.PythonExecutorLifecycleManagerService; import io.cloudslang.runtime.api.python.PythonRuntimeService; -import io.cloudslang.runtime.api.python.entities.PythonExecutorDetails; +import io.cloudslang.runtime.api.python.executor.entities.PythonExecutorDetails; import io.cloudslang.runtime.impl.python.PythonExecutionCachedEngine; import io.cloudslang.runtime.impl.python.PythonExecutionEngine; import io.cloudslang.runtime.impl.python.PythonExecutor; import io.cloudslang.runtime.impl.python.PythonRuntimeServiceImpl; -import io.cloudslang.runtime.impl.python.executor.ExternalPythonExecutorServiceImpl; -import io.cloudslang.runtime.impl.python.executor.PythonExecutorCommunicationServiceImpl; -import io.cloudslang.runtime.impl.python.executor.PythonExecutorLifecycleManagerServiceImpl; +import io.cloudslang.runtime.impl.python.executor.services.ExternalPythonExecutorServiceImpl; +import io.cloudslang.runtime.impl.python.executor.services.PythonExecutorLifecycleManagerServiceImpl; import io.cloudslang.runtime.impl.python.external.ExternalPythonExecutionEngine; import io.cloudslang.runtime.impl.python.external.ExternalPythonRuntimeServiceImpl; -import io.cloudslang.runtime.impl.python.external.StatefulRestEasyClientsHolder; import io.cloudslang.score.events.EventBus; import io.cloudslang.score.events.EventBusImpl; import io.cloudslang.utils.PythonScriptGeneratorUtils; @@ -210,9 +209,8 @@ public PythonExecutorConfigurationDataService pythonExecutorConfigurationDataSer } @Bean(name = "pythonExecutorCommunicationService") - public PythonExecutorCommunicationServiceImpl pythonExecutorCommunicationService() { - return new PythonExecutorCommunicationServiceImpl( - mock(StatefulRestEasyClientsHolder.class), mock(PythonExecutorConfigurationDataService.class)); + public PythonExecutorCommunicationService pythonExecutorCommunicationService() { + return mock(PythonExecutorCommunicationService.class); } @Bean(name = "pythonExecutorLifecycleManagerService") diff --git a/cloudslang-runtime/src/test/java/io/cloudslang/lang/runtime/steps/ActionStepsTest.java b/cloudslang-runtime/src/test/java/io/cloudslang/lang/runtime/steps/ActionStepsTest.java index 83e8ed2ac..bea2f830b 100644 --- a/cloudslang-runtime/src/test/java/io/cloudslang/lang/runtime/steps/ActionStepsTest.java +++ b/cloudslang-runtime/src/test/java/io/cloudslang/lang/runtime/steps/ActionStepsTest.java @@ -27,20 +27,19 @@ import io.cloudslang.lang.runtime.services.ScriptsService; import io.cloudslang.lang.runtime.steps.ContentTestActions.NonSerializableObject; import io.cloudslang.runtime.api.java.JavaRuntimeService; -import io.cloudslang.runtime.api.python.PythonExecutorConfigurationDataService; +import io.cloudslang.runtime.api.python.executor.services.PythonExecutorCommunicationService; +import io.cloudslang.runtime.api.python.executor.services.PythonExecutorConfigurationDataService; import io.cloudslang.runtime.api.python.PythonRuntimeService; -import io.cloudslang.runtime.api.python.entities.PythonExecutorDetails; +import io.cloudslang.runtime.api.python.executor.entities.PythonExecutorDetails; import io.cloudslang.runtime.api.sequential.SequentialExecutionService; import io.cloudslang.runtime.impl.java.JavaExecutionCachedEngine; import io.cloudslang.runtime.impl.java.JavaRuntimeServiceImpl; import io.cloudslang.runtime.impl.python.PythonExecutionCachedEngine; import io.cloudslang.runtime.impl.python.PythonExecutionEngine; import io.cloudslang.runtime.impl.python.PythonRuntimeServiceImpl; -import io.cloudslang.runtime.impl.python.executor.ExternalPythonExecutorServiceImpl; -import io.cloudslang.runtime.impl.python.executor.PythonExecutorCommunicationServiceImpl; +import io.cloudslang.runtime.impl.python.executor.services.ExternalPythonExecutorServiceImpl; import io.cloudslang.runtime.impl.python.external.ExternalPythonExecutionEngine; import io.cloudslang.runtime.impl.python.external.ExternalPythonRuntimeServiceImpl; -import io.cloudslang.runtime.impl.python.external.StatefulRestEasyClientsHolder; import io.cloudslang.score.api.execution.ExecutionParametersConsts; import io.cloudslang.score.events.EventBus; import io.cloudslang.score.events.EventBusImpl; @@ -1215,9 +1214,8 @@ public PythonExecutorConfigurationDataService pythonExecutorConfigurationDataSer } @Bean(name = "pythonExecutorCommunicationService") - public PythonExecutorCommunicationServiceImpl pythonExecutorCommunicationService() { - return new PythonExecutorCommunicationServiceImpl( - mock(StatefulRestEasyClientsHolder.class), mock(PythonExecutorConfigurationDataService.class)); + public PythonExecutorCommunicationService pythonExecutorCommunicationService() { + return mock(PythonExecutorCommunicationService.class); } @Bean(name = "externalPythonExecutorService") diff --git a/cloudslang-runtime/src/test/java/io/cloudslang/lang/runtime/steps/ExecutableStepsTest.java b/cloudslang-runtime/src/test/java/io/cloudslang/lang/runtime/steps/ExecutableStepsTest.java index a1a9f7f06..dccaea96a 100644 --- a/cloudslang-runtime/src/test/java/io/cloudslang/lang/runtime/steps/ExecutableStepsTest.java +++ b/cloudslang-runtime/src/test/java/io/cloudslang/lang/runtime/steps/ExecutableStepsTest.java @@ -40,19 +40,18 @@ import io.cloudslang.lang.runtime.env.RunEnvironment; import io.cloudslang.lang.runtime.events.LanguageEventData; import io.cloudslang.lang.runtime.services.ScriptsService; -import io.cloudslang.runtime.api.python.PythonExecutorConfigurationDataService; -import io.cloudslang.runtime.api.python.PythonExecutorLifecycleManagerService; +import io.cloudslang.runtime.api.python.executor.services.PythonExecutorCommunicationService; +import io.cloudslang.runtime.api.python.executor.services.PythonExecutorConfigurationDataService; +import io.cloudslang.runtime.api.python.executor.services.PythonExecutorLifecycleManagerService; import io.cloudslang.runtime.api.python.PythonRuntimeService; -import io.cloudslang.runtime.api.python.entities.PythonExecutorDetails; +import io.cloudslang.runtime.api.python.executor.entities.PythonExecutorDetails; import io.cloudslang.runtime.impl.python.PythonExecutionCachedEngine; import io.cloudslang.runtime.impl.python.PythonExecutionEngine; import io.cloudslang.runtime.impl.python.PythonRuntimeServiceImpl; -import io.cloudslang.runtime.impl.python.executor.ExternalPythonExecutorServiceImpl; -import io.cloudslang.runtime.impl.python.executor.PythonExecutorCommunicationServiceImpl; -import io.cloudslang.runtime.impl.python.executor.PythonExecutorLifecycleManagerServiceImpl; +import io.cloudslang.runtime.impl.python.executor.services.ExternalPythonExecutorServiceImpl; +import io.cloudslang.runtime.impl.python.executor.services.PythonExecutorLifecycleManagerServiceImpl; import io.cloudslang.runtime.impl.python.external.ExternalPythonExecutionEngine; import io.cloudslang.runtime.impl.python.external.ExternalPythonRuntimeServiceImpl; -import io.cloudslang.runtime.impl.python.external.StatefulRestEasyClientsHolder; import io.cloudslang.score.api.execution.precondition.ExecutionPreconditionService; import io.cloudslang.score.events.EventBus; import io.cloudslang.score.events.EventBusImpl; @@ -521,9 +520,8 @@ public PythonExecutorConfigurationDataService pythonExecutorConfigurationDataSer } @Bean(name = "pythonExecutorCommunicationService") - public PythonExecutorCommunicationServiceImpl pythonExecutorCommunicationService() { - return new PythonExecutorCommunicationServiceImpl( - mock(StatefulRestEasyClientsHolder.class), mock(PythonExecutorConfigurationDataService.class)); + public PythonExecutorCommunicationService pythonExecutorCommunicationService() { + return mock(PythonExecutorCommunicationService.class); } @Bean(name = "externalPythonExecutorService") diff --git a/cloudslang-runtime/src/test/java/io/cloudslang/lang/runtime/steps/ParallelLoopStepsTest.java b/cloudslang-runtime/src/test/java/io/cloudslang/lang/runtime/steps/ParallelLoopStepsTest.java index 49db2d0f7..b7f010305 100644 --- a/cloudslang-runtime/src/test/java/io/cloudslang/lang/runtime/steps/ParallelLoopStepsTest.java +++ b/cloudslang-runtime/src/test/java/io/cloudslang/lang/runtime/steps/ParallelLoopStepsTest.java @@ -31,18 +31,17 @@ import io.cloudslang.lang.runtime.env.RunEnvironment; import io.cloudslang.lang.runtime.events.LanguageEventData; import io.cloudslang.lang.runtime.services.ScriptsService; -import io.cloudslang.runtime.api.python.PythonExecutorConfigurationDataService; -import io.cloudslang.runtime.api.python.PythonExecutorLifecycleManagerService; +import io.cloudslang.runtime.api.python.executor.services.PythonExecutorCommunicationService; +import io.cloudslang.runtime.api.python.executor.services.PythonExecutorConfigurationDataService; +import io.cloudslang.runtime.api.python.executor.services.PythonExecutorLifecycleManagerService; import io.cloudslang.runtime.api.python.PythonRuntimeService; -import io.cloudslang.runtime.api.python.entities.PythonExecutorDetails; +import io.cloudslang.runtime.api.python.executor.entities.PythonExecutorDetails; import io.cloudslang.runtime.impl.python.PythonExecutionCachedEngine; import io.cloudslang.runtime.impl.python.PythonExecutionEngine; import io.cloudslang.runtime.impl.python.PythonRuntimeServiceImpl; -import io.cloudslang.runtime.impl.python.executor.ExternalPythonExecutorServiceImpl; -import io.cloudslang.runtime.impl.python.executor.PythonExecutorCommunicationServiceImpl; -import io.cloudslang.runtime.impl.python.executor.PythonExecutorLifecycleManagerServiceImpl; +import io.cloudslang.runtime.impl.python.executor.services.ExternalPythonExecutorServiceImpl; +import io.cloudslang.runtime.impl.python.executor.services.PythonExecutorLifecycleManagerServiceImpl; import io.cloudslang.runtime.impl.python.external.ExternalPythonExecutionEngine; -import io.cloudslang.runtime.impl.python.external.StatefulRestEasyClientsHolder; import io.cloudslang.score.api.EndBranchDataContainer; import io.cloudslang.score.events.EventBus; import io.cloudslang.score.events.EventBusImpl; @@ -617,9 +616,8 @@ public PythonExecutorConfigurationDataService pythonExecutorConfigurationDataSer } @Bean(name = "pythonExecutorCommunicationService") - public PythonExecutorCommunicationServiceImpl pythonExecutorCommunicationService() { - return new PythonExecutorCommunicationServiceImpl( - mock(StatefulRestEasyClientsHolder.class), mock(PythonExecutorConfigurationDataService.class)); + public PythonExecutorCommunicationService pythonExecutorCommunicationService() { + return mock(PythonExecutorCommunicationService.class); } @Bean(name = "pythonExecutorLifecycleManagerService") diff --git a/cloudslang-runtime/src/test/java/io/cloudslang/lang/runtime/steps/StepExecutionDataTest.java b/cloudslang-runtime/src/test/java/io/cloudslang/lang/runtime/steps/StepExecutionDataTest.java index bdd2de092..d49ebde46 100644 --- a/cloudslang-runtime/src/test/java/io/cloudslang/lang/runtime/steps/StepExecutionDataTest.java +++ b/cloudslang-runtime/src/test/java/io/cloudslang/lang/runtime/steps/StepExecutionDataTest.java @@ -37,19 +37,18 @@ import io.cloudslang.lang.runtime.env.RunEnvironment; import io.cloudslang.lang.runtime.events.LanguageEventData; import io.cloudslang.lang.runtime.services.ScriptsService; -import io.cloudslang.runtime.api.python.PythonExecutorConfigurationDataService; -import io.cloudslang.runtime.api.python.PythonExecutorLifecycleManagerService; +import io.cloudslang.runtime.api.python.executor.services.PythonExecutorCommunicationService; +import io.cloudslang.runtime.api.python.executor.services.PythonExecutorConfigurationDataService; +import io.cloudslang.runtime.api.python.executor.services.PythonExecutorLifecycleManagerService; import io.cloudslang.runtime.api.python.PythonRuntimeService; -import io.cloudslang.runtime.api.python.entities.PythonExecutorDetails; +import io.cloudslang.runtime.api.python.executor.entities.PythonExecutorDetails; import io.cloudslang.runtime.impl.python.PythonExecutionCachedEngine; import io.cloudslang.runtime.impl.python.PythonExecutionEngine; import io.cloudslang.runtime.impl.python.PythonRuntimeServiceImpl; -import io.cloudslang.runtime.impl.python.executor.ExternalPythonExecutorServiceImpl; -import io.cloudslang.runtime.impl.python.executor.PythonExecutorCommunicationServiceImpl; -import io.cloudslang.runtime.impl.python.executor.PythonExecutorLifecycleManagerServiceImpl; +import io.cloudslang.runtime.impl.python.executor.services.ExternalPythonExecutorServiceImpl; +import io.cloudslang.runtime.impl.python.executor.services.PythonExecutorLifecycleManagerServiceImpl; import io.cloudslang.runtime.impl.python.external.ExternalPythonExecutionEngine; import io.cloudslang.runtime.impl.python.external.ExternalPythonRuntimeServiceImpl; -import io.cloudslang.runtime.impl.python.external.StatefulRestEasyClientsHolder; import io.cloudslang.score.events.EventBus; import io.cloudslang.score.events.EventBusImpl; import io.cloudslang.score.events.ScoreEvent; @@ -653,9 +652,8 @@ public PythonExecutorConfigurationDataService pythonExecutorConfigurationDataSer } @Bean(name = "pythonExecutorCommunicationService") - public PythonExecutorCommunicationServiceImpl pythonExecutorCommunicationService() { - return new PythonExecutorCommunicationServiceImpl( - mock(StatefulRestEasyClientsHolder.class), mock(PythonExecutorConfigurationDataService.class)); + public PythonExecutorCommunicationService pythonExecutorCommunicationService() { + return mock(PythonExecutorCommunicationService.class); } @Bean(name = "pythonExecutorLifecycleManagerService") diff --git a/cloudslang-tests/src/test/resources/META-INF/spring/systemTestContext.xml b/cloudslang-tests/src/test/resources/META-INF/spring/systemTestContext.xml index d4e731ba7..794c15e14 100644 --- a/cloudslang-tests/src/test/resources/META-INF/spring/systemTestContext.xml +++ b/cloudslang-tests/src/test/resources/META-INF/spring/systemTestContext.xml @@ -22,8 +22,9 @@ - - + + +