From 978faf24cc95acf91c5d860c976e5ea06784ca2d Mon Sep 17 00:00:00 2001 From: GIlca Date: Thu, 16 Feb 2023 14:20:50 +0200 Subject: [PATCH] fix tests --- .../lang/runtime/bindings/ArgumentsBindingTest.java | 8 ++++++++ .../lang/runtime/bindings/InputsBindingTest.java | 8 ++++++++ .../lang/runtime/bindings/OutputsBindingTest.java | 8 ++++++++ .../lang/runtime/bindings/ResultBindingTest.java | 8 ++++++++ .../runtime/bindings/scripts/ScriptEvaluatorTest.java | 8 ++++++++ .../lang/runtime/bindings/scripts/ScriptExecutorTest.java | 8 ++++++++ .../lang/runtime/steps/ExecutableStepsTest.java | 8 ++++++++ .../lang/runtime/steps/ParallelLoopStepsTest.java | 8 ++++++++ .../lang/runtime/steps/StepExecutionDataTest.java | 8 ++++++++ 9 files changed, 72 insertions(+) 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 d5324838f..f3873e0ca 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 @@ -23,6 +23,7 @@ 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.PythonRuntimeService; import io.cloudslang.runtime.api.python.entities.PythonExecutorDetails; import io.cloudslang.runtime.impl.python.PythonExecutionCachedEngine; @@ -31,6 +32,7 @@ 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.external.ExternalPythonExecutionEngine; import io.cloudslang.runtime.impl.python.external.ExternalPythonRuntimeServiceImpl; import io.cloudslang.runtime.impl.python.external.StatefulRestEasyClientsHolder; @@ -473,6 +475,12 @@ public PythonExecutorCommunicationServiceImpl pythonExecutorCommunicationService mock(StatefulRestEasyClientsHolder.class), mock(PythonExecutorConfigurationDataService.class)); } + @Bean(name = "pythonExecutorLifecycleManagerService") + public PythonExecutorLifecycleManagerService pythonExecutorLifecycleManagerService() { + return new PythonExecutorLifecycleManagerServiceImpl(pythonExecutorCommunicationService(), + pythonExecutorConfigurationDataService()); + } + @Bean(name = "externalPythonExecutorService") public PythonRuntimeService externalPythonExecutorService() { return new ExternalPythonExecutorServiceImpl(new Semaphore(100), new Semaphore(50)); 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 b6f9bf27b..04e4f9c7f 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 @@ -22,6 +22,7 @@ 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.PythonRuntimeService; import io.cloudslang.runtime.api.python.entities.PythonExecutorDetails; import io.cloudslang.runtime.impl.python.PythonExecutionCachedEngine; @@ -29,6 +30,7 @@ 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.external.ExternalPythonExecutionEngine; import io.cloudslang.runtime.impl.python.external.ExternalPythonRuntimeServiceImpl; import io.cloudslang.runtime.impl.python.external.StatefulRestEasyClientsHolder; @@ -572,6 +574,12 @@ public PythonExecutorCommunicationServiceImpl pythonExecutorCommunicationService mock(StatefulRestEasyClientsHolder.class), mock(PythonExecutorConfigurationDataService.class)); } + @Bean(name = "pythonExecutorLifecycleManagerService") + public PythonExecutorLifecycleManagerService pythonExecutorLifecycleManagerService() { + return new PythonExecutorLifecycleManagerServiceImpl(pythonExecutorCommunicationService(), + pythonExecutorConfigurationDataService()); + } + @Bean(name = "externalPythonExecutorService") public PythonRuntimeService externalPythonExecutorService() { return new ExternalPythonExecutorServiceImpl(new Semaphore(100), new Semaphore(50)); 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 ba57b9824..9657bdd22 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 @@ -21,6 +21,7 @@ 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.PythonRuntimeService; import io.cloudslang.runtime.api.python.entities.PythonExecutorDetails; import io.cloudslang.runtime.impl.python.PythonExecutionCachedEngine; @@ -28,6 +29,7 @@ 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.external.ExternalPythonExecutionEngine; import io.cloudslang.runtime.impl.python.external.ExternalPythonRuntimeServiceImpl; import io.cloudslang.runtime.impl.python.external.StatefulRestEasyClientsHolder; @@ -280,6 +282,12 @@ public PythonExecutorCommunicationServiceImpl pythonExecutorCommunicationService mock(StatefulRestEasyClientsHolder.class), mock(PythonExecutorConfigurationDataService.class)); } + @Bean(name = "pythonExecutorLifecycleManagerService") + public PythonExecutorLifecycleManagerService pythonExecutorLifecycleManagerService() { + return new PythonExecutorLifecycleManagerServiceImpl(pythonExecutorCommunicationService(), + pythonExecutorConfigurationDataService()); + } + @Bean(name = "externalPythonExecutorService") public PythonRuntimeService externalPythonExecutorService() { return new ExternalPythonExecutorServiceImpl(new Semaphore(100), new Semaphore(50)); 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 cb8fbbb8d..330e3e775 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 @@ -22,6 +22,7 @@ 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.PythonRuntimeService; import io.cloudslang.runtime.api.python.entities.PythonExecutorDetails; import io.cloudslang.runtime.impl.python.PythonExecutionCachedEngine; @@ -29,6 +30,7 @@ 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.external.ExternalPythonExecutionEngine; import io.cloudslang.runtime.impl.python.external.ExternalPythonRuntimeServiceImpl; import io.cloudslang.runtime.impl.python.external.StatefulRestEasyClientsHolder; @@ -257,6 +259,12 @@ public PythonExecutorCommunicationServiceImpl pythonExecutorCommunicationService mock(StatefulRestEasyClientsHolder.class), mock(PythonExecutorConfigurationDataService.class)); } + @Bean(name = "pythonExecutorLifecycleManagerService") + public PythonExecutorLifecycleManagerService pythonExecutorLifecycleManagerService() { + return new PythonExecutorLifecycleManagerServiceImpl(pythonExecutorCommunicationService(), + pythonExecutorConfigurationDataService()); + } + @Bean(name = "externalPythonExecutorService") public PythonRuntimeService externalPythonExecutorService() { return new ExternalPythonExecutorServiceImpl(new Semaphore(100), new Semaphore(50)); 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 1d3d82ca6..29ebe367a 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 @@ -20,6 +20,7 @@ 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.PythonRuntimeService; import io.cloudslang.runtime.api.python.entities.PythonExecutorDetails; import io.cloudslang.runtime.impl.python.PythonExecutionCachedEngine; @@ -27,6 +28,7 @@ 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.external.ExternalPythonExecutionEngine; import io.cloudslang.runtime.impl.python.external.ExternalPythonRuntimeServiceImpl; import io.cloudslang.runtime.impl.python.external.StatefulRestEasyClientsHolder; @@ -223,6 +225,12 @@ public PythonExecutorCommunicationServiceImpl pythonExecutorCommunicationService mock(StatefulRestEasyClientsHolder.class), mock(PythonExecutorConfigurationDataService.class)); } + @Bean(name = "pythonExecutorLifecycleManagerService") + public PythonExecutorLifecycleManagerService pythonExecutorLifecycleManagerService() { + return new PythonExecutorLifecycleManagerServiceImpl(pythonExecutorCommunicationService(), + pythonExecutorConfigurationDataService()); + } + @Bean(name = "externalPythonExecutorService") public PythonRuntimeService externalPythonExecutorService() { return new ExternalPythonExecutorServiceImpl(new Semaphore(100), new Semaphore(50)); 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 986614bee..c3cd05dc8 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 @@ -18,6 +18,7 @@ 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.PythonRuntimeService; import io.cloudslang.runtime.api.python.entities.PythonExecutorDetails; import io.cloudslang.runtime.impl.python.PythonExecutionCachedEngine; @@ -26,6 +27,7 @@ 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.external.ExternalPythonExecutionEngine; import io.cloudslang.runtime.impl.python.external.ExternalPythonRuntimeServiceImpl; import io.cloudslang.runtime.impl.python.external.StatefulRestEasyClientsHolder; @@ -213,6 +215,12 @@ public PythonExecutorCommunicationServiceImpl pythonExecutorCommunicationService mock(StatefulRestEasyClientsHolder.class), mock(PythonExecutorConfigurationDataService.class)); } + @Bean(name = "pythonExecutorLifecycleManagerService") + public PythonExecutorLifecycleManagerService pythonExecutorLifecycleManagerService() { + return new PythonExecutorLifecycleManagerServiceImpl(pythonExecutorCommunicationService(), + pythonExecutorConfigurationDataService()); + } + @Bean(name = "externalPythonExecutorService") public PythonRuntimeService externalPythonExecutorService() { return new ExternalPythonExecutorServiceImpl(new Semaphore(100), new Semaphore(50)); 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 b42a3d0f5..a1a9f7f06 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 @@ -41,6 +41,7 @@ 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.PythonRuntimeService; import io.cloudslang.runtime.api.python.entities.PythonExecutorDetails; import io.cloudslang.runtime.impl.python.PythonExecutionCachedEngine; @@ -48,6 +49,7 @@ 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.external.ExternalPythonExecutionEngine; import io.cloudslang.runtime.impl.python.external.ExternalPythonRuntimeServiceImpl; import io.cloudslang.runtime.impl.python.external.StatefulRestEasyClientsHolder; @@ -529,6 +531,12 @@ public PythonRuntimeService externalPythonExecutorService() { return new ExternalPythonExecutorServiceImpl(new Semaphore(100), new Semaphore(50)); } + @Bean(name = "pythonExecutorLifecycleManagerService") + public PythonExecutorLifecycleManagerService pythonExecutorLifecycleManagerService() { + return new PythonExecutorLifecycleManagerServiceImpl(pythonExecutorCommunicationService(), + pythonExecutorConfigurationDataService()); + } + @Bean(name = "externalPythonRuntimeService") public PythonRuntimeService externalPythonRuntimeService() { return new ExternalPythonRuntimeServiceImpl(new Semaphore(100), new Semaphore(50)); 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 90454f740..49db2d0f7 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 @@ -32,6 +32,7 @@ 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.PythonRuntimeService; import io.cloudslang.runtime.api.python.entities.PythonExecutorDetails; import io.cloudslang.runtime.impl.python.PythonExecutionCachedEngine; @@ -39,6 +40,7 @@ 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.external.ExternalPythonExecutionEngine; import io.cloudslang.runtime.impl.python.external.StatefulRestEasyClientsHolder; import io.cloudslang.score.api.EndBranchDataContainer; @@ -620,6 +622,12 @@ public PythonExecutorCommunicationServiceImpl pythonExecutorCommunicationService mock(StatefulRestEasyClientsHolder.class), mock(PythonExecutorConfigurationDataService.class)); } + @Bean(name = "pythonExecutorLifecycleManagerService") + public PythonExecutorLifecycleManagerService pythonExecutorLifecycleManagerService() { + return new PythonExecutorLifecycleManagerServiceImpl(pythonExecutorCommunicationService(), + pythonExecutorConfigurationDataService()); + } + @Bean(name = "externalPythonRuntimeService") public PythonRuntimeService externalPythonRuntimeService() { return new PythonRuntimeServiceImpl(); 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 65a562cca..bdd2de092 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 @@ -38,6 +38,7 @@ 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.PythonRuntimeService; import io.cloudslang.runtime.api.python.entities.PythonExecutorDetails; import io.cloudslang.runtime.impl.python.PythonExecutionCachedEngine; @@ -45,6 +46,7 @@ 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.external.ExternalPythonExecutionEngine; import io.cloudslang.runtime.impl.python.external.ExternalPythonRuntimeServiceImpl; import io.cloudslang.runtime.impl.python.external.StatefulRestEasyClientsHolder; @@ -656,6 +658,12 @@ public PythonExecutorCommunicationServiceImpl pythonExecutorCommunicationService mock(StatefulRestEasyClientsHolder.class), mock(PythonExecutorConfigurationDataService.class)); } + @Bean(name = "pythonExecutorLifecycleManagerService") + public PythonExecutorLifecycleManagerService pythonExecutorLifecycleManagerService() { + return new PythonExecutorLifecycleManagerServiceImpl(pythonExecutorCommunicationService(), + pythonExecutorConfigurationDataService()); + } + @Bean(name = "externalPythonExecutorService") public PythonRuntimeService externalPythonExecutorService() { return new ExternalPythonExecutorServiceImpl(new Semaphore(100), new Semaphore(50));