@Test public void testInfiniteRetry() { int NUM_FAILURES = 20; @SuppressWarnings("unchecked") Observer<String> observer = mock(Observer.class); Observable<String> origin = Observable.create(new FuncWithErrors(NUM_FAILURES)); Observable.create(retry(origin)).subscribe(observer); InOrder inOrder = inOrder(observer); inOrder.verify(observer, times(1 + NUM_FAILURES)).onNext("beginningEveryTime"); inOrder.verify(observer, never()).onError(any(Throwable.class)); inOrder.verify(observer, times(1)).onNext("onSuccessOnly"); inOrder.verify(observer, times(1)).onCompleted(); inOrder.verifyNoMoreInteractions(); }
public static <T> OnSubscribeFunc<T> retry(final Observable<T> observable, final int retryCount) { return new Retry<T>(observable, retryCount); }
OperationRetry { public static <T> OnSubscribeFunc<T> retry(final Observable<T> observable, final int retryCount) { return new Retry<T>(observable, retryCount); } }
OperationRetry { public static <T> OnSubscribeFunc<T> retry(final Observable<T> observable, final int retryCount) { return new Retry<T>(observable, retryCount); }  }
OperationRetry { public static <T> OnSubscribeFunc<T> retry(final Observable<T> observable, final int retryCount) { return new Retry<T>(observable, retryCount); }  static OnSubscribeFunc<T> retry(final Observable<T> observable, final int retryCount); static OnSubscribeFunc<T> retry(final Observable<T> observable); }
OperationRetry { public static <T> OnSubscribeFunc<T> retry(final Observable<T> observable, final int retryCount) { return new Retry<T>(observable, retryCount); }  static OnSubscribeFunc<T> retry(final Observable<T> observable, final int retryCount); static OnSubscribeFunc<T> retry(final Observable<T> observable);  }