use of io.reactivex.rxjava3.observers in project RxJava by ReactiveX.
the class NotificationLiteTest method errorNotification.
@Test
public void errorNotification() {
Object o = NotificationLite.error(new TestException());
assertEquals("NotificationLite.Error[io.reactivex.rxjava3.exceptions.TestException]", o.toString());
assertTrue(NotificationLite.isError(o));
assertFalse(NotificationLite.isComplete(o));
assertFalse(NotificationLite.isDisposable(o));
assertFalse(NotificationLite.isSubscription(o));
assertTrue(NotificationLite.getError(o) instanceof TestException);
}
use of io.reactivex.rxjava3.observers in project RxJava by ReactiveX.
the class SingleTakeUntilTest method untilSingleMainError.
@Test
public void untilSingleMainError() {
SingleSubject<Integer> main = SingleSubject.create();
SingleSubject<Integer> other = SingleSubject.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 untilSingleOtherError.
@Test
public void untilSingleOtherError() {
SingleSubject<Integer> main = SingleSubject.create();
SingleSubject<Integer> other = SingleSubject.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 SingleTakeUntilTest method untilPublisherOtherError.
@Test
public void untilPublisherOtherError() {
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());
other.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 FlowableMergeWithMaybeTest method cancelMainOnOtherError.
@Test
public void cancelMainOnOtherError() {
PublishProcessor<Integer> pp = PublishProcessor.create();
MaybeSubject<Integer> ms = MaybeSubject.create();
TestSubscriber<Integer> ts = pp.mergeWith(ms).test();
assertTrue(pp.hasSubscribers());
assertTrue(ms.hasObservers());
ms.onError(new TestException());
ts.assertFailure(TestException.class);
assertFalse("main has observers!", pp.hasSubscribers());
assertFalse("other has observers", ms.hasObservers());
}
Aggregations