Search in sources :

Example 26 with io.reactivex.rxjava3.observers

use of io.reactivex.rxjava3.observers 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());
}
Also used : TestException(io.reactivex.rxjava3.exceptions.TestException) CompletableSubject(io.reactivex.rxjava3.subjects.CompletableSubject) Test(org.junit.Test)

Example 27 with io.reactivex.rxjava3.observers

use of io.reactivex.rxjava3.observers 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());
}
Also used : TestException(io.reactivex.rxjava3.exceptions.TestException) CompletableSubject(io.reactivex.rxjava3.subjects.CompletableSubject) Test(org.junit.Test)

Example 28 with io.reactivex.rxjava3.observers

use of io.reactivex.rxjava3.observers in project RxJava by ReactiveX.

the class FlowableMergeWithMaybeTest method cancelOtherOnMainError.

@Test
public void cancelOtherOnMainError() {
    PublishProcessor<Integer> pp = PublishProcessor.create();
    MaybeSubject<Integer> ms = MaybeSubject.create();
    TestSubscriber<Integer> ts = pp.mergeWith(ms).test();
    assertTrue(pp.hasSubscribers());
    assertTrue(ms.hasObservers());
    pp.onError(new TestException());
    ts.assertFailure(TestException.class);
    assertFalse("main has observers!", pp.hasSubscribers());
    assertFalse("other has observers", ms.hasObservers());
}
Also used : TestException(io.reactivex.rxjava3.exceptions.TestException) Test(org.junit.Test)

Example 29 with io.reactivex.rxjava3.observers

use of io.reactivex.rxjava3.observers in project RxJava by ReactiveX.

the class ObservableMergeWithMaybeTest method cancelOtherOnMainError.

@Test
public void cancelOtherOnMainError() {
    PublishSubject<Integer> ps = PublishSubject.create();
    MaybeSubject<Integer> ms = MaybeSubject.create();
    TestObserver<Integer> to = ps.mergeWith(ms).test();
    assertTrue(ps.hasObservers());
    assertTrue(ms.hasObservers());
    ps.onError(new TestException());
    to.assertFailure(TestException.class);
    assertFalse("main has observers!", ps.hasObservers());
    assertFalse("other has observers", ms.hasObservers());
}
Also used : TestException(io.reactivex.rxjava3.exceptions.TestException) Test(org.junit.Test)

Example 30 with io.reactivex.rxjava3.observers

use of io.reactivex.rxjava3.observers 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());
}
Also used : TestException(io.reactivex.rxjava3.exceptions.TestException) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)34 TestException (io.reactivex.rxjava3.exceptions.TestException)30 RxMethod (io.reactivex.rxjava3.validators.BaseTypeParser.RxMethod)6 Observable (io.reactivex.rxjava3.core.Observable)2 CompletableSubject (io.reactivex.rxjava3.subjects.CompletableSubject)2 IOException (java.io.IOException)2 Pattern (java.util.regex.Pattern)2 RxJavaTest (io.reactivex.rxjava3.core.RxJavaTest)1 ConnectConsumer (io.reactivex.rxjava3.internal.util.ConnectConsumer)1