Package org.springframework.batch.core

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


    factory.setItemReader((ItemReader<? extends String>) advised);
    factory.setStreams(new ItemStream[] { (ItemStream) advised });

    Step step = factory.getObject();

    step.execute(stepExecution);

    assertTrue(opened);
    assertTrue(closed);
    assertEquals(BatchStatus.COMPLETED, stepExecution.getStatus());
  }
View Full Code Here


    Step step = factory.getObject();

    StepExecution stepExecution = new StepExecution(step.getName(),
        jobExecution);
    repository.add(stepExecution);
    step.execute(stepExecution);
    String message = stepExecution.getFailureExceptions().get(0)
        .getMessage();
    assertTrue("Wrong message: " + message,
        message.contains("Write error - planned but not skippable."));
View Full Code Here

    StepExecution stepExecution = jobExecution.createStepExecution(factory.getName());
    repository.add(stepExecution);

    Step step = factory.getObject();

    step.execute(stepExecution);
    assertEquals(BatchStatus.FAILED, stepExecution.getStatus());

    assertEquals("[]", writer.getCommitted().toString());
  }
View Full Code Here

        return RepeatStatus.FINISHED;
      }
    });

    Step step = factory.getObject();
    step.execute(new StepExecution(step.getName(), jobExecution));

    assertEquals(1, list.size());
  }

}
View Full Code Here

        Step step = factory.getObject();

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

        List<String> committed = new ArrayList<String>(writer.getWritten());
        Collections.sort(committed);
        assertEquals("[1, 2, 3, 4, 5]", committed.toString());
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(5, stepExecution.getSkipCount());
        List<String> processed = new ArrayList<String>(processor.getProcessed());
        Collections.sort(processed);
View Full Code Here

        Step step = factory.getObject();

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

        List<String> committed = new ArrayList<String>(writer.getCommitted());
        Collections.sort(committed);
        assertEquals("[1, 2, 3, 4, 5]", committed.toString());
View Full Code Here

    Step step = factory.getObject();

    StepExecution stepExecution = new StepExecution(step.getName(),
        jobExecution);
    repository.add(stepExecution);
    step.execute(stepExecution);
    /*
     * Each chunk tried up to RETRY_LIMIT, then the scan processes each item
     * once, identifying the skip as it goes
     */
    assertEquals((RETRY_LIMIT +1) * ITEM_LIST.size(), processed.size());
View Full Code Here

    Step step = factory.getObject();

    StepExecution stepExecution = new StepExecution(step.getName(),
        jobExecution);
    repository.add(stepExecution);
    step.execute(stepExecution);
    assertEquals(ExitStatus.COMPLETED.getExitCode(), stepExecution
        .getExitStatus().getExitCode());
    /*
     * Each chunk tried up to RETRY_LIMIT, then the scan processes each item
     * once, identifying the skip as it goes
View Full Code Here

    Step step = factory.getObject();

    StepExecution stepExecution = new StepExecution(step.getName(),
        jobExecution);
    repository.add(stepExecution);
    step.execute(stepExecution);
    assertEquals(3, processed.size()); // Initial try only, then cached
  }

  /**
   * N.B. this doesn't really test retry, since the retry is only on write
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.