@Test public void testParseToJobStepStatusReturnsJobStepStatusStopped() { ExecutableState executableState = ExecutableState.STOPPED; JobStepStatusEnum jobStepStatusEnum = JobInfoConverter.parseToJobStepStatus(executableState); assertFalse(jobStepStatusEnum.isComplete()); assertFalse(jobStepStatusEnum.isRunable()); assertEquals(128, jobStepStatusEnum.getCode()); assertEquals(JobStepStatusEnum.STOPPED, jobStepStatusEnum); }
public static JobStepStatusEnum parseToJobStepStatus(ExecutableState state) { switch (state) { case READY: return JobStepStatusEnum.PENDING; case RUNNING: return JobStepStatusEnum.RUNNING; case ERROR: return JobStepStatusEnum.ERROR; case DISCARDED: return JobStepStatusEnum.DISCARDED; case SUCCEED: return JobStepStatusEnum.FINISHED; case STOPPED: return JobStepStatusEnum.STOPPED; default: throw new RuntimeException("invalid state:" + state); } }
JobInfoConverter { public static JobStepStatusEnum parseToJobStepStatus(ExecutableState state) { switch (state) { case READY: return JobStepStatusEnum.PENDING; case RUNNING: return JobStepStatusEnum.RUNNING; case ERROR: return JobStepStatusEnum.ERROR; case DISCARDED: return JobStepStatusEnum.DISCARDED; case SUCCEED: return JobStepStatusEnum.FINISHED; case STOPPED: return JobStepStatusEnum.STOPPED; default: throw new RuntimeException("invalid state:" + state); } } }
JobInfoConverter { public static JobStepStatusEnum parseToJobStepStatus(ExecutableState state) { switch (state) { case READY: return JobStepStatusEnum.PENDING; case RUNNING: return JobStepStatusEnum.RUNNING; case ERROR: return JobStepStatusEnum.ERROR; case DISCARDED: return JobStepStatusEnum.DISCARDED; case SUCCEED: return JobStepStatusEnum.FINISHED; case STOPPED: return JobStepStatusEnum.STOPPED; default: throw new RuntimeException("invalid state:" + state); } }  }
JobInfoConverter { public static JobStepStatusEnum parseToJobStepStatus(ExecutableState state) { switch (state) { case READY: return JobStepStatusEnum.PENDING; case RUNNING: return JobStepStatusEnum.RUNNING; case ERROR: return JobStepStatusEnum.ERROR; case DISCARDED: return JobStepStatusEnum.DISCARDED; case SUCCEED: return JobStepStatusEnum.FINISHED; case STOPPED: return JobStepStatusEnum.STOPPED; default: throw new RuntimeException("invalid state:" + state); } }  static JobInstance parseToJobInstanceQuietly(CubingJob job, Map<String, Output> outputs); static JobInstance parseToJobInstanceQuietly(CheckpointExecutable job, Map<String, Output> outputs); static JobInstance parseToJobInstance(CubingJob job, Map<String, Output> outputs); static JobInstance parseToJobInstance(CheckpointExecutable job, Map<String, Output> outputs); static JobInstance.JobStep parseToJobStep(AbstractExecutable task, int i, Output stepOutput); static JobStatusEnum parseToJobStatus(ExecutableState state); static JobStepStatusEnum parseToJobStepStatus(ExecutableState state); static JobSearchResult parseToJobSearchResult(DefaultChainedExecutable job, Map<String, ExecutableOutputPO> outputs); }
JobInfoConverter { public static JobStepStatusEnum parseToJobStepStatus(ExecutableState state) { switch (state) { case READY: return JobStepStatusEnum.PENDING; case RUNNING: return JobStepStatusEnum.RUNNING; case ERROR: return JobStepStatusEnum.ERROR; case DISCARDED: return JobStepStatusEnum.DISCARDED; case SUCCEED: return JobStepStatusEnum.FINISHED; case STOPPED: return JobStepStatusEnum.STOPPED; default: throw new RuntimeException("invalid state:" + state); } }  static JobInstance parseToJobInstanceQuietly(CubingJob job, Map<String, Output> outputs); static JobInstance parseToJobInstanceQuietly(CheckpointExecutable job, Map<String, Output> outputs); static JobInstance parseToJobInstance(CubingJob job, Map<String, Output> outputs); static JobInstance parseToJobInstance(CheckpointExecutable job, Map<String, Output> outputs); static JobInstance.JobStep parseToJobStep(AbstractExecutable task, int i, Output stepOutput); static JobStatusEnum parseToJobStatus(ExecutableState state); static JobStepStatusEnum parseToJobStepStatus(ExecutableState state); static JobSearchResult parseToJobSearchResult(DefaultChainedExecutable job, Map<String, ExecutableOutputPO> outputs);  }