Examples of JobParameter


Examples of org.springframework.batch.core.JobParameter

  }

  @Test
  public void testFailedStepOnError() throws Exception {
    JobExecution jobExecution = jobLauncher.run(job, new JobParameters(Collections.singletonMap("item.three",
        new JobParameter("error"))));
    assertEquals(BatchStatus.FAILED, jobExecution.getStatus());
    StepExecution stepExecution = jobExecution.getStepExecutions().iterator().next();
    assertEquals(9, stepExecution.getReadCount());
    // In principle the write count could be more than 2 and less than 9...
    assertEquals(7, stepExecution.getWriteCount());
View Full Code Here

Examples of org.springframework.batch.core.JobParameter

  }

  @Test
  public void testSunnyDayFaultTolerant() throws Exception {
    JobExecution jobExecution = jobLauncher.run(job, new JobParameters(Collections.singletonMap("item.three",
        new JobParameter("3"))));
    assertEquals(BatchStatus.COMPLETED, jobExecution.getStatus());
    StepExecution stepExecution = jobExecution.getStepExecutions().iterator().next();
    assertEquals(9, stepExecution.getReadCount());
    assertEquals(9, stepExecution.getWriteCount());
  }
View Full Code Here

Examples of org.springframework.batch.core.JobParameter

  private Job job;

  @Test
  public void testSunnyDaySimpleStep() throws Exception {
    JobExecution jobExecution = jobLauncher.run(job, new JobParameters(Collections.singletonMap("item.three",
        new JobParameter("3"))));
    assertEquals(BatchStatus.COMPLETED, jobExecution.getStatus());
    StepExecution stepExecution = jobExecution.getStepExecutions().iterator().next();
    assertEquals(9, stepExecution.getReadCount());
    assertEquals(9, stepExecution.getWriteCount());
  }
View Full Code Here

Examples of org.springframework.batch.core.JobParameter

  }

  @Test
  public void testFailedStep() throws Exception {
    JobExecution jobExecution = jobLauncher.run(job, new JobParameters(Collections.singletonMap("item.three",
        new JobParameter("fail"))));
    assertEquals(BatchStatus.FAILED, jobExecution.getStatus());
    StepExecution stepExecution = jobExecution.getStepExecutions().iterator().next();
    assertEquals(9, stepExecution.getReadCount());
    // In principle the write count could be more than 2 and less than 9...
    assertEquals(7, stepExecution.getWriteCount());
View Full Code Here

Examples of org.springframework.batch.core.JobParameter

  private Job job;

  @Test
  public void testFailedStep() throws Exception {
    JobExecution jobExecution = jobLauncher.run(job, new JobParameters(Collections.singletonMap("item.three",
        new JobParameter("unsupported"))));
    assertEquals(BatchStatus.FAILED, jobExecution.getStatus());
    StepExecution stepExecution = jobExecution.getStepExecutions().iterator().next();
    assertEquals(9, stepExecution.getReadCount());
    // In principle the write count could be more than 2 and less than 9...
    assertEquals(7, stepExecution.getWriteCount());
View Full Code Here

Examples of org.springframework.batch.core.JobParameter

  }

  @Test
  public void testFailedStepOnError() throws Exception {
    JobExecution jobExecution = jobLauncher.run(job, new JobParameters(Collections.singletonMap("item.three",
        new JobParameter("error"))));
    assertEquals(BatchStatus.FAILED, jobExecution.getStatus());
    StepExecution stepExecution = jobExecution.getStepExecutions().iterator().next();
    assertEquals(9, stepExecution.getReadCount());
    // In principle the write count could be more than 2 and less than 9...
    assertEquals(7, stepExecution.getWriteCount());
View Full Code Here

Examples of org.springframework.batch.core.JobParameter

  }

  @Test
  public void testSunnyDayFaultTolerant() throws Exception {
    JobExecution jobExecution = jobLauncher.run(job, new JobParameters(Collections.singletonMap("item.three",
        new JobParameter("3"))));
    assertEquals(BatchStatus.COMPLETED, jobExecution.getStatus());
    StepExecution stepExecution = jobExecution.getStepExecutions().iterator().next();
    assertEquals(9, stepExecution.getReadCount());
    assertEquals(9, stepExecution.getWriteCount());
  }
View Full Code Here

Examples of org.springframework.batch.core.JobParameter

   */
  private void insertJobParameters(Long executionId, JobParameters jobParameters) {

    for (Entry<String, JobParameter> entry : jobParameters.getParameters()
        .entrySet()) {
      JobParameter jobParameter = entry.getValue();
      insertParameter(executionId, jobParameter.getType(), entry.getKey(),
          jobParameter.getValue(), jobParameter.isIdentifying());
    }
  }
View Full Code Here

Examples of org.springframework.batch.core.JobParameter

    Map<String, JobParameter> parameters = params.getParameters();
    Properties result = new Properties();
    for (Entry<String, JobParameter> entry : parameters.entrySet()) {

      String key = entry.getKey();
      JobParameter jobParameter = entry.getValue();
      Object value = jobParameter.getValue();
      if (value != null) {
        key = (!jobParameter.isIdentifying()? NON_IDENTIFYING_FLAG : "") + key;
        if (jobParameter.getType() == ParameterType.DATE) {
          synchronized (dateFormat) {
            result.setProperty(key + DATE_TYPE, dateFormat.format(value));
          }
        }
        else if (jobParameter.getType() == ParameterType.LONG) {
          synchronized (longNumberFormat) {
            result.setProperty(key + LONG_TYPE, longNumberFormat.format(value));
          }
        }
        else if (jobParameter.getType() == ParameterType.DOUBLE) {
          result.setProperty(key + DOUBLE_TYPE, decimalFormat((Double)value));
        }
        else {
          result.setProperty(key, "" + value);
        }
View Full Code Here

Examples of org.springframework.batch.core.JobParameter

  @Test
  @DirtiesContext
  public void testFailedStep() throws Exception {
    JobExecution jobExecution = jobLauncher.run(job, new JobParameters(Collections.singletonMap("item.three",
        new JobParameter("unsupported"))));
    assertEquals(BatchStatus.FAILED, jobExecution.getStatus());
    StepExecution stepExecution = jobExecution.getStepExecutions().iterator().next();
    assertEquals(9, stepExecution.getReadCount());
    // In principle the write count could be more than 2 and less than 9...
    assertEquals(7, stepExecution.getWriteCount());
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.