@Test(expected=IllegalArgumentException.class) public void testWithNullStepExecution() { new JsrStepExecution(null); }
@Override public List<StepExecution> getStepExecutions(long executionId) throws NoSuchJobExecutionException, JobSecurityException { org.springframework.batch.core.JobExecution execution = jobExplorer.getJobExecution(executionId); if(execution == null) { throw new NoSuchJobException("JobExecution with the id " + executionId + " was not found"); } Collection<org.springframework.batch.core.StepExecution> executions = execution.getStepExecutions(); List<StepExecution> batchExecutions = new ArrayList<>(); if(executions != null) { for (org.springframework.batch.core.StepExecution stepExecution : executions) { if(!stepExecution.getStepName().contains(":partition")) { batchExecutions.add(new JsrStepExecution(jobExplorer.getStepExecution(executionId, stepExecution.getId()))); } } } return batchExecutions; }
@Override public void execute(StepExecution stepExecution) throws JobInterruptedException { stepExecution.setStatus(BatchStatus.COMPLETED); try { stepExecution.setExitStatus(new ExitStatus(decider.decide(new javax.batch.runtime.StepExecution [] {new JsrStepExecution(stepExecution)}))); } catch (Exception e) { throw new RuntimeException(e); } jobRepository.update(stepExecution); } }
stepExecutions.add(new JsrStepExecution(curStepExecution)); stepExecutions.add(new JsrStepExecution(lastExecution));
@Before public void setUp() throws Exception { JobExecution jobExecution = new JobExecution(1L, new JobParametersBuilder().addString("key", "value").toJobParameters()); stepExecution = new StepExecution("testStep", jobExecution); stepExecution.setId(5L); stepExecution.setStatus(BatchStatus.STARTED); stepExecution.setExitStatus(new ExitStatus("customExitStatus")); stepExecution.setCommitCount(1); stepExecution.setFilterCount(2); stepExecution.setProcessSkipCount(3); stepExecution.setReadCount(4); stepExecution.setReadSkipCount(5); stepExecution.setRollbackCount(6); stepExecution.setWriteCount(7); stepExecution.setWriteSkipCount(8); stepExecution.setStartTime(new Date(0)); stepExecution.setEndTime(new Date(10000000)); stepExecution.getExecutionContext().put(executionContextUserSupport.getKey("batch_jsr_persistentUserData"), "persisted data"); jsrStepExecution = new JsrStepExecution(stepExecution); }
@Override public List<StepExecution> getStepExecutions(long executionId) throws NoSuchJobExecutionException, JobSecurityException { org.springframework.batch.core.JobExecution execution = jobExplorer.getJobExecution(executionId); if(execution == null) { throw new NoSuchJobException("JobExecution with the id " + executionId + " was not found"); } Collection<org.springframework.batch.core.StepExecution> executions = execution.getStepExecutions(); List<StepExecution> batchExecutions = new ArrayList<StepExecution>(); if(executions != null) { for (org.springframework.batch.core.StepExecution stepExecution : executions) { if(!stepExecution.getStepName().contains(":partition")) { batchExecutions.add(new JsrStepExecution(jobExplorer.getStepExecution(executionId, stepExecution.getId()))); } } } return batchExecutions; }
@Override public List<StepExecution> getStepExecutions(long executionId) throws NoSuchJobExecutionException, JobSecurityException { org.springframework.batch.core.JobExecution execution = jobExplorer.getJobExecution(executionId); if(execution == null) { throw new NoSuchJobException("JobExecution with the id " + executionId + " was not found"); } Collection<org.springframework.batch.core.StepExecution> executions = execution.getStepExecutions(); List<StepExecution> batchExecutions = new ArrayList<StepExecution>(); if(executions != null) { for (org.springframework.batch.core.StepExecution stepExecution : executions) { if(!stepExecution.getStepName().contains(":partition")) { batchExecutions.add(new JsrStepExecution(jobExplorer.getStepExecution(executionId, stepExecution.getId()))); } } } return batchExecutions; }
@Override public List<StepExecution> getStepExecutions(long executionId) throws NoSuchJobExecutionException, JobSecurityException { org.springframework.batch.core.JobExecution execution = jobExplorer.getJobExecution(executionId); if(execution == null) { throw new NoSuchJobException("JobExecution with the id " + executionId + " was not found"); } Collection<org.springframework.batch.core.StepExecution> executions = execution.getStepExecutions(); List<StepExecution> batchExecutions = new ArrayList<StepExecution>(); if(executions != null) { for (org.springframework.batch.core.StepExecution stepExecution : executions) { if(!stepExecution.getStepName().contains(":partition")) { batchExecutions.add(new JsrStepExecution(jobExplorer.getStepExecution(executionId, stepExecution.getId()))); } } } return batchExecutions; }
stepExecutions.add(new JsrStepExecution(curStepExecution)); stepExecutions.add(new JsrStepExecution(lastExecution));
stepExecutions.add(new JsrStepExecution(curStepExecution)); stepExecutions.add(new JsrStepExecution(lastExecution));
stepExecutions.add(new JsrStepExecution(curStepExecution)); stepExecutions.add(new JsrStepExecution(lastExecution));