use of io.reactivex.rxjava3.observers in project RxJava by ReactiveX.
the class SingleTakeUntilTest method untilPublisherMainError.
@Test
public void untilPublisherMainError() {
SingleSubject<Integer> main = SingleSubject.create();
PublishProcessor<Integer> other = PublishProcessor.create();
TestObserver<Integer> to = main.takeUntil(other).test();
assertTrue("Main no observers?", main.hasObservers());
assertTrue("Other no observers?", other.hasSubscribers());
main.onError(new TestException());
assertFalse("Main has observers?", main.hasObservers());
assertFalse("Other has observers?", other.hasSubscribers());
to.assertFailure(TestException.class);
}
use of io.reactivex.rxjava3.observers in project RxJava by ReactiveX.
the class SingleTakeUntilTest method untilCompletableMainError.
@Test
public void untilCompletableMainError() {
SingleSubject<Integer> main = SingleSubject.create();
CompletableSubject other = CompletableSubject.create();
TestObserver<Integer> to = main.takeUntil(other).test();
assertTrue("Main no observers?", main.hasObservers());
assertTrue("Other no observers?", other.hasObservers());
main.onError(new TestException());
assertFalse("Main has observers?", main.hasObservers());
assertFalse("Other has observers?", other.hasObservers());
to.assertFailure(TestException.class);
}
use of io.reactivex.rxjava3.observers in project RxJava by ReactiveX.
the class SingleTakeUntilTest method untilCompletableOtherError.
@Test
public void untilCompletableOtherError() {
SingleSubject<Integer> main = SingleSubject.create();
CompletableSubject other = CompletableSubject.create();
TestObserver<Integer> to = main.takeUntil(other).test();
assertTrue("Main no observers?", main.hasObservers());
assertTrue("Other no observers?", other.hasObservers());
other.onError(new TestException());
assertFalse("Main has observers?", main.hasObservers());
assertFalse("Other has observers?", other.hasObservers());
to.assertFailure(TestException.class);
}
use of io.reactivex.rxjava3.observers in project RxJava by ReactiveX.
the class FlowableMergeWithSingleTest method cancelOtherOnMainError.
@Test
public void cancelOtherOnMainError() {
PublishProcessor<Integer> pp = PublishProcessor.create();
SingleSubject<Integer> ss = SingleSubject.create();
TestSubscriber<Integer> ts = pp.mergeWith(ss).test();
assertTrue(pp.hasSubscribers());
assertTrue(ss.hasObservers());
pp.onError(new TestException());
ts.assertFailure(TestException.class);
assertFalse("main has observers!", pp.hasSubscribers());
assertFalse("other has observers", ss.hasObservers());
}
use of io.reactivex.rxjava3.observers in project RxJava by ReactiveX.
the class FlowableMergeWithSingleTest method cancelMainOnOtherError.
@Test
public void cancelMainOnOtherError() {
PublishProcessor<Integer> pp = PublishProcessor.create();
SingleSubject<Integer> ss = SingleSubject.create();
TestSubscriber<Integer> ts = pp.mergeWith(ss).test();
assertTrue(pp.hasSubscribers());
assertTrue(ss.hasObservers());
ss.onError(new TestException());
ts.assertFailure(TestException.class);
assertFalse("main has observers!", pp.hasSubscribers());
assertFalse("other has observers", ss.hasObservers());
}
Aggregations