use of pipelite.executor.SyncTestExecutor in project pipelite by enasequence.
the class DependencyResolverTest method simulatedStageExecution.
private SingleStageProcess simulatedStageExecution(ErrorType errorType, int executionCount, int immediateCount, int maximumRetries, int immediateRetries) {
StageEntity stageEntity = new StageEntity();
stageEntity.setExecutionCount(executionCount);
stageEntity.setStageState(ERROR);
stageEntity.setErrorType(errorType);
SyncTestExecutor executor = StageExecutor.createSyncTestExecutor(StageExecutorState.SUCCESS, null);
executor.setExecutorParams(ExecutorParameters.builder().immediateRetries(immediateRetries).maximumRetries(maximumRetries).build());
Stage stage = Stage.builder().stageName("STAGE").executor(executor).build();
stage.setStageEntity(stageEntity);
for (int i = 0; i < immediateCount; ++i) {
stage.incrementImmediateExecutionCount();
}
return new SingleStageProcess(new Process("TEST", ProcessBuilderHelper.stageGraph(Arrays.asList(new ProcessBuilderHelper.AddedStage(stage)))), stage);
}
use of pipelite.executor.SyncTestExecutor in project pipelite by enasequence.
the class DependencyResolverTest method simulatedStageExecution.
private SingleStageProcess simulatedStageExecution(StageState stageState, int executionCount, int immediateExecutionCount, int maximumRetries, int immediateRetries) {
StageEntity stageEntity = new StageEntity();
stageEntity.setExecutionCount(executionCount);
stageEntity.setStageState(stageState);
SyncTestExecutor executor = StageExecutor.createSyncTestExecutor(StageExecutorState.SUCCESS, null);
executor.setExecutorParams(ExecutorParameters.builder().immediateRetries(immediateRetries).maximumRetries(maximumRetries).build());
Stage stage = Stage.builder().stageName("STAGE").executor(executor).build();
stage.setStageEntity(stageEntity);
for (int i = 0; i < immediateExecutionCount; ++i) {
stage.incrementImmediateExecutionCount();
}
return new SingleStageProcess(new Process("TEST", ProcessBuilderHelper.stageGraph(Arrays.asList(new ProcessBuilderHelper.AddedStage(stage)))), stage);
}
Aggregations