Examples of ItemStreamSupport


Examples of org.springframework.batch.item.ItemStreamSupport

  }

  @Test
  public void testOpenFailure() throws Exception {
    final RuntimeException exception = new RuntimeException();
    taskletStep.setStreams(new ItemStream[] { new ItemStreamSupport() {
      @Override
      public void open(ExecutionContext executionContext) throws ItemStreamException {
        throw exception;
      }
    } });
View Full Code Here

Examples of org.springframework.batch.item.ItemStreamSupport

  @Test
  public void testCloseError() throws Exception {

    final RuntimeException exception = new RuntimeException();
    taskletStep.setStreams(new ItemStream[] { new ItemStreamSupport() {
      @Override
      public void close() throws ItemStreamException {
        super.close();
        throw exception;
      }
View Full Code Here

Examples of org.springframework.batch.item.ItemStreamSupport

    assertEquals("bar", stepExecution.getExecutionContext().getString("foo"));
  }

  @Test
  public void testDirectlyInjectedItemStream() throws Exception {
    step.setStreams(new ItemStream[] { new ItemStreamSupport() {
      @Override
      public void update(ExecutionContext executionContext) {
                                super.update(executionContext);
        executionContext.putString("foo", "bar");
      }
View Full Code Here

Examples of org.springframework.batch.item.ItemStreamSupport

  @Test
  public void testStatusForFinalUpdateFailedException() throws Exception {

    step.setJobRepository(new JobRepositorySupport());
    step.setStreams(new ItemStream[] { new ItemStreamSupport() {
      @Override
      public void close() throws ItemStreamException {
                                super.close();
        throw new RuntimeException("Bar");
      }
View Full Code Here

Examples of org.springframework.batch.item.ItemStreamSupport

    SimpleAsyncTaskExecutor taskExecutor = new SimpleAsyncTaskExecutor();
    taskExecutor.setConcurrencyLimit(concurrencyLimit);
    template.setTaskExecutor(taskExecutor);
    step.setStepOperations(template);

    step.registerStream(new ItemStreamSupport() {
      private int count = 0;

      @Override
      public void update(ExecutionContext executionContext) {
                                super.update(executionContext);
View Full Code Here

Examples of org.springframework.batch.item.ItemStreamSupport

      @Override
      public String read() throws Exception, UnexpectedInputException, ParseException {
        return "" + (count++);
      }
    });
    monitor.registerItemStream(new ItemStreamSupport() {
      @Override
      public void close() {
        super.close();
        closed = true;
      }
View Full Code Here

Examples of org.springframework.batch.item.ItemStreamSupport

  private CompositeItemStream manager = new CompositeItemStream();

  private List<String> list = new ArrayList<String>();

  public void testRegisterAndOpen() {
    ItemStreamSupport stream = new ItemStreamSupport() {
                    @Override
      public void open(ExecutionContext executionContext) {
                                super.open(executionContext);
        list.add("bar");
      }
View Full Code Here

Examples of org.springframework.batch.item.ItemStreamSupport

    manager.open(null);
    assertEquals(1, list.size());
  }

  public void testRegisterTwice() {
    ItemStreamSupport stream = new ItemStreamSupport() {
            @Override
      public void open(ExecutionContext executionContext) {
                                super.open(executionContext);
        list.add("bar");
      }
View Full Code Here

Examples of org.springframework.batch.item.ItemStreamSupport

    manager.open(null);
    assertEquals(1, list.size());
  }

  public void testMark() {
    manager.register(new ItemStreamSupport() {
                    @Override
      public void update(ExecutionContext executionContext) {
                                super.update(executionContext);
        list.add("bar");
      }
View Full Code Here

Examples of org.springframework.batch.item.ItemStreamSupport

    manager.update(null);
    assertEquals(1, list.size());
  }

  public void testClose() {
    manager.register(new ItemStreamSupport() {
                    @Override
      public void close() {
                                super.close();
        list.add("bar");
      }
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.