use of io.reactivex.rxjava3.observers.TestObserver in project RxJava by ReactiveX.
the class MaybeTimeoutTest method otherError.
@Test
public void otherError() {
PublishProcessor<Integer> pp1 = PublishProcessor.create();
PublishProcessor<Integer> pp2 = PublishProcessor.create();
TestObserver<Integer> to = pp1.singleElement().timeout(pp2.singleElement()).test();
assertTrue(pp1.hasSubscribers());
assertTrue(pp2.hasSubscribers());
pp2.onError(new TestException());
assertFalse(pp1.hasSubscribers());
assertFalse(pp2.hasSubscribers());
to.assertFailure(TestException.class);
}
use of io.reactivex.rxjava3.observers.TestObserver in project RxJava by ReactiveX.
the class SingleFlatMapObservableTest method errorOther.
@Test
public void errorOther() {
SingleSubject<Integer> ss = SingleSubject.create();
PublishSubject<Integer> ps = PublishSubject.create();
TestObserver<Integer> to = ss.flatMapObservable(Functions.justFunction(ps)).test();
assertTrue(ss.hasObservers());
assertFalse(ps.hasObservers());
ss.onSuccess(1);
assertFalse(ss.hasObservers());
assertTrue(ps.hasObservers());
ps.onError(new TestException());
assertFalse(ss.hasObservers());
assertFalse(ps.hasObservers());
to.assertFailure(TestException.class);
}
use of io.reactivex.rxjava3.observers.TestObserver in project RxJava by ReactiveX.
the class MaybeZipArrayTest method middleError.
@Test
public void middleError() {
PublishProcessor<Integer> pp0 = PublishProcessor.create();
PublishProcessor<Integer> pp1 = PublishProcessor.create();
TestObserver<Object> to = Maybe.zip(pp0.singleElement(), pp1.singleElement(), pp0.singleElement(), addString3).test();
pp1.onError(new TestException());
assertFalse(pp0.hasSubscribers());
to.assertFailure(TestException.class);
}
use of io.reactivex.rxjava3.observers.TestObserver in project RxJava by ReactiveX.
the class CompletableAndThenObservableTest method errorMain.
@Test
public void errorMain() {
CompletableSubject cs = CompletableSubject.create();
PublishSubject<Integer> ps = PublishSubject.create();
TestObserver<Integer> to = cs.andThen(ps).test();
assertTrue(cs.hasObservers());
assertFalse(ps.hasObservers());
cs.onError(new TestException());
assertFalse(cs.hasObservers());
assertFalse(ps.hasObservers());
to.assertFailure(TestException.class);
}
use of io.reactivex.rxjava3.observers.TestObserver in project RxJava by ReactiveX.
the class CompletableAndThenObservableTest method errorOther.
@Test
public void errorOther() {
CompletableSubject cs = CompletableSubject.create();
PublishSubject<Integer> ps = PublishSubject.create();
TestObserver<Integer> to = cs.andThen(ps).test();
assertTrue(cs.hasObservers());
assertFalse(ps.hasObservers());
cs.onComplete();
assertFalse(cs.hasObservers());
assertTrue(ps.hasObservers());
ps.onError(new TestException());
assertFalse(cs.hasObservers());
assertFalse(ps.hasObservers());
to.assertFailure(TestException.class);
}
Aggregations