@Override
 public JobExecutionInfoResource getSerializationValue() {
   JobInstance jobInstance = new JobInstance(1l, "job1");
   JobExecution jobExecution =
       new JobExecution(
           jobInstance,
           2l,
           new JobParametersBuilder()
               .addString("foo", "bar")
               .addDouble("baz", 3.0, false)
               .toJobParameters(),
           "configName.xml");
   jobExecution.setVersion(1);
   jobExecution.setStatus(BatchStatus.STARTED);
   jobExecution.setCreateTime(new Date(0));
   jobExecution.setStartTime(new Date(1000));
   jobExecution.setLastUpdated(new Date(3000));
   StepExecution stepExecution = new StepExecution("step1", jobExecution, 3l);
   stepExecution.setStatus(BatchStatus.STARTED);
   stepExecution.setStartTime(new Date(1000));
   stepExecution.setLastUpdated(new Date(3000));
   jobExecution.addStepExecutions(Arrays.asList(stepExecution));
   JobExecutionInfoResource jobExecutionInfoResource =
       new JobExecutionInfoResource(jobExecution, TimeZone.getTimeZone("America/Chicago"));
   jobExecutionInfoResource.setStepExecutions(
       Arrays.asList(
           new StepExecutionInfoResource(stepExecution, TimeZone.getTimeZone("America/Chicago"))));
   return jobExecutionInfoResource;
 }
コード例 #2
0
 @Override
 public StepExecution mapRow(ResultSet rs, int rowNum) throws SQLException {
   StepExecution stepExecution = new StepExecution(rs.getString(2), jobExecution, rs.getLong(1));
   stepExecution.setStartTime(rs.getTimestamp(3));
   stepExecution.setEndTime(rs.getTimestamp(4));
   stepExecution.setStatus(BatchStatus.valueOf(rs.getString(5)));
   stepExecution.setCommitCount(rs.getInt(6));
   stepExecution.setReadCount(rs.getInt(7));
   stepExecution.setFilterCount(rs.getInt(8));
   stepExecution.setWriteCount(rs.getInt(9));
   stepExecution.setExitStatus(new ExitStatus(rs.getString(10), rs.getString(11)));
   stepExecution.setReadSkipCount(rs.getInt(12));
   stepExecution.setWriteSkipCount(rs.getInt(13));
   stepExecution.setProcessSkipCount(rs.getInt(14));
   stepExecution.setRollbackCount(rs.getInt(15));
   stepExecution.setLastUpdated(rs.getTimestamp(16));
   stepExecution.setVersion(rs.getInt(17));
   return stepExecution;
 }