Search in sources :

Example 6 with ExecutorParameters

use of pipelite.stage.parameters.ExecutorParameters in project pipelite by enasequence.

the class StageExecutorSerializerTest method deserializeExecutorParams.

@Test
public void deserializeExecutorParams() {
    StageEntity stageEntity = new StageEntity();
    stageEntity.setExecutorParams("{\n" + "  \"maximumRetries\" : 3,\n" + "  \"immediateRetries\" : 3\n" + "}");
    TestExecutor executor = new TestExecutor(StageState.SUCCESS);
    Stage stage = Stage.builder().stageName("STAGE1").executor(executor).build();
    stage.setStageEntity(stageEntity);
    ExecutorParameters deserializedExecutorParams = StageExecutorSerializer.deserializeExecutorParameters(stage, executor.getExecutorParamsType());
    assertThat(deserializedExecutorParams).isNotNull();
    assertThat(deserializedExecutorParams.getImmediateRetries()).isEqualTo(3);
    assertThat(deserializedExecutorParams.getMaximumRetries()).isEqualTo(3);
}
Also used : SimpleLsfExecutorParameters(pipelite.stage.parameters.SimpleLsfExecutorParameters) ExecutorParameters(pipelite.stage.parameters.ExecutorParameters) Stage(pipelite.stage.Stage) StageEntity(pipelite.entity.StageEntity) Test(org.junit.jupiter.api.Test)

Aggregations

ExecutorParameters (pipelite.stage.parameters.ExecutorParameters)6 StageEntity (pipelite.entity.StageEntity)3 Test (org.junit.jupiter.api.Test)2 Process (pipelite.process.Process)2 ProcessBuilder (pipelite.process.builder.ProcessBuilder)2 Stage (pipelite.stage.Stage)2 ArrayList (java.util.ArrayList)1 List (java.util.List)1 Assertions (org.assertj.core.api.Assertions)1 Assertions.assertThat (org.assertj.core.api.Assertions.assertThat)1 ProcessEntity (pipelite.entity.ProcessEntity)1 AbstractAsyncExecutor (pipelite.executor.AbstractAsyncExecutor)1 JsonSerializableExecutor (pipelite.executor.JsonSerializableExecutor)1 ProcessState (pipelite.process.ProcessState)1 StageState (pipelite.stage.StageState)1 SimpleLsfExecutorParameters (pipelite.stage.parameters.SimpleLsfExecutorParameters)1