Package org.springframework.batch.item

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


  @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

    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

  @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

    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

      @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

  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

    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

    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

    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

Related Classes of org.springframework.batch.item.ItemStreamSupport

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.