Skip to content

Commit

Permalink
add beans for PythonExecutorCommunicationServiceImpl (#1404)
Browse files Browse the repository at this point in the history
Co-authored-by: TVerdesOprea <[email protected]>
  • Loading branch information
opreateodora and TVerdesOprea authored Feb 16, 2023
1 parent 9f7b933 commit 96b31a1
Show file tree
Hide file tree
Showing 10 changed files with 150 additions and 90 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@
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.external.ExternalPythonExecutionEngine;
import io.cloudslang.runtime.impl.python.external.ExternalPythonExecutorServiceImpl;
import io.cloudslang.runtime.impl.python.external.ExternalPythonRuntimeServiceImpl;
import io.cloudslang.runtime.impl.python.external.StatefulRestEasyClientsHolder;
import io.cloudslang.score.events.EventBus;
Expand Down Expand Up @@ -466,10 +467,15 @@ public PythonExecutorConfigurationDataService pythonExecutorConfigurationDataSer
return PythonExecutorDetails::new;
}

@Bean(name = "pythonExecutorCommunicationService")
public PythonExecutorCommunicationServiceImpl pythonExecutorCommunicationService() {
return new PythonExecutorCommunicationServiceImpl(
mock(StatefulRestEasyClientsHolder.class), mock(PythonExecutorConfigurationDataService.class));
}

@Bean(name = "externalPythonExecutorService")
public PythonRuntimeService externalPythonExecutorService() {
return new ExternalPythonExecutorServiceImpl(mock(StatefulRestEasyClientsHolder.class),
new Semaphore(100), new Semaphore(50));
return new ExternalPythonExecutorServiceImpl(new Semaphore(100), new Semaphore(50));
}

@Bean(name = "externalPythonRuntimeService")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@
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.external.ExternalPythonExecutionEngine;
import io.cloudslang.runtime.impl.python.external.ExternalPythonExecutorServiceImpl;
import io.cloudslang.runtime.impl.python.external.ExternalPythonRuntimeServiceImpl;
import io.cloudslang.runtime.impl.python.external.StatefulRestEasyClientsHolder;
import io.cloudslang.score.events.EventBus;
Expand Down Expand Up @@ -565,10 +566,15 @@ public PythonExecutorConfigurationDataService pythonExecutorConfigurationDataSer
return PythonExecutorDetails::new;
}

@Bean(name = "pythonExecutorCommunicationService")
public PythonExecutorCommunicationServiceImpl pythonExecutorCommunicationService() {
return new PythonExecutorCommunicationServiceImpl(
mock(StatefulRestEasyClientsHolder.class), mock(PythonExecutorConfigurationDataService.class));
}

@Bean(name = "externalPythonExecutorService")
public PythonRuntimeService externalPythonExecutorService() {
return new ExternalPythonExecutorServiceImpl(mock(StatefulRestEasyClientsHolder.class),
new Semaphore(100), new Semaphore(50));
return new ExternalPythonExecutorServiceImpl(new Semaphore(100), new Semaphore(50));
}

@Bean(name = "externalPythonRuntimeService")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@
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.external.ExternalPythonExecutionEngine;
import io.cloudslang.runtime.impl.python.external.ExternalPythonExecutorServiceImpl;
import io.cloudslang.runtime.impl.python.external.ExternalPythonRuntimeServiceImpl;
import io.cloudslang.runtime.impl.python.external.StatefulRestEasyClientsHolder;
import io.cloudslang.score.events.EventBus;
Expand Down Expand Up @@ -273,10 +274,15 @@ public PythonExecutorConfigurationDataService pythonExecutorConfigurationDataSer
return PythonExecutorDetails::new;
}

@Bean(name = "pythonExecutorCommunicationService")
public PythonExecutorCommunicationServiceImpl pythonExecutorCommunicationService() {
return new PythonExecutorCommunicationServiceImpl(
mock(StatefulRestEasyClientsHolder.class), mock(PythonExecutorConfigurationDataService.class));
}

@Bean(name = "externalPythonExecutorService")
public PythonRuntimeService externalPythonExecutorService() {
return new ExternalPythonExecutorServiceImpl(mock(StatefulRestEasyClientsHolder.class),
new Semaphore(100), new Semaphore(50));
return new ExternalPythonExecutorServiceImpl(new Semaphore(100), new Semaphore(50));
}

