Package org.springframework.batch.repeat.context

Examples of org.springframework.batch.repeat.context.RepeatContextSupport


  @Test
  public void testNotUseParent() throws Throwable {
    handler.setThresholds(Collections.<Class<? extends Throwable>, Integer> singletonMap(Exception.class, 1));
    // No exception...
    handler.handleException(context, new RuntimeException("Foo"));
    context = new RepeatContextSupport(parent);
    try {
      // No exception again - context is changed...
      handler.handleException(context, new RuntimeException("Foo"));
    }
    catch (RuntimeException e) {
View Full Code Here


  public void testUseParent() throws Throwable {
    handler.setThresholds(Collections.<Class<? extends Throwable>, Integer> singletonMap(Exception.class, 1));
    handler.setUseParent(true);
    // No exception...
    handler.handleException(context, new RuntimeException("Foo"));
    context = new RepeatContextSupport(parent);
    try {
      handler.handleException(context, new RuntimeException("Foo"));
      fail("Expected Error");
    }
    catch (RuntimeException e) {
View Full Code Here

   *
   * @see org.springframework.batch.repeat.CompletionPolicy#start(RepeatContext)
   */
    @Override
  public RepeatContext start(RepeatContext context) {
    return new RepeatContextSupport(context);
  }
View Full Code Here

        count = 0;
        return super.start(context);
      }
    };
    policy.setMaxCount(2);
    RepeatContextSupport session = new RepeatContextSupport(null);
    RepeatContext context = policy.start(session);
    policy.update(context);
    assertFalse(policy.isComplete(context));
    context = policy.start(session);
    policy.update(context);
View Full Code Here

        return super.start(context);
      }
    };
    policy.setMaxCount(2);
    policy.setUseParent(true);
    RepeatContextSupport session = new RepeatContextSupport(null);
    RepeatContext context = policy.start(session);
    policy.update(context);
    assertFalse(policy.isComplete(context));
    context = policy.start(session);
    policy.update(context);
View Full Code Here

    assertTrue(RepeatSynchronizationManager.getContext().isCompleteOnly());
  }

  public void testSetSessionCompleteOnlyWithParent() {
    assertNull(RepeatSynchronizationManager.getContext());
    RepeatContext child = new RepeatContextSupport(context);
    RepeatSynchronizationManager.register(child);
    assertFalse(child.isCompleteOnly());
    RepeatSynchronizationManager.setAncestorsCompleteOnly();
    assertTrue(child.isCompleteOnly());
    assertTrue(context.isCompleteOnly());
  }
View Full Code Here

TOP

Related Classes of org.springframework.batch.repeat.context.RepeatContextSupport

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.