Search in sources :

Example 1 with ParallelSortedJoin

use of io.reactivex.rxjava3.internal.operators.parallel.ParallelSortedJoin in project RxJava by ReactiveX.

the class ParallelSortedJoinTest method comparatorCrashWhileMainOnError.

@Test
public void comparatorCrashWhileMainOnError() throws Throwable {
    TestHelper.withErrorTracking(errors -> {
        PublishProcessor<List<Integer>> pp1 = PublishProcessor.create();
        PublishProcessor<List<Integer>> pp2 = PublishProcessor.create();
        new ParallelSortedJoin<>(ParallelFlowable.fromArray(pp1, pp2), (a, b) -> {
            pp1.onError(new IOException());
            throw new TestException();
        }).test();
        pp1.onNext(Arrays.asList(1));
        pp2.onNext(Arrays.asList(2));
        pp1.onComplete();
        pp2.onComplete();
        TestHelper.assertUndeliverable(errors, 0, TestException.class);
    });
}
Also used : java.util(java.util) TestException(io.reactivex.rxjava3.exceptions.TestException) IOException(java.io.IOException) Test(org.junit.Test) TestSubscriber(io.reactivex.rxjava3.subscribers.TestSubscriber) io.reactivex.rxjava3.processors(io.reactivex.rxjava3.processors) TimeUnit(java.util.concurrent.TimeUnit) Schedulers(io.reactivex.rxjava3.schedulers.Schedulers) TestHelper(io.reactivex.rxjava3.testsupport.TestHelper) Functions(io.reactivex.rxjava3.internal.functions.Functions) ParallelSortedJoin(io.reactivex.rxjava3.internal.operators.parallel.ParallelSortedJoin) io.reactivex.rxjava3.core(io.reactivex.rxjava3.core) Assert(org.junit.Assert) RxJavaPlugins(io.reactivex.rxjava3.plugins.RxJavaPlugins) TestException(io.reactivex.rxjava3.exceptions.TestException) IOException(java.io.IOException) Test(org.junit.Test)

Aggregations

io.reactivex.rxjava3.core (io.reactivex.rxjava3.core)1 TestException (io.reactivex.rxjava3.exceptions.TestException)1 Functions (io.reactivex.rxjava3.internal.functions.Functions)1 ParallelSortedJoin (io.reactivex.rxjava3.internal.operators.parallel.ParallelSortedJoin)1 RxJavaPlugins (io.reactivex.rxjava3.plugins.RxJavaPlugins)1 io.reactivex.rxjava3.processors (io.reactivex.rxjava3.processors)1 Schedulers (io.reactivex.rxjava3.schedulers.Schedulers)1 TestSubscriber (io.reactivex.rxjava3.subscribers.TestSubscriber)1 TestHelper (io.reactivex.rxjava3.testsupport.TestHelper)1 IOException (java.io.IOException)1 java.util (java.util)1 TimeUnit (java.util.concurrent.TimeUnit)1 Assert (org.junit.Assert)1 Test (org.junit.Test)1