use of org.guvnor.ala.pipeline.events.AfterPipelineExecutionEvent 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.AfterPipelineExecutionEvent in project kie-wb-common by kiegroup.
the class PipelineExecutionListenerTest method testAfterPipelineExecution.
@Test
public void testAfterPipelineExecution() {
listener.afterPipelineExecution(new AfterPipelineExecutionEvent(EXECUTION_ID, pipeline));
verify(pipelineStatusChangeEvent, times(1)).fire(new PipelineStatusChangeEvent(traceKey, PipelineStatus.FINISHED));
}
use of org.guvnor.ala.pipeline.events.AfterPipelineExecutionEvent 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);
}
use of org.guvnor.ala.pipeline.events.AfterPipelineExecutionEvent in project kie-wb-common by kiegroup.
the class PipelineExecutorTaskManagerImplEventsTest method testAfterPipelineExecutionEvent.
private void testAfterPipelineExecutionEvent(boolean async) {
when(taskEntry.isAsync()).thenReturn(async);
AfterPipelineExecutionEvent event = new AfterPipelineExecutionEvent(TASK_ID, pipeline);
taskManager.localListener.afterPipelineExecution(event);
verify(task, times(1)).setPipelineStatus(PipelineExecutorTask.Status.FINISHED);
verifyExecutorRegistryUpdated(async);
verifyExternalListenersNotified(event);
}
Aggregations