Package org.springframework.retry.policy

Examples of org.springframework.retry.policy.AlwaysRetryPolicy


   * Test method for
   * {@link org.springframework.batch.core.step.item.SimpleRetryExceptionHandler#handleException(org.springframework.batch.repeat.RepeatContext, java.lang.Throwable)} .
   */
  public void testNoRethrowWhenRetryNotExhausted() throws Throwable {

    RetryPolicy retryPolicy = new AlwaysRetryPolicy();
    RuntimeException ex = new RuntimeException("foo");

    SimpleRetryExceptionHandler handler = getHandlerAfterRetry(retryPolicy, ex, Collections
        .<Class<? extends Throwable>> singleton(Error.class));

View Full Code Here


   * Test method for
   * {@link org.springframework.batch.core.step.item.SimpleRetryExceptionHandler#handleException(org.springframework.batch.repeat.RepeatContext, java.lang.Throwable)} .
   */
  public void testRethrowWhenFatal() throws Throwable {

    RetryPolicy retryPolicy = new AlwaysRetryPolicy();
    RuntimeException ex = new RuntimeException("foo");

    SimpleRetryExceptionHandler handler = getHandlerAfterRetry(retryPolicy, ex, Collections
        .<Class<? extends Throwable>> singleton(RuntimeException.class));

View Full Code Here

    assertEquals(1, count);
  }

  @Test
  public void testDefaultInterceptorAlwaysRetry() throws Exception {
    retryTemplate.setRetryPolicy(new AlwaysRetryPolicy());
    interceptor.setRetryOperations(retryTemplate);
    ((Advised) service).addAdvice(interceptor);
    try {
      service.service("foo");
      fail("Expected Exception.");
View Full Code Here

TOP

Related Classes of org.springframework.retry.policy.AlwaysRetryPolicy

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.