Skip to content

Fix typo Javadocs TestObserver #4478

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

Merged
merged 1 commit into from
Sep 5, 2016
Merged
Changes from all commits
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
58 changes: 29 additions & 29 deletions src/main/java/io/reactivex/observers/TestObserver.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
* <p>You can override the onSubscribe, onNext, onError, onComplete and
* cancel methods but not the others (this is by design).
*
* <p>The TestSubscriber implements Disposable for convenience where dispose calls cancel.
* <p>The TestObserver implements Disposable for convenience where dispose calls cancel.
*
* @param <T> the value type
*/
Expand Down Expand Up @@ -218,8 +218,8 @@ public void onComplete() {
}

/**
* Returns true if this TestSubscriber has been cancelled.
* @return true if this TestSubscriber has been cancelled
* Returns true if this TestObserver has been cancelled.
* @return true if this TestObserver has been cancelled
*/
public final boolean isCancelled() {
return isDisposed();
Expand Down Expand Up @@ -247,7 +247,7 @@ public final boolean isDisposed() {
// state retrieval methods

/**
* Returns the last thread which called the onXXX methods of this TestSubscriber.
* Returns the last thread which called the onXXX methods of this TestObserver.
* @return the last thread which called the onXXX methods
*/
public final Thread lastThread() {
Expand Down Expand Up @@ -279,8 +279,8 @@ public final long completions() {
}

/**
* Returns true if TestSubscriber received any onError or onComplete events.
* @return true if TestSubscriber received any onError or onComplete events
* Returns true if TestObserver received any onError or onComplete events.
* @return true if TestObserver received any onError or onComplete events
*/
public final boolean isTerminated() {
return done.getCount() == 0;
Expand All @@ -303,15 +303,15 @@ public final int errorCount() {
}

/**
* Returns true if this TestSubscriber received a subscription.
* @return true if this TestSubscriber received a subscription
* Returns true if this TestObserver received a subscription.
* @return true if this TestObserver received a subscription
*/
public final boolean hasSubscription() {
return subscription.get() != null;
}

/**
* Awaits until this TestSubscriber receives an onError or onComplete events.
* Awaits until this TestObserver receives an onError or onComplete events.
* @return this
* @throws InterruptedException if the current thread is interrupted while waiting
* @see #awaitTerminalEvent()
Expand All @@ -326,11 +326,11 @@ public final TestObserver<T> await() throws InterruptedException {
}

/**
* Awaits the specified amount of time or until this TestSubscriber
* Awaits the specified amount of time or until this TestObserver
* receives an onError or onComplete events, whichever happens first.
* @param time the waiting time
* @param unit the time unit of the waiting time
* @return true if the TestSubscriber terminated, false if timeout happened
* @return true if the TestObserver terminated, false if timeout happened
* @throws InterruptedException if the current thread is interrupted while waiting
* @see #awaitTerminalEvent(long, TimeUnit)
*/
Expand Down Expand Up @@ -372,7 +372,7 @@ private AssertionError fail(String message) {
}

/**
* Assert that this TestSubscriber received exactly one onComplete event.
* Assert that this TestObserver received exactly one onComplete event.
* @return this;
*/
public final TestObserver<T> assertComplete() {
Expand All @@ -387,7 +387,7 @@ public final TestObserver<T> assertComplete() {
}

/**
* Assert that this TestSubscriber has not received any onComplete event.
* Assert that this TestObserver has not received any onComplete event.
* @return this;
*/
public final TestObserver<T> assertNotComplete() {
Expand All @@ -402,7 +402,7 @@ public final TestObserver<T> assertNotComplete() {
}

/**
* Assert that this TestSubscriber has not received any onError event.
* Assert that this TestObserver has not received any onError event.
* @return this;
*/
public final TestObserver<T> assertNoErrors() {
Expand All @@ -414,7 +414,7 @@ public final TestObserver<T> assertNoErrors() {
}

/**
* Assert that this TestSubscriber received exactly the specified onError event value.
* Assert that this TestObserver received exactly the specified onError event value.
*
* <p>The comparison is performed via Objects.equals(); since most exceptions don't
* implement equals(), this assertion may fail. Use the {@link #assertError(Class)}
Expand All @@ -439,7 +439,7 @@ public final TestObserver<T> assertError(Throwable error) {
}

/**
* Asserts that this TestSubscriber received exactly one onError event which is an
* Asserts that this TestObserver received exactly one onError event which is an
* instance of the specified errorClass class.
* @param errorClass the error class to expect
* @return this;
Expand Down Expand Up @@ -470,7 +470,7 @@ public final TestObserver<T> assertError(Class<? extends Throwable> errorClass)
}

/**
* Assert that this TestSubscriber received exactly one onNext value which is equal to
* Assert that this TestObserver received exactly one onNext value which is equal to
* the given value with respect to Objects.equals.
* @param value the value to expect
* @return this;
Expand All @@ -496,7 +496,7 @@ static String valueAndClass(Object o) {
}

/**
* Assert that this TestSubscriber received the specified number onNext events.
* Assert that this TestObserver received the specified number onNext events.
* @param count the expected number of onNext events
* @return this;
*/
Expand All @@ -509,15 +509,15 @@ public final TestObserver<T> assertValueCount(int count) {
}

/**
* Assert that this TestSubscriber has not received any onNext events.
* Assert that this TestObserver has not received any onNext events.
* @return this;
*/
public final TestObserver<T> assertNoValues() {
return assertValueCount(0);
}

/**
* Assert that the TestSubscriber received only the specified values in the specified order.
* Assert that the TestObserver received only the specified values in the specified order.
* @param values the values expected
* @return this;
* @see #assertValueSet(Collection)
Expand All @@ -539,7 +539,7 @@ public final TestObserver<T> assertValues(T... values) {
}

/**
* Assert that the TestSubscriber received only the specified values in any order.
* Assert that the TestObserver received only the specified values in any order.
* <p>This helps asserting when the order of the values is not guaranteed, i.e., when merging
* asynchronous streams.
*
Expand All @@ -560,7 +560,7 @@ public final TestObserver<T> assertValueSet(Collection<? extends T> expected) {
}

/**
* Assert that the TestSubscriber received only the specified sequence of values in the same order.
* Assert that the TestObserver received only the specified sequence of values in the same order.
* @param sequence the sequence of expected values in order
* @return this;
*/
Expand Down Expand Up @@ -599,7 +599,7 @@ public final TestObserver<T> assertValueSequence(Iterable<? extends T> sequence)
}

/**
* Assert that the TestSubscriber terminated (i.e., the terminal latch reached zero).
* Assert that the TestObserver terminated (i.e., the terminal latch reached zero).
* @return this;
*/
public final TestObserver<T> assertTerminated() {
Expand All @@ -622,7 +622,7 @@ public final TestObserver<T> assertTerminated() {
}

/**
* Assert that the TestSubscriber has not terminated (i.e., the terminal latch is still non-zero).
* Assert that the TestObserver has not terminated (i.e., the terminal latch is still non-zero).
* @return this;
*/
public final TestObserver<T> assertNotTerminated() {
Expand Down Expand Up @@ -658,9 +658,9 @@ public final TestObserver<T> assertNotSubscribed() {
}

/**
* Waits until the any terminal event has been received by this TestSubscriber
* Waits until the any terminal event has been received by this TestObserver
* or returns false if the wait has been interrupted.
* @return true if the TestSubscriber terminated, false if the wait has been interrupted
* @return true if the TestObserver terminated, false if the wait has been interrupted
*/
public final boolean awaitTerminalEvent() {
try {
Expand All @@ -673,11 +673,11 @@ public final boolean awaitTerminalEvent() {
}

/**
* Awaits the specified amount of time or until this TestSubscriber
* Awaits the specified amount of time or until this TestObserver
* receives an onError or onComplete events, whichever happens first.
* @param duration the waiting time
* @param unit the time unit of the waiting time
* @return true if the TestSubscriber terminated, false if timeout or interrupt happened
* @return true if the TestObserver terminated, false if timeout or interrupt happened
*/
public final boolean awaitTerminalEvent(long duration, TimeUnit unit) {
try {
Expand Down Expand Up @@ -864,7 +864,7 @@ public final TestObserver<T> assertFailureAndMessage(Class<? extends Throwable>

/**
* Awaits until the internal latch is counted down.
* <p>If the wait times out or gets interrupted, the TestSubscriber is cancelled.
* <p>If the wait times out or gets interrupted, the TestObserver is cancelled.
* @param time the waiting time
* @param unit the time unit of the waiting time
* @return this
Expand Down