private PipelineExecutorError mockError(String error, String detail) { return new PipelineExecutorError(error, detail); }
private void onPipelineError(final OnErrorPipelineExecutionEvent oepee, final TaskEntry taskEntry) { taskEntry.getTask().setPipelineStatus(PipelineExecutorTask.Status.ERROR); taskEntry.getTask().setPipelineError(new PipelineExecutorError(oepee.getError().getMessage(), oepee.getError())); if (taskEntry.isAsync()) { updateExecutorRegistry(taskEntry.getTask()); } }
private void testOnPipelineErrorExecutionEvent(boolean async) { when(taskEntry.isAsync()).thenReturn(async); OnErrorPipelineExecutionEvent event = new OnErrorPipelineExecutionEvent(TASK_ID, pipeline, stage, error); taskManager.localListener.onPipelineError(event); verify(task, times(1)).setPipelineStatus(PipelineExecutorTask.Status.ERROR); verify(task, times(1)).setPipelineError(pipelineExecutorErrorCaptor.capture()); assertEquals(new PipelineExecutorError(ERROR_MESSAGE, error), pipelineExecutorErrorCaptor.getValue()); verifyExecutorRegistryUpdated(async); verifyExternalListenersNotified(event); }
private void testOnStageErrorExecutionEvent(boolean async) { when(taskEntry.isAsync()).thenReturn(async); OnErrorStageExecutionEvent event = new OnErrorStageExecutionEvent(TASK_ID, pipeline, stage, error); taskManager.localListener.onStageError(event); verify(task, times(1)).setPipelineStatus(PipelineExecutorTask.Status.ERROR); verify(task, times(1)).setStageStatus(stage.getName(), PipelineExecutorTask.Status.ERROR); verify(task, times(1)).setStageError(eq(stage.getName()), pipelineExecutorErrorCaptor.capture()); assertEquals(new PipelineExecutorError(ERROR_MESSAGE, error), pipelineExecutorErrorCaptor.getValue()); verifyExecutorRegistryUpdated(async); verifyExternalListenersNotified(event); }
private void onStageError(final OnErrorStageExecutionEvent oesee, final TaskEntry taskEntry) { taskEntry.getTask().setPipelineStatus(PipelineExecutorTask.Status.ERROR); taskEntry.getTask().setStageStatus(oesee.getStage().getName(), PipelineExecutorTask.Status.ERROR); taskEntry.getTask().setStageError(oesee.getStage().getName(), new PipelineExecutorError(oesee.getError().getMessage(), oesee.getError())); if (taskEntry.isAsync()) { updateExecutorRegistry(taskEntry.getTask()); } }