Package org.springframework.batch.core.step

Examples of org.springframework.batch.core.step.StepSupport


  @Test
  public void test() throws Exception {
    FlowBuilder<Flow> builder = new FlowBuilder<Flow>("flow");
    JobRepository jobRepository = new MapJobRepositoryFactoryBean().getObject();
    JobExecution execution = jobRepository.createJobExecution("foo", new JobParameters());
    builder.start(new StepSupport("step") {
      @Override
      public void execute(StepExecution stepExecution) throws JobInterruptedException,
          UnexpectedJobExecutionException {
      }
    }).end().start(new JobFlowExecutor(jobRepository, new SimpleStepHandler(jobRepository), execution));
View Full Code Here


  @Test
  public void testStepFailure() throws Exception {
    SimpleFlow flow = new SimpleFlow("job");
    List<StateTransition> transitions = new ArrayList<StateTransition>();
    StepState step = new StepState(new StepSupport("step"));
    transitions.add(StateTransition.createStateTransition(step, ExitStatus.FAILED.getExitCode(), "end0"));
    transitions.add(StateTransition.createStateTransition(step, ExitStatus.COMPLETED.getExitCode(), "end1"));
    transitions.add(StateTransition.createEndStateTransition(new EndState(FlowExecutionStatus.FAILED, "end0")));
    transitions.add(StateTransition.createEndStateTransition(new EndState(FlowExecutionStatus.COMPLETED, "end1")));
    flow.setStateTransitions(transitions);
View Full Code Here

  @Test
  public void testStepStatusUnknown() throws Exception {
    SimpleFlow flow = new SimpleFlow("job");
    List<StateTransition> transitions = new ArrayList<StateTransition>();
    StepState step = new StepState(new StepSupport("step") {
      @Override
      public void execute(StepExecution stepExecution) throws JobInterruptedException,
          UnexpectedJobExecutionException {
        // This is what happens if the repository meta-data cannot be
        // updated
View Full Code Here

    stepSplitter = new JsrStepExecutionSplitter(repository, false, "step1", true);
    Analyzer.collectorData = "";
    Analyzer.status = "";
    count = 0;
    handler = new JsrPartitionHandler();
    handler.setStep(new StepSupport() {
      @Override
      public void execute(StepExecution stepExecution) throws JobInterruptedException {
        count++;
        stepExecution.setStatus(org.springframework.batch.core.BatchStatus.COMPLETED);
        stepExecution.setExitStatus(new ExitStatus("done"));
View Full Code Here

TOP

Related Classes of org.springframework.batch.core.step.StepSupport

Copyright © 2018 www.massapicom. 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.