use of io.reactivex.rxjava3.internal.operators.flowable.FlowableFlattenIterable.FlattenIterableSubscriber in project RxJava by ReactiveX.
the class FlowableFlattenIterableTest method fusionRequestedState.
@Test
public void fusionRequestedState() throws Exception {
TestSubscriber<Integer> ts = new TestSubscriber<>(0);
FlattenIterableSubscriber<Integer, Integer> f = new FlattenIterableSubscriber<>(ts, Functions.justFunction(Arrays.<Integer>asList(1, 2)), 128);
f.onSubscribe(new BooleanSubscription());
f.fusionMode = QueueFuseable.NONE;
assertEquals(QueueFuseable.NONE, f.requestFusion(QueueFuseable.SYNC));
assertEquals(QueueFuseable.NONE, f.requestFusion(QueueFuseable.ASYNC));
f.fusionMode = QueueFuseable.SYNC;
assertEquals(QueueFuseable.SYNC, f.requestFusion(QueueFuseable.SYNC));
assertEquals(QueueFuseable.NONE, f.requestFusion(QueueFuseable.ASYNC));
}
use of io.reactivex.rxjava3.internal.operators.flowable.FlowableFlattenIterable.FlattenIterableSubscriber in project RxJava by ReactiveX.
the class FlowableFlattenIterableTest method onErrorLate.
@Test
public void onErrorLate() {
List<Throwable> errors = TestHelper.trackPluginErrors();
try {
TestSubscriberEx<Integer> ts = new TestSubscriberEx<>();
FlattenIterableSubscriber<Integer, Integer> f = new FlattenIterableSubscriber<>(ts, Functions.justFunction(Collections.<Integer>emptyList()), 128);
f.onSubscribe(new BooleanSubscription());
f.onError(new TestException("first"));
ts.assertFailureAndMessage(TestException.class, "first");
assertTrue(errors.isEmpty());
f.done = false;
f.onError(new TestException("second"));
TestHelper.assertUndeliverable(errors, 0, TestException.class, "second");
} finally {
RxJavaPlugins.reset();
}
}
use of io.reactivex.rxjava3.internal.operators.flowable.FlowableFlattenIterable.FlattenIterableSubscriber in project RxJava by ReactiveX.
the class FlowableFlattenIterableTest method fusedCurrentIteratorEmpty.
@Test
public void fusedCurrentIteratorEmpty() throws Throwable {
TestSubscriber<Integer> ts = new TestSubscriber<>(0);
FlattenIterableSubscriber<Integer, Integer> f = new FlattenIterableSubscriber<>(ts, Functions.justFunction(Arrays.<Integer>asList(1, 2)), 128);
f.onSubscribe(new BooleanSubscription());
f.onNext(1);
assertFalse(f.isEmpty());
assertEquals(1, f.poll().intValue());
assertFalse(f.isEmpty());
assertEquals(2, f.poll().intValue());
assertTrue(f.isEmpty());
}
Aggregations