use of io.reactivex.rxjava3.subjects.CompletableSubject in project RxJava by ReactiveX.
the class FlowableMergeWithCompletableTest method cancel.
@Test
public void cancel() {
final PublishProcessor<Integer> pp = PublishProcessor.create();
final CompletableSubject cs = CompletableSubject.create();
TestSubscriber<Integer> ts = pp.mergeWith(cs).test();
assertTrue(pp.hasSubscribers());
assertTrue(cs.hasObservers());
ts.cancel();
assertFalse(pp.hasSubscribers());
assertFalse(cs.hasObservers());
}
use of io.reactivex.rxjava3.subjects.CompletableSubject in project RxJava by ReactiveX.
the class FlowableMergeWithCompletableTest method cancelMainOnOtherError.
@Test
public void cancelMainOnOtherError() {
PublishProcessor<Integer> pp = PublishProcessor.create();
CompletableSubject cs = CompletableSubject.create();
TestSubscriber<Integer> ts = pp.mergeWith(cs).test();
assertTrue(pp.hasSubscribers());
assertTrue(cs.hasObservers());
cs.onError(new TestException());
ts.assertFailure(TestException.class);
assertFalse("main has observers!", pp.hasSubscribers());
assertFalse("other has observers", cs.hasObservers());
}
use of io.reactivex.rxjava3.subjects.CompletableSubject in project RxJava by ReactiveX.
the class FlowableMergeWithCompletableTest method cancelOtherOnMainError.
@Test
public void cancelOtherOnMainError() {
PublishProcessor<Integer> pp = PublishProcessor.create();
CompletableSubject cs = CompletableSubject.create();
TestSubscriber<Integer> ts = pp.mergeWith(cs).test();
assertTrue(pp.hasSubscribers());
assertTrue(cs.hasObservers());
pp.onError(new TestException());
ts.assertFailure(TestException.class);
assertFalse("main has observers!", pp.hasSubscribers());
assertFalse("other has observers", cs.hasObservers());
}
use of io.reactivex.rxjava3.subjects.CompletableSubject in project RxJava by ReactiveX.
the class ObservableMergeWithCompletableTest method cancelOtherOnMainError.
@Test
public void cancelOtherOnMainError() {
PublishSubject<Integer> ps = PublishSubject.create();
CompletableSubject cs = CompletableSubject.create();
TestObserver<Integer> to = ps.mergeWith(cs).test();
assertTrue(ps.hasObservers());
assertTrue(cs.hasObservers());
ps.onError(new TestException());
to.assertFailure(TestException.class);
assertFalse("main has observers!", ps.hasObservers());
assertFalse("other has observers", cs.hasObservers());
}
use of io.reactivex.rxjava3.subjects.CompletableSubject in project RxJava by ReactiveX.
the class ObservableMergeWithCompletableTest method cancelMainOnOtherError.
@Test
public void cancelMainOnOtherError() {
PublishSubject<Integer> ps = PublishSubject.create();
CompletableSubject cs = CompletableSubject.create();
TestObserver<Integer> to = ps.mergeWith(cs).test();
assertTrue(ps.hasObservers());
assertTrue(cs.hasObservers());
cs.onError(new TestException());
to.assertFailure(TestException.class);
assertFalse("main has observers!", ps.hasObservers());
assertFalse("other has observers", cs.hasObservers());
}
Aggregations