|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectrx.Subscriber<T>
rx.observers.TestSubscriber<T>
public class TestSubscriber<T>
Observer usable for unit testing to perform assertions, inspect received events or wrap a mocked Observer.
| Constructor Summary | |
|---|---|
TestSubscriber()
|
|
TestSubscriber(Observer<T> delegate)
|
|
TestSubscriber(Subscriber<T> delegate)
|
|
| Method Summary | |
|---|---|
void |
assertReceivedOnNext(java.util.List<T> items)
|
void |
assertTerminalEvent()
Assert that a single terminal event occurred, either onCompleted or onError. |
void |
assertUnsubscribed()
|
void |
awaitTerminalEvent()
|
void |
awaitTerminalEvent(long timeout,
java.util.concurrent.TimeUnit unit)
|
void |
awaitTerminalEventAndUnsubscribeOnTimeout(long timeout,
java.util.concurrent.TimeUnit unit)
|
java.lang.Thread |
getLastSeenThread()
|
java.util.List<Notification<T>> |
getOnCompletedEvents()
|
java.util.List<java.lang.Throwable> |
getOnErrorEvents()
|
java.util.List<T> |
getOnNextEvents()
|
void |
onCompleted()
Notifies the Observer that the Observable has finished sending push-based notifications. |
void |
onError(java.lang.Throwable e)
Notifies the Observer that the Observable has experienced an error condition. |
void |
onNext(T t)
Provides the Observer with new data. |
| Methods inherited from class rx.Subscriber |
|---|
add, isUnsubscribed, unsubscribe |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TestSubscriber(Subscriber<T> delegate)
public TestSubscriber(Observer<T> delegate)
public TestSubscriber()
| Method Detail |
|---|
public void onCompleted()
ObserverObservable has finished sending push-based notifications.
The Observable will not call this closure if it calls onError.
public java.util.List<Notification<T>> getOnCompletedEvents()
public void onError(java.lang.Throwable e)
ObserverObservable has experienced an error condition.
If the Observable calls this closure, it will not thereafter call onNext or
onCompleted.
public java.util.List<java.lang.Throwable> getOnErrorEvents()
public void onNext(T t)
Observer
The Observable calls this closure 1 or more times, unless it calls onError in which
case this closure may never be called.
The Observable will not call this closure again after it calls either onCompleted or
onError.
public java.util.List<T> getOnNextEvents()
public void assertReceivedOnNext(java.util.List<T> items)
public void assertTerminalEvent()
public void assertUnsubscribed()
public void awaitTerminalEvent()
public void awaitTerminalEvent(long timeout,
java.util.concurrent.TimeUnit unit)
public void awaitTerminalEventAndUnsubscribeOnTimeout(long timeout,
java.util.concurrent.TimeUnit unit)
public java.lang.Thread getLastSeenThread()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||