@Test public void testMapResumeAsyncNext() { Subscription sr = mock(Subscription.class); Observable<String> w = Observable.from("one", "fail", "two", "three", "fail"); TestObservable f = new TestObservable(sr, "twoResume", "threeResume"); Observable<String> resume = Observable.create(f); w = w.map(new Func1<String, String>() { public String call(String s) { if ("fail".equals(s)) throw new RuntimeException("Forced Failure"); System.out.println("BadMapper:" + s); return s; } }); Observable<String> observable = Observable.create(onExceptionResumeNextViaObservable(w, resume)); @SuppressWarnings("unchecked") Observer<String> observer = mock(Observer.class); observable.subscribe(observer); try { if (f.t != null) { f.t.join(); } } catch (InterruptedException e) { fail(e.getMessage()); } verify(observer, times(1)).onNext("one"); verify(observer, never()).onNext("two"); verify(observer, never()).onNext("three"); verify(observer, times(1)).onNext("twoResume"); verify(observer, times(1)).onNext("threeResume"); verify(observer, Mockito.never()).onError(any(Throwable.class)); verify(observer, times(1)).onCompleted(); }
public static <T> OnSubscribeFunc<T> onExceptionResumeNextViaObservable(Observable<? extends T> originalSequence, Observable<? extends T> resumeSequence) { return new OnExceptionResumeNextViaObservable<T>(originalSequence, resumeSequence); }
OperationOnExceptionResumeNextViaObservable { public static <T> OnSubscribeFunc<T> onExceptionResumeNextViaObservable(Observable<? extends T> originalSequence, Observable<? extends T> resumeSequence) { return new OnExceptionResumeNextViaObservable<T>(originalSequence, resumeSequence); } }
OperationOnExceptionResumeNextViaObservable { public static <T> OnSubscribeFunc<T> onExceptionResumeNextViaObservable(Observable<? extends T> originalSequence, Observable<? extends T> resumeSequence) { return new OnExceptionResumeNextViaObservable<T>(originalSequence, resumeSequence); }  }
OperationOnExceptionResumeNextViaObservable { public static <T> OnSubscribeFunc<T> onExceptionResumeNextViaObservable(Observable<? extends T> originalSequence, Observable<? extends T> resumeSequence) { return new OnExceptionResumeNextViaObservable<T>(originalSequence, resumeSequence); }  static OnSubscribeFunc<T> onExceptionResumeNextViaObservable(Observable<? extends T> originalSequence, Observable<? extends T> resumeSequence); }
OperationOnExceptionResumeNextViaObservable { public static <T> OnSubscribeFunc<T> onExceptionResumeNextViaObservable(Observable<? extends T> originalSequence, Observable<? extends T> resumeSequence) { return new OnExceptionResumeNextViaObservable<T>(originalSequence, resumeSequence); }  static OnSubscribeFunc<T> onExceptionResumeNextViaObservable(Observable<? extends T> originalSequence, Observable<? extends T> resumeSequence);  }