use of org.guvnor.ala.pipeline.Stage in project kie-wb-common by kiegroup.
the class PipelineExecutorTaskManagerImplTestBase method mockStages.
public static List<Stage> mockStages(int count) {
List<Stage> result = new ArrayList<>();
for (int i = 0; i < count; i++) {
Stage stage = mock(Stage.class);
when(stage.getName()).thenReturn("Stage.name." + Integer.toString(i));
result.add(stage);
}
return result;
}
use of org.guvnor.ala.pipeline.Stage in project kie-wb-common by kiegroup.
the class PipelineExecutorTraceImplMarshallerTest method getValue.
@Override
public PipelineExecutorTraceImpl getValue() {
// only the stage names are used by the taskDef, so the pipeline can be mocked.
List<Stage> stages = mockStages(STAGE_COUNT);
Pipeline pipeline = new BasePipeline(PIPELINE_NAME, stages) {
};
Input input = mockInput(PIPELINE_INPUT_SIZE);
PipelineExecutorTaskDefImpl taskDef = new PipelineExecutorTaskDefImpl(pipeline, input);
PipelineExecutorTaskImpl taskImpl = new PipelineExecutorTaskImpl(taskDef, PIPELINE_EXECUTION_ID);
taskImpl.setPipelineStatus(PipelineExecutorTask.Status.SCHEDULED);
taskImpl.setPipelineError(mockError(PIPELINE_ERROR, PIPELINE_ERROR_DETAIL));
taskImpl.getTaskDef().getStages().forEach(stage -> taskImpl.setStageError(stage, mockStageError(stage)));
taskImpl.setOutput(new MockPipelineOutput(PIPELINE_OUTPUT));
return new PipelineExecutorTraceImpl(taskImpl);
}
use of org.guvnor.ala.pipeline.Stage in project kie-wb-common by kiegroup.
the class PipelineExecutorTraceImplMarshallerTest method mockStages.
private List<Stage> mockStages(int count) {
List<Stage> stages = new ArrayList<>();
for (int i = 0; i < count; i++) {
Stage stage = mock(Stage.class);
when(stage.getName()).thenReturn("Stage.name." + Integer.toString(i));
stages.add(stage);
}
return stages;
}
use of org.guvnor.ala.pipeline.Stage in project kie-wb-common by kiegroup.
the class PipelineExecutionListenerTest method setUp.
@Before
public void setUp() {
traceKey = new PipelineExecutionTraceKey(EXECUTION_ID);
pipeline = mock(Pipeline.class);
stage = mock(Stage.class);
when(stage.getName()).thenReturn(STAGE_NAME);
throwable = mock(Throwable.class);
listener = new PipelineExecutionListener(pipelineStatusChangeEvent, stageStatusChangeEvent);
}
Aggregations