@Test public void testRetryStrategyConstantExceedLimit() throws InterruptedException { RetryStrategy retry = new RetryStrategy(3, 1, RetryStrategy.BackoffStrategy.CONSTANT_BACKOFF); trouble = 0; try { while (true) { try { troubleMaker(5); break; } catch (RuntimeException e) { retry.onFailure(e); } } Assert.assertFalse(true); } catch (RetryExceedLimitException err) { Assert.assertTrue(err.getMessage().indexOf("After 4 failed attemps") != -1); Assert.assertTrue(err.getCause().getMessage().indexOf("I have trouble!!! ") != -1); Assert.assertTrue(err.getCause().getCause().getMessage().indexOf("cauze I am cool") != -1); Assert.assertEquals(4, trouble); } }
public void onFailure(Exception err) throws RetryExceedLimitException, InterruptedException { onFailure(err, null); }
RetryStrategy { public void onFailure(Exception err) throws RetryExceedLimitException, InterruptedException { onFailure(err, null); } }
RetryStrategy { public void onFailure(Exception err) throws RetryExceedLimitException, InterruptedException { onFailure(err, null); } RetryStrategy(int limit, BackOffStrategy strategy);  RetryStrategy(int limit, int interval, BackoffStrategy strategy);  RetryStrategy(int attempts, int interval);  RetryStrategy(int attempts);  RetryStrategy(); }
RetryStrategy { public void onFailure(Exception err) throws RetryExceedLimitException, InterruptedException { onFailure(err, null); } RetryStrategy(int limit, BackOffStrategy strategy);  RetryStrategy(int limit, int interval, BackoffStrategy strategy);  RetryStrategy(int attempts, int interval);  RetryStrategy(int attempts);  RetryStrategy(); void reset(); void onFailure(Exception err); void onFailure(Exception err, RetryLogger logger); int getAttempts(); int getTotalBackupTime(); }
RetryStrategy { public void onFailure(Exception err) throws RetryExceedLimitException, InterruptedException { onFailure(err, null); } RetryStrategy(int limit, BackOffStrategy strategy);  RetryStrategy(int limit, int interval, BackoffStrategy strategy);  RetryStrategy(int attempts, int interval);  RetryStrategy(int attempts);  RetryStrategy(); void reset(); void onFailure(Exception err); void onFailure(Exception err, RetryLogger logger); int getAttempts(); int getTotalBackupTime();  }