Search in sources :

Example 1 with BooleanRunnable

use of io.reactivex.rxjava3.internal.schedulers.ExecutorScheduler.ExecutorWorker.BooleanRunnable in project RxJava by ReactiveX.

the class BooleanRunnableTest method runnableThrows.

@Test
public void runnableThrows() {
    List<Throwable> errors = TestHelper.trackPluginErrors();
    try {
        BooleanRunnable task = new BooleanRunnable(() -> {
            throw new TestException();
        });
        try {
            task.run();
            fail("Should have thrown!");
        } catch (TestException expected) {
        // expected
        }
        TestHelper.assertUndeliverable(errors, 0, TestException.class);
    } finally {
        RxJavaPlugins.reset();
    }
}
Also used : TestException(io.reactivex.rxjava3.exceptions.TestException) BooleanRunnable(io.reactivex.rxjava3.internal.schedulers.ExecutorScheduler.ExecutorWorker.BooleanRunnable) RxJavaTest(io.reactivex.rxjava3.core.RxJavaTest) Test(org.junit.Test)

Aggregations

RxJavaTest (io.reactivex.rxjava3.core.RxJavaTest)1 TestException (io.reactivex.rxjava3.exceptions.TestException)1 BooleanRunnable (io.reactivex.rxjava3.internal.schedulers.ExecutorScheduler.ExecutorWorker.BooleanRunnable)1 Test (org.junit.Test)1