use of io.reactivex.rxjava3.core.Scheduler.DisposeTask in project RxJava by ReactiveX.
the class DisposeTaskTest method runnableThrows.
@Test
public void runnableThrows() throws Throwable {
TestHelper.withErrorTracking(errors -> {
Scheduler.Worker worker = Schedulers.single().createWorker();
DisposeTask task = new DisposeTask(() -> {
throw new TestException();
}, worker);
try {
task.run();
fail("Should have thrown!");
} catch (TestException expected) {
// expected
}
TestHelper.assertUndeliverable(errors, 0, TestException.class);
assertTrue(worker.isDisposed());
});
}
use of io.reactivex.rxjava3.core.Scheduler.DisposeTask in project RxJava3_BuildMatrix by akarnokd.
the class DisposeTaskTest method runnableThrows.
@Test
public void runnableThrows() throws Throwable {
TestHelper.withErrorTracking(errors -> {
Scheduler.Worker worker = Schedulers.single().createWorker();
DisposeTask task = new DisposeTask(() -> {
throw new TestException();
}, worker);
try {
task.run();
fail("Should have thrown!");
} catch (TestException expected) {
// expected
}
TestHelper.assertUndeliverable(errors, 0, TestException.class);
assertTrue(worker.isDisposed());
});
}
Aggregations