List of usage examples for org.springframework.batch.core JobExecution createStepExecution
public StepExecution createStepExecution(String stepName)
From source file:org.springframework.batch.core.step.tasklet.AsyncTaskletStepTests.java
/** * StepExecution should fail immediately on error. *///from www . j ava2s .c o m @Test public void testStepExecutionFailsOnLastItem() throws Exception { throttleLimit = 1; concurrencyLimit = 1; items = Arrays.asList("one", "two", "three", "fail"); setUp(); JobExecution jobExecution = jobRepository.createJobExecution("JOB", new JobParameters()); StepExecution stepExecution = jobExecution.createStepExecution(step.getName()); step.execute(stepExecution); assertEquals(BatchStatus.FAILED, stepExecution.getStatus()); assertEquals(4, stepExecution.getReadCount()); assertEquals(4, processed.size()); }