@Test public void testParseToJobStatusReturnsJobStatusStopped() { ExecutableState executableState = ExecutableState.STOPPED; JobStatusEnum jobStatusEnum = JobInfoConverter.parseToJobStatus(executableState); assertEquals(32, jobStatusEnum.getCode()); assertEquals(JobStatusEnum.STOPPED, jobStatusEnum); }
public static JobStatusEnum parseToJobStatus(ExecutableState state) { switch (state) { case READY: return JobStatusEnum.PENDING; case RUNNING: return JobStatusEnum.RUNNING; case ERROR: return JobStatusEnum.ERROR; case DISCARDED: return JobStatusEnum.DISCARDED; case SUCCEED: return JobStatusEnum.FINISHED; case STOPPED: return JobStatusEnum.STOPPED; default: throw new RuntimeException("invalid state:" + state); } }
JobInfoConverter { public static JobStatusEnum parseToJobStatus(ExecutableState state) { switch (state) { case READY: return JobStatusEnum.PENDING; case RUNNING: return JobStatusEnum.RUNNING; case ERROR: return JobStatusEnum.ERROR; case DISCARDED: return JobStatusEnum.DISCARDED; case SUCCEED: return JobStatusEnum.FINISHED; case STOPPED: return JobStatusEnum.STOPPED; default: throw new RuntimeException("invalid state:" + state); } } }
JobInfoConverter { public static JobStatusEnum parseToJobStatus(ExecutableState state) { switch (state) { case READY: return JobStatusEnum.PENDING; case RUNNING: return JobStatusEnum.RUNNING; case ERROR: return JobStatusEnum.ERROR; case DISCARDED: return JobStatusEnum.DISCARDED; case SUCCEED: return JobStatusEnum.FINISHED; case STOPPED: return JobStatusEnum.STOPPED; default: throw new RuntimeException("invalid state:" + state); } }  }
JobInfoConverter { public static JobStatusEnum parseToJobStatus(ExecutableState state) { switch (state) { case READY: return JobStatusEnum.PENDING; case RUNNING: return JobStatusEnum.RUNNING; case ERROR: return JobStatusEnum.ERROR; case DISCARDED: return JobStatusEnum.DISCARDED; case SUCCEED: return JobStatusEnum.FINISHED; case STOPPED: return JobStatusEnum.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 JobStatusEnum parseToJobStatus(ExecutableState state) { switch (state) { case READY: return JobStatusEnum.PENDING; case RUNNING: return JobStatusEnum.RUNNING; case ERROR: return JobStatusEnum.ERROR; case DISCARDED: return JobStatusEnum.DISCARDED; case SUCCEED: return JobStatusEnum.FINISHED; case STOPPED: return JobStatusEnum.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);  }