@Test(expected = Exception.class) public void testRetryResult() throws Exception { RetryExecutor<String> retryExecutor = new RetryExecutor<>(attempts, 3, new ArrayList<>()); String result = retryExecutor.retryResult(this::noResult); Assert.fail("The executor should throw exception"); }
public T retryResult(Callable<T> callable) throws Exception { try { retryAttempts--; return callable.call(); } catch (Exception e) { if (retryOnException(e) && retryAttempts > 0) { sleep(timeout); return retryResult(callable); } throw e; } }
RetryExecutor { public T retryResult(Callable<T> callable) throws Exception { try { retryAttempts--; return callable.call(); } catch (Exception e) { if (retryOnException(e) && retryAttempts > 0) { sleep(timeout); return retryResult(callable); } throw e; } } }
RetryExecutor { public T retryResult(Callable<T> callable) throws Exception { try { retryAttempts--; return callable.call(); } catch (Exception e) { if (retryOnException(e) && retryAttempts > 0) { sleep(timeout); return retryResult(callable); } throw e; } } RetryExecutor();  RetryExecutor(int retryAttempts, long timeout, List<Class> exceptions); }
RetryExecutor { public T retryResult(Callable<T> callable) throws Exception { try { retryAttempts--; return callable.call(); } catch (Exception e) { if (retryOnException(e) && retryAttempts > 0) { sleep(timeout); return retryResult(callable); } throw e; } } RetryExecutor();  RetryExecutor(int retryAttempts, long timeout, List<Class> exceptions); T retryResult(Callable<T> callable); void retry(Runnable action); void retryChecked(CheckedRunnable action); void retrySilent(Runnable action); }
RetryExecutor { public T retryResult(Callable<T> callable) throws Exception { try { retryAttempts--; return callable.call(); } catch (Exception e) { if (retryOnException(e) && retryAttempts > 0) { sleep(timeout); return retryResult(callable); } throw e; } } RetryExecutor();  RetryExecutor(int retryAttempts, long timeout, List<Class> exceptions); T retryResult(Callable<T> callable); void retry(Runnable action); void retryChecked(CheckedRunnable action); void retrySilent(Runnable action);  }