@Bean(name = "externalPythonRuntimeService")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@
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.external.ExternalPythonExecutionEngine;
import io.cloudslang.runtime.impl.python.external.ExternalPythonExecutorServiceImpl;
import io.cloudslang.runtime.impl.python.external.ExternalPythonRuntimeServiceImpl;
import io.cloudslang.runtime.impl.python.external.StatefulRestEasyClientsHolder;
import io.cloudslang.score.events.EventBus;
Expand Down Expand Up @@ -250,10 +251,15 @@ public PythonExecutorConfigurationDataService pythonExecutorConfigurationDataSer
return PythonExecutorDetails::new;
}

@Bean(name = "pythonExecutorCommunicationService")
public PythonExecutorCommunicationServiceImpl pythonExecutorCommunicationService() {
return new PythonExecutorCommunicationServiceImpl(
mock(StatefulRestEasyClientsHolder.class), mock(PythonExecutorConfigurationDataService.class));
}

@Bean(name = "externalPythonExecutorService")
public PythonRuntimeService externalPythonExecutorService() {
return new ExternalPythonExecutorServiceImpl(mock(StatefulRestEasyClientsHolder.class),
new Semaphore(100), new Semaphore(50));
return new ExternalPythonExecutorServiceImpl(new Semaphore(100), new Semaphore(50));
}

@Bean(name = "externalPythonRuntimeService")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@
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.external.ExternalPythonExecutionEngine;
import io.cloudslang.runtime.impl.python.external.ExternalPythonExecutorServiceImpl;
import io.cloudslang.runtime.impl.python.external.ExternalPythonRuntimeServiceImpl;
import io.cloudslang.runtime.impl.python.external.StatefulRestEasyClientsHolder;
import io.cloudslang.score.events.EventBus;
Expand Down Expand Up @@ -216,10 +217,15 @@ public PythonExecutorConfigurationDataService pythonExecutorConfigurationDataSer
return PythonExecutorDetails::new;
}

@Bean(name = "pythonExecutorCommunicationService")
public PythonExecutorCommunicationServiceImpl pythonExecutorCommunicationService() {
return new PythonExecutorCommunicationServiceImpl(
mock(StatefulRestEasyClientsHolder.class), mock(PythonExecutorConfigurationDataService.class));
}

@Bean(name = "externalPythonExecutorService")
public PythonRuntimeService externalPythonExecutorService() {
return new ExternalPythonExecutorServiceImpl(mock(StatefulRestEasyClientsHolder.class),
new Semaphore(100), new Semaphore(50));
return new ExternalPythonExecutorServiceImpl(new Semaphore(100), new Semaphore(50));
}

@Bean(name = "externalPythonRuntimeService")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@
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.external.ExternalPythonExecutionEngine;
import io.cloudslang.runtime.impl.python.external.ExternalPythonExecutorServiceImpl;
import io.cloudslang.runtime.impl.python.external.ExternalPythonRuntimeServiceImpl;
import io.cloudslang.runtime.impl.python.external.StatefulRestEasyClientsHolder;
import io.cloudslang.score.events.EventBus;
Expand Down Expand Up @@ -206,10 +207,15 @@ public PythonExecutorConfigurationDataService pythonExecutorConfigurationDataSer
return PythonExecutorDetails::new;
}

@Bean(name = "pythonExecutorCommunicationService")
public PythonExecutorCommunicationServiceImpl pythonExecutorCommunicationService() {
return new PythonExecutorCommunicationServiceImpl(
mock(StatefulRestEasyClientsHolder.class), mock(PythonExecutorConfigurationDataService.class));
}

@Bean(name = "externalPythonExecutorService")
public PythonRuntimeService externalPythonExecutorService() {
return new ExternalPythonExecutorServiceImpl(mock(StatefulRestEasyClientsHolder.class),
new Semaphore(100), new Semaphore(50));
return new ExternalPythonExecutorServiceImpl(new Semaphore(100), new Semaphore(50));
}

