Examples of StepContribution


Examples of org.springframework.batch.core.StepContribution

    tasklet.setTimeout(200L);
    tasklet.afterPropertiesSet();

    log.info("Executing command: " + command);
    try {
      StepContribution contribution = stepExecution.createStepContribution();
      RepeatStatus exitStatus = tasklet.execute(contribution, null);
      assertEquals(RepeatStatus.FINISHED, exitStatus);
      assertEquals(ExitStatus.FAILED, contribution.getExitStatus());
    }
    catch (RuntimeException e) {
      // on some platforms the system call does not return
      assertEquals("Execution of system command did not finish within the timeout", e.getMessage());
    }
View Full Code Here

Examples of org.springframework.batch.core.StepContribution

          "sleep 5";
    tasklet.setCommand(command);
    tasklet.setTerminationCheckInterval(10);
    tasklet.afterPropertiesSet();

    StepContribution contribution = stepExecution.createStepContribution();
    //send stop
    tasklet.stop();
    tasklet.execute(contribution, null);

    assertEquals(contribution.getExitStatus().getExitCode(),ExitStatus.STOPPED.getExitCode());
  }
View Full Code Here

Examples of org.springframework.batch.core.StepContribution

  }

  @Test
  public void testExecuteWithExitStatus() throws Exception {
    tasklet.setTargetMethod("execute");
    StepContribution contribution = stepExecution.createStepContribution();
    tasklet.execute(contribution,null);
    assertEquals(ExitStatus.NOOP, contribution.getExitStatus());
  }
View Full Code Here

Examples of org.springframework.batch.core.StepContribution

  }

  @Test
  public void testMapResultWithNull() throws Exception {
    tasklet.setTargetMethod("process");
    StepContribution contribution = stepExecution.createStepContribution();
    tasklet.execute(contribution,null);
    assertEquals(ExitStatus.COMPLETED, contribution.getExitStatus());
  }
View Full Code Here

Examples of org.springframework.batch.core.StepContribution

  @Test
  public void testMapResultWithNonNull() throws Exception {
    tasklet.setTargetMethod("process");
    this.result = "foo";
    StepContribution contribution = stepExecution.createStepContribution();
    tasklet.execute(contribution,null);
    assertEquals(ExitStatus.COMPLETED, contribution.getExitStatus());
  }
View Full Code Here

Examples of org.springframework.batch.core.StepContribution

  }

  public Collection<StepContribution> getStepContributions() {
    List<StepContribution> contributions = new ArrayList<StepContribution>();
    for (ChunkResponse response : localState.pollChunkResponses()) {
      StepContribution contribution = response.getStepContribution();
      if (logger.isDebugEnabled()) {
        logger.debug("Applying: " + response);
      }
      contributions.add(contribution);
    }
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.