use of io.reactivex.rxjava3.internal.operators.flowable.FlowableReplay in project RxJava by ReactiveX.
the class FlowableReplayEagerTruncateTest method noHeadRetentionErrorSize.
@Test
public void noHeadRetentionErrorSize() {
PublishProcessor<Integer> source = PublishProcessor.create();
FlowableReplay<Integer> co = (FlowableReplay<Integer>) source.replay(1, true);
co.test();
co.connect();
BoundedReplayBuffer<Integer> buf = (BoundedReplayBuffer<Integer>) (co.current.get().buffer);
source.onNext(1);
source.onNext(2);
source.onError(new TestException());
assertNull(buf.get().value);
Object o = buf.get();
buf.trimHead();
assertSame(o, buf.get());
}
use of io.reactivex.rxjava3.internal.operators.flowable.FlowableReplay in project RxJava by ReactiveX.
the class FlowableReplayEagerTruncateTest method noHeadRetentionErrorTime.
@Test
public void noHeadRetentionErrorTime() {
PublishProcessor<Integer> source = PublishProcessor.create();
FlowableReplay<Integer> co = (FlowableReplay<Integer>) source.replay(1, TimeUnit.MINUTES, Schedulers.computation(), true);
co.test();
co.connect();
BoundedReplayBuffer<Integer> buf = (BoundedReplayBuffer<Integer>) (co.current.get().buffer);
source.onNext(1);
source.onNext(2);
source.onError(new TestException());
assertNull(buf.get().value);
Object o = buf.get();
buf.trimHead();
assertSame(o, buf.get());
}
use of io.reactivex.rxjava3.internal.operators.flowable.FlowableReplay in project RxJava by ReactiveX.
the class FlowableReplayTest method noHeadRetentionErrorTime.
@Test
public void noHeadRetentionErrorTime() {
PublishProcessor<Integer> source = PublishProcessor.create();
FlowableReplay<Integer> co = (FlowableReplay<Integer>) source.replay(1, TimeUnit.MINUTES, Schedulers.computation());
co.test();
co.connect();
BoundedReplayBuffer<Integer> buf = (BoundedReplayBuffer<Integer>) (co.current.get().buffer);
source.onNext(1);
source.onNext(2);
source.onError(new TestException());
assertNull(buf.get().value);
Object o = buf.get();
buf.trimHead();
assertSame(o, buf.get());
}
use of io.reactivex.rxjava3.internal.operators.flowable.FlowableReplay in project RxJava by ReactiveX.
the class FlowableReplayTest method noHeadRetentionErrorSize.
@Test
public void noHeadRetentionErrorSize() {
PublishProcessor<Integer> source = PublishProcessor.create();
FlowableReplay<Integer> co = (FlowableReplay<Integer>) source.replay(1);
co.test();
co.connect();
BoundedReplayBuffer<Integer> buf = (BoundedReplayBuffer<Integer>) (co.current.get().buffer);
source.onNext(1);
source.onNext(2);
source.onError(new TestException());
assertNull(buf.get().value);
Object o = buf.get();
buf.trimHead();
assertSame(o, buf.get());
}
Aggregations