use of io.reactivex.rxjava3.processors.ReplayProcessor in project RxJava by ReactiveX.
the class ReplayProcessorTest method timeAndSizeBoundZeroRequestError.
@Test
public void timeAndSizeBoundZeroRequestError() {
final ReplayProcessor<Integer> source = ReplayProcessor.createWithTimeAndSize(1, TimeUnit.MINUTES, Schedulers.single(), 16);
source.onError(new TestException());
source.test(0).assertFailure(TestException.class);
}
use of io.reactivex.rxjava3.processors.ReplayProcessor in project RxJava by ReactiveX.
the class ReplayProcessorTest method subscribeAfterDone.
@Test
public void subscribeAfterDone() {
ReplayProcessor<Integer> rp = ReplayProcessor.create();
rp.onComplete();
BooleanSubscription bs = new BooleanSubscription();
rp.onSubscribe(bs);
assertTrue(bs.isCancelled());
}
use of io.reactivex.rxjava3.processors.ReplayProcessor in project RxJava by ReactiveX.
the class ReplayProcessorTest method sizeAndHasAnyValueUnboundedError.
@Test
public void sizeAndHasAnyValueUnboundedError() {
ReplayProcessor<Object> rs = ReplayProcessor.create();
assertEquals(0, rs.size());
assertFalse(rs.hasValue());
rs.onNext(1);
assertEquals(1, rs.size());
assertTrue(rs.hasValue());
rs.onNext(1);
assertEquals(2, rs.size());
assertTrue(rs.hasValue());
rs.onError(new TestException());
assertEquals(2, rs.size());
assertTrue(rs.hasValue());
}
use of io.reactivex.rxjava3.processors.ReplayProcessor in project RxJava by ReactiveX.
the class ReplayProcessorTest method sizeAndTimeBoundReplayError.
@Test
public void sizeAndTimeBoundReplayError() {
ReplayProcessor<Integer> rp = ReplayProcessor.createWithTimeAndSize(1, TimeUnit.DAYS, Schedulers.single(), 2);
rp.onNext(1);
rp.onNext(2);
rp.onNext(3);
rp.onNext(4);
rp.onError(new TestException());
rp.test().assertFailure(TestException.class, 3, 4);
}
use of io.reactivex.rxjava3.processors.ReplayProcessor in project RxJava by ReactiveX.
the class ReplayProcessorTest method sizeboundReplayError.
@Test
public void sizeboundReplayError() {
ReplayProcessor<Integer> rp = ReplayProcessor.createWithSize(2);
rp.onNext(1);
rp.onNext(2);
rp.onNext(3);
rp.onNext(4);
rp.onError(new TestException());
rp.test().assertFailure(TestException.class, 3, 4);
}
Aggregations