use of io.reactivex.rxjava3.exceptions.TestException in project RxJava by ReactiveX.
the class ReplayProcessorTest method peekStateTimeAndSizeValue.
@Test
public void peekStateTimeAndSizeValue() {
ReplayProcessor<Integer> rp = ReplayProcessor.createWithTimeAndSize(1, TimeUnit.DAYS, Schedulers.computation(), 1);
assertNull(rp.getValue());
assertEquals(0, rp.getValues().length);
assertNull(rp.getValues(new Integer[2])[0]);
rp.onComplete();
assertNull(rp.getValue());
assertEquals(0, rp.getValues().length);
assertNull(rp.getValues(new Integer[2])[0]);
rp = ReplayProcessor.createWithTimeAndSize(1, TimeUnit.DAYS, Schedulers.computation(), 1);
rp.onError(new TestException());
assertNull(rp.getValue());
assertEquals(0, rp.getValues().length);
assertNull(rp.getValues(new Integer[2])[0]);
}
use of io.reactivex.rxjava3.exceptions.TestException in project RxJava by ReactiveX.
the class ReplayProcessorTest method sizeAndHasAnyValueUnboundedEmptyError.
@Test
public void sizeAndHasAnyValueUnboundedEmptyError() {
ReplayProcessor<Object> rs = ReplayProcessor.create();
rs.onError(new TestException());
assertEquals(0, rs.size());
assertFalse(rs.hasValue());
}
use of io.reactivex.rxjava3.exceptions.TestException in project RxJava by ReactiveX.
the class ReplayProcessorTest method unboundedZeroRequestError.
@Test
public void unboundedZeroRequestError() {
final ReplayProcessor<Integer> source = ReplayProcessor.create();
source.onError(new TestException());
source.test(0).assertFailure(TestException.class);
}
use of io.reactivex.rxjava3.exceptions.TestException 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.exceptions.TestException 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());
}
Aggregations