@Bean(name = "externalPythonRuntimeService")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@
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.external.ExternalPythonExecutionEngine;
import io.cloudslang.runtime.impl.python.external.ExternalPythonExecutorServiceImpl;
import io.cloudslang.runtime.impl.python.external.ExternalPythonRuntimeServiceImpl;
import io.cloudslang.runtime.impl.python.external.StatefulRestEasyClientsHolder;
import io.cloudslang.score.api.execution.ExecutionParametersConsts;
Expand Down Expand Up @@ -1213,10 +1214,15 @@ public PythonExecutorConfigurationDataService pythonExecutorConfigurationDataSer
return PythonExecutorDetails::new;
}

@Bean(name = "pythonExecutorCommunicationService")
public PythonExecutorCommunicationServiceImpl pythonExecutorCommunicationService() {
return new PythonExecutorCommunicationServiceImpl(
mock(StatefulRestEasyClientsHolder.class), mock(PythonExecutorConfigurationDataService.class));
}

@Bean(name = "externalPythonExecutorService")
public PythonRuntimeService externalPythonExecutorService() {
return new ExternalPythonExecutorServiceImpl(mock(StatefulRestEasyClientsHolder.class),
new Semaphore(100), new Semaphore(50));
return new ExternalPythonExecutorServiceImpl(new Semaphore(100), new Semaphore(50));
}

@Bean(name = "externalPythonRuntimeService")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@
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.external.ExternalPythonExecutionEngine;
import io.cloudslang.runtime.impl.python.external.ExternalPythonExecutorServiceImpl;
import io.cloudslang.runtime.impl.python.external.ExternalPythonRuntimeServiceImpl;
import io.cloudslang.runtime.impl.python.external.StatefulRestEasyClientsHolder;
import io.cloudslang.score.api.execution.precondition.ExecutionPreconditionService;
Expand Down Expand Up @@ -517,10 +518,15 @@ public PythonExecutorConfigurationDataService pythonExecutorConfigurationDataSer
return PythonExecutorDetails::new;
}

@Bean(name = "pythonExecutorCommunicationService")
public PythonExecutorCommunicationServiceImpl pythonExecutorCommunicationService() {
return new PythonExecutorCommunicationServiceImpl(
mock(StatefulRestEasyClientsHolder.class), mock(PythonExecutorConfigurationDataService.class));
}

@Bean(name = "externalPythonExecutorService")
public PythonRuntimeService externalPythonExecutorService() {
return new ExternalPythonExecutorServiceImpl(mock(StatefulRestEasyClientsHolder.class),
new Semaphore(100), new Semaphore(50));
return new ExternalPythonExecutorServiceImpl(new Semaphore(100), new Semaphore(50));
}

@Bean(name = "externalPythonRuntimeService")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@
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.external.ExternalPythonExecutionEngine;
import io.cloudslang.runtime.impl.python.external.ExternalPythonExecutorServiceImpl;
import io.cloudslang.runtime.impl.python.external.StatefulRestEasyClientsHolder;
import io.cloudslang.score.api.EndBranchDataContainer;
import io.cloudslang.score.events.EventBus;
Expand Down Expand Up @@ -613,15 +614,20 @@ public PythonExecutorConfigurationDataService pythonExecutorConfigurationDataSer
return PythonExecutorDetails::new;
}

@Bean(name = "pythonExecutorCommunicationService")
public PythonExecutorCommunicationServiceImpl pythonExecutorCommunicationService() {
return new PythonExecutorCommunicationServiceImpl(
mock(StatefulRestEasyClientsHolder.class), mock(PythonExecutorConfigurationDataService.class));
}

@Bean(name = "externalPythonRuntimeService")
public PythonRuntimeService externalPythonRuntimeService() {
return new PythonRuntimeServiceImpl();
}

@Bean(name = "externalPythonExecutorService")
public PythonRuntimeService externalPythonexecutorService() {
return new ExternalPythonExecutorServiceImpl(mock(StatefulRestEasyClientsHolder.class),
new Semaphore(100), new Semaphore(50));
return new ExternalPythonExecutorServiceImpl(new Semaphore(100), new Semaphore(50));
}


Expand Down
Loading

0 comments on commit 96b31a1

Please sign in to comment.