You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for using RxJava but before you post an issue, please consider the following points:
Please include the library version number, including the minor and patch version, in the issue text. In addition, if you'd include the major version in the title (such as 2.x) that would be great.
2.1.1
If you think you found a bug, please include a code sample that reproduces the problem. Dumping a stacktrace is usually not enough for us.
// Fail
@Test
public void testConcatWithObserver() {
Observable<String> s = Observable.concat(Observable.just("abc"), Observable.just("def"));
AtomicReference<Disposable> disposable = new AtomicReference<>();
LinkedList<String> list = new LinkedList<>();
AtomicBoolean completed = new AtomicBoolean();
s.subscribe(new Observer<String>() {
public void onSubscribe(Disposable d) { disposable.set(d); }
public void onNext(String s) { list.add(s); }
public void onError(Throwable e) {}
public void onComplete() { completed.set(true); }
});
assertTrue(completed.get());
assertEquals(Arrays.asList("abc", "def"), list);
assertTrue(disposable.get().isDisposed());
}
// Pass
@Test
public void testConcatWithActions() {
Observable<String> s = Observable.concat(Observable.just("abc"), Observable.just("def"));
AtomicReference<Disposable> disposable = new AtomicReference<>();
LinkedList<String> list = new LinkedList<>();
AtomicBoolean completed = new AtomicBoolean();
s.subscribe(list::add, err -> {}, () -> completed.set(true), disposable::set);
assertTrue(completed.get());
assertEquals(Arrays.asList("abc", "def"), list);
assertTrue(disposable.get().isDisposed());
}
The text was updated successfully, but these errors were encountered:
I am merely reporting a difference of behavior where disposable.get().isDisposed() returns false for testConcatWithObserver and it seems to me that it should return true with this above reproducer.
If I replace the Observable.concat(...) by Observable.just("foo"), then disposable.get().isDisposed() will be true in both cases.
Thanks for using RxJava but before you post an issue, please consider the following points:
2.x
) that would be great.2.1.1
The text was updated successfully, but these errors were encountered: