use of io.reactivex.exceptions.TestException in project RxJava by ReactiveX.
the class XFlatMapTest method flowableCompletable.
@Test
public void flowableCompletable() throws Exception {
List<Throwable> errors = TestHelper.trackPluginErrors();
try {
TestObserver<Void> ts = Flowable.just(1).subscribeOn(Schedulers.io()).flatMapCompletable(new Function<Integer, Completable>() {
@Override
public Completable apply(Integer v) throws Exception {
sleep();
return Completable.error(new TestException());
}
}).test();
cb.await();
Thread.sleep(50);
ts.cancel();
Thread.sleep(SLEEP_AFTER_CANCEL);
ts.assertEmpty();
assertTrue(errors.toString(), errors.isEmpty());
} finally {
RxJavaPlugins.reset();
}
}
use of io.reactivex.exceptions.TestException in project RxJava by ReactiveX.
the class ObserverFullArbiterTest method errorAfterCancel.
@Test
public void errorAfterCancel() {
ObserverFullArbiter<Integer> fa = new ObserverFullArbiter<Integer>(new TestObserver<Integer>(), null, 128);
Disposable bs = Disposables.empty();
fa.dispose();
List<Throwable> errors = TestHelper.trackPluginErrors();
try {
fa.onError(new TestException(), bs);
TestHelper.assertUndeliverable(errors, 0, TestException.class);
} finally {
RxJavaPlugins.reset();
}
}
use of io.reactivex.exceptions.TestException in project RxJava by ReactiveX.
the class DeferredScalarObserverTest method fusedTerminateMore.
@Test
public void fusedTerminateMore() {
TestObserver<Integer> to = ObserverFusion.newTest(QueueDisposable.ANY);
TakeLast source = new TakeLast(to);
Disposable d = Disposables.empty();
source.onSubscribe(d);
source.onNext(1);
source.onComplete();
source.onComplete();
source.onError(new TestException());
to.assertResult(1);
}
use of io.reactivex.exceptions.TestException in project RxJava by ReactiveX.
the class DeferredScalarObserverTest method nonfusedError.
@Test
public void nonfusedError() {
TestObserver<Integer> to = ObserverFusion.newTest(QueueDisposable.NONE);
TakeLast source = new TakeLast(to);
Disposable d = Disposables.empty();
source.onSubscribe(d);
source.onNext(1);
source.onError(new TestException());
source.onError(new TestException());
source.onComplete();
to.assertFailure(TestException.class);
}
use of io.reactivex.exceptions.TestException in project RxJava by ReactiveX.
the class DeferredScalarObserverTest method fusedError.
@Test
public void fusedError() {
TestObserver<Integer> to = ObserverFusion.newTest(QueueDisposable.ANY);
TakeLast source = new TakeLast(to);
Disposable d = Disposables.empty();
source.onSubscribe(d);
source.onNext(1);
source.onError(new TestException());
source.onError(new TestException());
source.onComplete();
to.assertFailure(TestException.class);
}
Aggregations