Example usage for org.springframework.batch.core StepContribution StepContribution

List of usage examples for org.springframework.batch.core StepContribution StepContribution

Introduction

In this page you can find the example usage for org.springframework.batch.core StepContribution StepContribution.

Prototype

public StepContribution(StepExecution execution) 

Source Link

Usage

From source file:de.langmi.spring.batch.examples.complex.file.split.GetLineCountTaskletTest.java

@Test
public void testExecute() throws Exception {
    // setup/*w w  w  .  ja v a2  s  .co m*/
    tasklet = new GetLineCountTasklet();
    tasklet.setResource(new FileSystemResource(INPUT));
    StepExecution stepExecution = MetaDataInstanceFactory.createStepExecution();

    // execute
    RepeatStatus status = tasklet.execute(new StepContribution(stepExecution),
            new ChunkContext(new StepContext(stepExecution)));
    // assertions
    assertEquals(RepeatStatus.FINISHED, status);
    assertEquals(EXPECTED_COUNT, stepExecution.getExecutionContext().get("line.count"));
}