Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Concat #273

Merged
merged 4 commits into from
May 16, 2013
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Revert "Add new unit test to cover infinite observable being the firs…
…t sequence."

This reverts commit 658d824.
billyy committed May 15, 2013

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 9b3204b5f0494135e9178736aaf130154faf4b5f
34 changes: 1 addition & 33 deletions rxjava-core/src/main/java/rx/operators/OperationConcat.java
Original file line number Diff line number Diff line change
@@ -36,7 +36,7 @@
import rx.Subscription;
import rx.subscriptions.BooleanSubscription;
import rx.util.AtomicObservableSubscription;

import rx.util.Exceptions;
import rx.util.functions.Func1;

public final class OperationConcat {
@@ -460,38 +460,6 @@ public void testConcatConcurrentWithInfinity() {

}

@Test
public void testConcatConcurrentWithInfinityFirstSequence() {
final TestObservable<String> w1 = new TestObservable<String>("one", "two", "three");
//This observable will send "hello" MAX_VALUE time.
final TestObservable<String> w2 = new TestObservable<String>("hello", Integer.MAX_VALUE);

@SuppressWarnings("unchecked")
Observer<String> aObserver = mock(Observer.class);
@SuppressWarnings("unchecked")
TestObservable<Observable<String>> observableOfObservables = new TestObservable<Observable<String>>(w2, w1);
Func1<Observer<String>, Subscription> concatF = concat(observableOfObservables);

Observable<String> concat = Observable.create(concatF);

concat.take(50).subscribe(aObserver);

//Wait for the thread to start up.
try {
Thread.sleep(25);
w2.t.join();
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

InOrder inOrder = inOrder(aObserver);
inOrder.verify(aObserver, times(50)).onNext("hello");
verify(aObserver, times(1)).onCompleted();
verify(aObserver, never()).onError(any(Exception.class));

}


/**
* Test unsubscribing the concatenated Observable in a single thread.