Search in sources :

Example 1 with DisposeTrackingScheduler

use of io.reactivex.rxjava3.internal.operators.flowable.FlowableObserveOnTest.DisposeTrackingScheduler in project RxJava by ReactiveX.

the class ObservableObserveOnTest method workerNotDisposedPrematurelyAsyncInNormalOut.

@Test
public void workerNotDisposedPrematurelyAsyncInNormalOut() {
    DisposeTrackingScheduler s = new DisposeTrackingScheduler();
    UnicastSubject<Integer> us = UnicastSubject.create();
    us.onNext(1);
    us.onComplete();
    Observable.concat(us.observeOn(s), Observable.just(2)).test().assertResult(1, 2);
    assertEquals(1, s.disposedCount.get());
}
Also used : DisposeTrackingScheduler(io.reactivex.rxjava3.internal.operators.flowable.FlowableObserveOnTest.DisposeTrackingScheduler) Test(org.junit.Test)

Example 2 with DisposeTrackingScheduler

use of io.reactivex.rxjava3.internal.operators.flowable.FlowableObserveOnTest.DisposeTrackingScheduler in project RxJava by ReactiveX.

the class ObservableObserveOnTest method workerNotDisposedPrematurelyNormalInAsyncOut.

@Test
public void workerNotDisposedPrematurelyNormalInAsyncOut() {
    DisposeTrackingScheduler s = new DisposeTrackingScheduler();
    TestObserverEx<Integer> to = new TestObserverFusedCanceling();
    Observable.just(1).hide().observeOn(s).subscribe(to);
    assertEquals(1, s.disposedCount.get());
}
Also used : DisposeTrackingScheduler(io.reactivex.rxjava3.internal.operators.flowable.FlowableObserveOnTest.DisposeTrackingScheduler) Test(org.junit.Test)

Example 3 with DisposeTrackingScheduler

use of io.reactivex.rxjava3.internal.operators.flowable.FlowableObserveOnTest.DisposeTrackingScheduler in project RxJava by ReactiveX.

the class ObservableObserveOnTest method workerNotDisposedPrematurelyNormalInNormalOut.

@Test
public void workerNotDisposedPrematurelyNormalInNormalOut() {
    DisposeTrackingScheduler s = new DisposeTrackingScheduler();
    Observable.concat(Observable.just(1).hide().observeOn(s), Observable.just(2)).test().assertResult(1, 2);
    assertEquals(1, s.disposedCount.get());
}
Also used : DisposeTrackingScheduler(io.reactivex.rxjava3.internal.operators.flowable.FlowableObserveOnTest.DisposeTrackingScheduler) Test(org.junit.Test)

Example 4 with DisposeTrackingScheduler

use of io.reactivex.rxjava3.internal.operators.flowable.FlowableObserveOnTest.DisposeTrackingScheduler in project RxJava by ReactiveX.

the class ObservableObserveOnTest method workerNotDisposedPrematurelySyncInNormalOut.

@Test
public void workerNotDisposedPrematurelySyncInNormalOut() {
    DisposeTrackingScheduler s = new DisposeTrackingScheduler();
    Observable.concat(Observable.just(1).observeOn(s), Observable.just(2)).test().assertResult(1, 2);
    assertEquals(1, s.disposedCount.get());
}
Also used : DisposeTrackingScheduler(io.reactivex.rxjava3.internal.operators.flowable.FlowableObserveOnTest.DisposeTrackingScheduler) Test(org.junit.Test)

Aggregations

DisposeTrackingScheduler (io.reactivex.rxjava3.internal.operators.flowable.FlowableObserveOnTest.DisposeTrackingScheduler)4 Test (org.junit.Test)4