Search in sources :

Example 1 with ConcatMapMaybeSubscriber

use of io.reactivex.rxjava3.internal.operators.mixed.FlowableConcatMapMaybe.ConcatMapMaybeSubscriber in project RxJava by ReactiveX.

the class FlowableConcatMapMaybeTest method cancelNoConcurrentClean.

@Test
public void cancelNoConcurrentClean() {
    TestSubscriber<Integer> ts = new TestSubscriber<>();
    ConcatMapMaybeSubscriber<Integer, Integer> operator = new ConcatMapMaybeSubscriber<>(ts, Functions.justFunction(Maybe.<Integer>never()), 16, ErrorMode.IMMEDIATE);
    operator.onSubscribe(new BooleanSubscription());
    operator.queue.offer(1);
    operator.getAndIncrement();
    ts.cancel();
    assertFalse(operator.queue.isEmpty());
    operator.addAndGet(-2);
    operator.cancel();
    assertTrue(operator.queue.isEmpty());
}
Also used : BooleanSubscription(io.reactivex.rxjava3.internal.subscriptions.BooleanSubscription) ConcatMapMaybeSubscriber(io.reactivex.rxjava3.internal.operators.mixed.FlowableConcatMapMaybe.ConcatMapMaybeSubscriber) TestSubscriber(io.reactivex.rxjava3.subscribers.TestSubscriber) Test(org.junit.Test)

Aggregations

ConcatMapMaybeSubscriber (io.reactivex.rxjava3.internal.operators.mixed.FlowableConcatMapMaybe.ConcatMapMaybeSubscriber)1 BooleanSubscription (io.reactivex.rxjava3.internal.subscriptions.BooleanSubscription)1 TestSubscriber (io.reactivex.rxjava3.subscribers.TestSubscriber)1 Test (org.junit.Test)1