Search in sources :

Example 1 with ConcatMapSingleSubscriber

use of io.reactivex.rxjava3.internal.operators.mixed.FlowableConcatMapSingle.ConcatMapSingleSubscriber in project RxJava by ReactiveX.

the class FlowableConcatMapSingleTest method cancelNoConcurrentClean.

@Test
public void cancelNoConcurrentClean() {
    TestSubscriber<Integer> ts = new TestSubscriber<>();
    ConcatMapSingleSubscriber<Integer, Integer> operator = new ConcatMapSingleSubscriber<>(ts, Functions.justFunction(Single.<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) TestSubscriber(io.reactivex.rxjava3.subscribers.TestSubscriber) ConcatMapSingleSubscriber(io.reactivex.rxjava3.internal.operators.mixed.FlowableConcatMapSingle.ConcatMapSingleSubscriber) Test(org.junit.Test)

Aggregations

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