Package org.springframework.batch.core

Examples of org.springframework.batch.core.Step.execute()


    Step step = factory.getObject();

    StepExecution stepExecution = new StepExecution(step.getName(),
        jobExecution);
    repository.add(stepExecution);
    step.execute(stepExecution);

    assertEquals(0, stepExecution.getSkipCount());

    // [a, b with error]
    assertEquals(2, provided.size());
View Full Code Here


    fail = true;
    StepExecution stepExecution = new StepExecution(step.getName(),
        jobExecution);
    repository.add(stepExecution);
    step.execute(stepExecution);

    assertEquals(BatchStatus.FAILED, stepExecution.getStatus());
    assertEquals(4, stepExecution.getWriteCount());
    assertEquals(6, stepExecution.getReadCount());
View Full Code Here

    fail = false;
    ExecutionContext executionContext = stepExecution.getExecutionContext();
    stepExecution = new StepExecution(step.getName(), jobExecution);
    stepExecution.setExecutionContext(executionContext);
    repository.add(stepExecution);
    step.execute(stepExecution);

    assertEquals(BatchStatus.COMPLETED, stepExecution.getStatus());
    assertEquals(2, stepExecution.getWriteCount());
    assertEquals(2, stepExecution.getReadCount());
  }
View Full Code Here

    Step step = factory.getObject();

    StepExecution stepExecution = new StepExecution(step.getName(),
        jobExecution);
    repository.add(stepExecution);
    step.execute(stepExecution);

    assertEquals(2, stepExecution.getSkipCount());
    // b is processed once and skipped, plus 1, plus c, plus the null at end
    assertEquals(7, count);
    assertEquals(4, stepExecution.getReadCount());
View Full Code Here

    Step step = factory.getObject();

    StepExecution stepExecution = new StepExecution(step.getName(),
        jobExecution);
    repository.add(stepExecution);
    step.execute(stepExecution);
    assertEquals(BatchStatus.FAILED, stepExecution.getStatus());

    List<String> expectedOutput = Arrays.asList(StringUtils
        .commaDelimitedListToStringArray(""));
    assertEquals(expectedOutput, written);
View Full Code Here

    // But this one is explicit in the tx-attrs so it should be skipped
    factory.setNoRollbackExceptionClasses(getExceptionList(SkippableException.class));

    Step step = factory.getObject();

    step.execute(stepExecution);
    assertEquals(BatchStatus.COMPLETED, stepExecution.getStatus());
    assertEquals(0, stepExecution.getSkipCount());
    assertEquals(0, stepExecution.getRollbackCount());
  }
View Full Code Here

    processor.setFailures("1", "3");
    processor.setExceptionType(SkippableException.class);

    Step step = factory.getObject();

    step.execute(stepExecution);
    assertEquals(BatchStatus.COMPLETED, stepExecution.getStatus());
    assertEquals(2, stepExecution.getSkipCount());
    assertEquals(2, stepExecution.getRollbackCount());
  }
View Full Code Here

    processor.setFailures("1", "3");
    processor.setExceptionType(SkippableRuntimeException.class);

    Step step = factory.getObject();

    step.execute(stepExecution);
    assertEquals(BatchStatus.COMPLETED, stepExecution.getStatus());
    assertEquals(2, stepExecution.getSkipCount());
    assertEquals(2, stepExecution.getRollbackCount());
  }
View Full Code Here

    Step step = factory.getObject();

    stepExecution = jobExecution.createStepExecution(factory.getName());
    repository.add(stepExecution);
    step.execute(stepExecution);
    assertEquals(BatchStatus.COMPLETED, stepExecution.getStatus());

    assertEquals("[1, 3, 4, 5]", writer.getCommitted().toString());
    // No rollback on 2 so processor has side effect
    assertEquals("[1, 2, 3, 4, 5]", processor.getCommitted().toString());
View Full Code Here

    factory.setNoRollbackExceptionClasses(getExceptionList(SkippableException.class));

    Step step = factory.getObject();

    step.execute(stepExecution);

    assertEquals(BatchStatus.COMPLETED, stepExecution.getStatus());
    assertEquals(1, stepExecution.getSkipCount());
    assertEquals(0, stepExecution.getReadSkipCount());
    assertEquals(5, stepExecution.getReadCount());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.