Examples of RepeatContextSupport


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

      add("f");
    }}));

    itemReader.setThrowExceptionOnRecordNumber(ITER_COUNT + 1);
   
    RepeatSynchronizationManager.register(new RepeatContextSupport(null));
   
    //call process method multiple times and verify whether exception is thrown when expected
    for (int i = 0; i <= ITER_COUNT; i++) {
      try {
        itemReader.read();
View Full Code Here

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

  @Test
  public void testContextClosedOnNormalCompletion() throws Exception {

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

    final RepeatContext context = new RepeatContextSupport(null) {
            @Override
      public void close() {
        super.close();
        list.add("close");
      }
View Full Code Here

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

  @Test
  public void testContextClosedOnAbnormalCompletion() throws Exception {

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

    final RepeatContext context = new RepeatContextSupport(null) {
            @Override
      public void close() {
        super.close();
        list.add("close");
      }
View Full Code Here

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

  @Test
  public void testDefaultBehaviour() throws Throwable {
    Throwable throwable = new RuntimeException("foo");
    try {
      handler.handleException(new RepeatContextSupport(null), throwable);
      fail("Exception was swallowed.");
    }
    catch (RuntimeException expected) {
      assertTrue("Exception is rethrown, ignoring the exception limit", true);
      assertSame(expected, throwable);
View Full Code Here

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

    handler.setLimit(MORE_THAN_ZERO);
    handler.setExceptionClasses(Collections.<Class<? extends Throwable>> singleton(IllegalArgumentException.class));
    handler.afterPropertiesSet();

    try {
      handler.handleException(new RepeatContextSupport(null), throwable);
      fail("Exception was swallowed.");
    }
    catch (RuntimeException expected) {
      assertTrue("Exception is rethrown, ignoring the exception limit", true);
      assertSame(expected, throwable);
View Full Code Here

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

    handler.setLimit(MORE_THAN_ZERO);
    handler.setExceptionClasses(Collections.<Class<? extends Throwable>> singleton(RuntimeException.class));
    handler.afterPropertiesSet();

    try {
      handler.handleException(new RepeatContextSupport(null), new RuntimeException("foo"));
    }
    catch (RuntimeException expected) {
      fail("Unexpected exception.");
    }
  }
View Full Code Here

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

    final int MORE_THAN_ZERO = 1;
    handler.setLimit(MORE_THAN_ZERO);
    handler.setExceptionClasses(Collections.<Class<? extends Throwable>> singleton(RuntimeException.class));
    handler.afterPropertiesSet();

    RepeatContextSupport parent = new RepeatContextSupport(null);

    try {
      RepeatContextSupport context = new RepeatContextSupport(parent);
      handler.handleException(context, throwable);
      context = new RepeatContextSupport(parent);
      handler.handleException(context, throwable);
    }
    catch (RuntimeException expected) {
      fail("Unexpected exception.");
    }
View Full Code Here

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

    handler.setLimit(MORE_THAN_ZERO);
    handler.setExceptionClasses(Collections.<Class<? extends Throwable>> singleton(RuntimeException.class));
    handler.setUseParent(true);
    handler.afterPropertiesSet();

    RepeatContextSupport parent = new RepeatContextSupport(null);

    try {
      RepeatContextSupport context = new RepeatContextSupport(parent);
      handler.handleException(context, throwable);
      context = new RepeatContextSupport(parent);
      handler.handleException(context, throwable);
      fail("Expected exception.");
    }
    catch (RuntimeException expected) {
      assertSame(throwable, expected);
View Full Code Here

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

          add(new RuntimeException("below exception limit"));
        }
      }
    };

    RepeatContextSupport context = new RepeatContextSupport(null);

    try {
      for (Throwable throwable : throwables) {

        handler.handleException(context, throwable);
View Full Code Here

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

      }
    };

    throwables.add(new RuntimeException("above exception limit"));

    RepeatContextSupport context = new RepeatContextSupport(null);

    try {
      for (Throwable throwable : throwables) {

        handler.handleException(context, throwable);
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.