use of org.guvnor.ala.pipeline.events.BeforePipelineExecutionEvent in project kie-wb-common by kiegroup.
the class PipelineExecutorTaskManagerImplEventsTest method testBeforePipelineExecutionEvent.
private void testBeforePipelineExecutionEvent(boolean async) {
when(taskEntry.isAsync()).thenReturn(async);
BeforePipelineExecutionEvent event = new BeforePipelineExecutionEvent(TASK_ID, pipeline);
taskManager.localListener.beforePipelineExecution(event);
verify(task, times(1)).setPipelineStatus(PipelineExecutorTask.Status.RUNNING);
verifyExecutorRegistryUpdated(async);
verifyExternalListenersNotified(event);
}
use of org.guvnor.ala.pipeline.events.BeforePipelineExecutionEvent in project kie-wb-common by kiegroup.
the class PipelineExecutor method execute.
public <T> void execute(final Input input, final Pipeline pipeline, final Consumer<T> callback, final PipelineEventListener... eventListeners) {
final PipelineContext context = new PipelineContext(pipeline);
context.start(input);
context.pushCallback(callback);
propagateEvent(new BeforePipelineExecutionEvent(context.getExecutionId(), pipeline), eventListeners);
continuePipeline(context, eventListeners);
propagateEvent(new AfterPipelineExecutionEvent(context.getExecutionId(), pipeline), eventListeners);
}
use of org.guvnor.ala.pipeline.events.BeforePipelineExecutionEvent in project kie-wb-common by kiegroup.
the class PipelineExecutionListenerTest method testBeforePipelineExecution.
@Test
public void testBeforePipelineExecution() {
listener.beforePipelineExecution(new BeforePipelineExecutionEvent(EXECUTION_ID, pipeline));
verify(pipelineStatusChangeEvent, times(1)).fire(new PipelineStatusChangeEvent(traceKey, PipelineStatus.RUNNING));
}
use of org.guvnor.ala.pipeline.events.BeforePipelineExecutionEvent in project kie-wb-common by kiegroup.
the class RestPipelineEventsTest method testEventsPropagation.
@Test
public void testEventsPropagation() {
List<PipelineConfigStage> configs = new ArrayList<>();
configs.add(new PipelineConfigStage("GitConfig", new GitConfigImpl()));
configs.add(new PipelineConfigStage("MavenProjectConfig", new MavenProjectConfigImpl()));
pipelineService.newPipeline(new PipelineConfigImpl("mypipe", configs));
Input input = new Input();
input.put("repo-name", "drools-workshop-events");
input.put("create-repo", "true");
input.put("branch", "master");
input.put("out-dir", tempPath.getAbsolutePath());
input.put("origin", gitUrl);
pipelineService.runPipeline("mypipe", input, false);
assertEquals(6, listener.getEvents().size());
assertTrue(listener.getEvents().get(0) instanceof BeforePipelineExecutionEvent);
assertTrue(listener.getEvents().get(1) instanceof BeforeStageExecutionEvent);
assertTrue(listener.getEvents().get(2) instanceof AfterStageExecutionEvent);
assertTrue(listener.getEvents().get(3) instanceof BeforeStageExecutionEvent);
assertTrue(listener.getEvents().get(4) instanceof AfterStageExecutionEvent);
assertTrue(listener.getEvents().get(5) instanceof AfterPipelineExecutionEvent);
}
Aggregations