Skip to content

Commit 12ca280

Browse files
VictorAlbertosakarnokd
authored andcommitted
Replace all occurrences 'TestSubscriber' by 'TestObserver' in TestObserver class (#4478)
1 parent ebaeee5 commit 12ca280

File tree

1 file changed

+29
-29
lines changed

1 file changed

+29
-29
lines changed

src/main/java/io/reactivex/observers/TestObserver.java

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
* <p>You can override the onSubscribe, onNext, onError, onComplete and
3333
* cancel methods but not the others (this is by design).
3434
*
35-
* <p>The TestSubscriber implements Disposable for convenience where dispose calls cancel.
35+
* <p>The TestObserver implements Disposable for convenience where dispose calls cancel.
3636
*
3737
* @param <T> the value type
3838
*/
@@ -218,8 +218,8 @@ public void onComplete() {
218218
}
219219

220220
/**
221-
* Returns true if this TestSubscriber has been cancelled.
222-
* @return true if this TestSubscriber has been cancelled
221+
* Returns true if this TestObserver has been cancelled.
222+
* @return true if this TestObserver has been cancelled
223223
*/
224224
public final boolean isCancelled() {
225225
return isDisposed();
@@ -247,7 +247,7 @@ public final boolean isDisposed() {
247247
// state retrieval methods
248248

249249
/**
250-
* Returns the last thread which called the onXXX methods of this TestSubscriber.
250+
* Returns the last thread which called the onXXX methods of this TestObserver.
251251
* @return the last thread which called the onXXX methods
252252
*/
253253
public final Thread lastThread() {
@@ -279,8 +279,8 @@ public final long completions() {
279279
}
280280

281281
/**
282-
* Returns true if TestSubscriber received any onError or onComplete events.
283-
* @return true if TestSubscriber received any onError or onComplete events
282+
* Returns true if TestObserver received any onError or onComplete events.
283+
* @return true if TestObserver received any onError or onComplete events
284284
*/
285285
public final boolean isTerminated() {
286286
return done.getCount() == 0;
@@ -303,15 +303,15 @@ public final int errorCount() {
303303
}
304304

305305
/**
306-
* Returns true if this TestSubscriber received a subscription.
307-
* @return true if this TestSubscriber received a subscription
306+
* Returns true if this TestObserver received a subscription.
307+
* @return true if this TestObserver received a subscription
308308
*/
309309
public final boolean hasSubscription() {
310310
return subscription.get() != null;
311311
}
312312

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

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

374374
/**
375-
* Assert that this TestSubscriber received exactly one onComplete event.
375+
* Assert that this TestObserver received exactly one onComplete event.
376376
* @return this;
377377
*/
378378
public final TestObserver<T> assertComplete() {
@@ -387,7 +387,7 @@ public final TestObserver<T> assertComplete() {
387387
}
388388

389389
/**
390-
* Assert that this TestSubscriber has not received any onComplete event.
390+
* Assert that this TestObserver has not received any onComplete event.
391391
* @return this;
392392
*/
393393
public final TestObserver<T> assertNotComplete() {
@@ -402,7 +402,7 @@ public final TestObserver<T> assertNotComplete() {
402402
}
403403

404404
/**
405-
* Assert that this TestSubscriber has not received any onError event.
405+
* Assert that this TestObserver has not received any onError event.
406406
* @return this;
407407
*/
408408
public final TestObserver<T> assertNoErrors() {
@@ -414,7 +414,7 @@ public final TestObserver<T> assertNoErrors() {
414414
}
415415

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

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

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

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

511511
/**
512-
* Assert that this TestSubscriber has not received any onNext events.
512+
* Assert that this TestObserver has not received any onNext events.
513513
* @return this;
514514
*/
515515
public final TestObserver<T> assertNoValues() {
516516
return assertValueCount(0);
517517
}
518518

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

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

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

601601
/**
602-
* Assert that the TestSubscriber terminated (i.e., the terminal latch reached zero).
602+
* Assert that the TestObserver terminated (i.e., the terminal latch reached zero).
603603
* @return this;
604604
*/
605605
public final TestObserver<T> assertTerminated() {
@@ -622,7 +622,7 @@ public final TestObserver<T> assertTerminated() {
622622
}
623623

624624
/**
625-
* Assert that the TestSubscriber has not terminated (i.e., the terminal latch is still non-zero).
625+
* Assert that the TestObserver has not terminated (i.e., the terminal latch is still non-zero).
626626
* @return this;
627627
*/
628628
public final TestObserver<T> assertNotTerminated() {
@@ -658,9 +658,9 @@ public final TestObserver<T> assertNotSubscribed() {
658658
}
659659

660660
/**
661-
* Waits until the any terminal event has been received by this TestSubscriber
661+
* Waits until the any terminal event has been received by this TestObserver
662662
* or returns false if the wait has been interrupted.
663-
* @return true if the TestSubscriber terminated, false if the wait has been interrupted
663+
* @return true if the TestObserver terminated, false if the wait has been interrupted
664664
*/
665665
public final boolean awaitTerminalEvent() {
666666
try {
@@ -673,11 +673,11 @@ public final boolean awaitTerminalEvent() {
673673
}
674674

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

865865
/**
866866
* Awaits until the internal latch is counted down.
867-
* <p>If the wait times out or gets interrupted, the TestSubscriber is cancelled.
867+
* <p>If the wait times out or gets interrupted, the TestObserver is cancelled.
868868
* @param time the waiting time
869869
* @param unit the time unit of the waiting time
870870
* @return this

0 commit comments

Comments
 (0)