use of io.reactivex.internal.operators.observable.ObservableObserveOn.ObserveOnObserver in project RxJava by ReactiveX.
the class ObservableObserveOnTest method nonFusedPollThrows.
@Test
public void nonFusedPollThrows() {
new Observable<Integer>() {
@Override
protected void subscribeActual(Observer<? super Integer> observer) {
observer.onSubscribe(Disposables.empty());
@SuppressWarnings("unchecked") ObserveOnObserver<Integer> oo = (ObserveOnObserver<Integer>) observer;
oo.queue = new SimpleQueue<Integer>() {
@Override
public boolean offer(Integer value) {
return false;
}
@Override
public boolean offer(Integer v1, Integer v2) {
return false;
}
@Nullable
@Override
public Integer poll() throws Exception {
throw new TestException();
}
@Override
public boolean isEmpty() {
return false;
}
@Override
public void clear() {
}
};
oo.clear();
oo.schedule();
}
}.observeOn(Schedulers.single()).test().awaitDone(5, TimeUnit.SECONDS).assertFailure(TestException.class);
}
Aggregations