use of io.reactivex.rxjava3.internal.operators.observable.ObservableReplay in project RxJava by ReactiveX.
the class ObservableReplayEagerTruncateTest method noHeadRetentionErrorTime.
@Test
public void noHeadRetentionErrorTime() {
PublishSubject<Integer> source = PublishSubject.create();
ObservableReplay<Integer> co = (ObservableReplay<Integer>) source.replay(1, TimeUnit.MINUTES, Schedulers.computation(), true);
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.observable.ObservableReplay in project RxJava by ReactiveX.
the class ObservableReplayEagerTruncateTest method noHeadRetentionErrorSize.
@Test
public void noHeadRetentionErrorSize() {
PublishSubject<Integer> source = PublishSubject.create();
ObservableReplay<Integer> co = (ObservableReplay<Integer>) source.replay(1, true);
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.observable.ObservableReplay in project RxJava by ReactiveX.
the class ObservableReplayTest method noHeadRetentionErrorSize.
@Test
public void noHeadRetentionErrorSize() {
PublishSubject<Integer> source = PublishSubject.create();
ObservableReplay<Integer> co = (ObservableReplay<Integer>) source.replay(1);
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.observable.ObservableReplay in project RxJava by ReactiveX.
the class ObservableReplayTest method noHeadRetentionErrorTime.
@Test
public void noHeadRetentionErrorTime() {
PublishSubject<Integer> source = PublishSubject.create();
ObservableReplay<Integer> co = (ObservableReplay<Integer>) source.replay(1, TimeUnit.MINUTES, Schedulers.computation());
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