24
24
import rx .Subscriber ;
25
25
26
26
/**
27
- * Subscriber usable for unit testing to perform assertions, inspect received events, or wrap a mocked
28
- * Subscriber.
27
+ * A {@code TestSubscriber} is a variety of {@link Subscriber} that you can use for unit testing, to perform
28
+ * assertions, inspect received events, or wrap a mocked {@code Subscriber} .
29
29
*/
30
30
public class TestSubscriber <T > extends Subscriber <T > {
31
31
@@ -73,8 +73,8 @@ public void onCompleted() {
73
73
}
74
74
75
75
/**
76
- * Get the {@link Notification}s representing each time this Subscriber was notified of sequence completion
77
- * via {@link #onCompleted}, as a {@link List}.
76
+ * Get the {@link Notification}s representing each time this {@link Subscriber} was notified of sequence
77
+ * completion via {@link #onCompleted}, as a {@link List}.
78
78
*
79
79
* @return a list of Notifications representing calls to this Subscriber's {@link #onCompleted} method
80
80
*/
@@ -93,7 +93,8 @@ public void onError(Throwable e) {
93
93
}
94
94
95
95
/**
96
- * Get the {@link Throwable}s this Subscriber was notified of via {@link #onError} as a {@link List}.
96
+ * Get the {@link Throwable}s this {@link Subscriber} was notified of via {@link #onError} as a
97
+ * {@link List}.
97
98
*
98
99
* @return a list of the Throwables that were passed to this Subscriber's {@link #onError} method
99
100
*/
@@ -109,14 +110,16 @@ public void onNext(T t) {
109
110
110
111
/**
111
112
* Allow calling the protected {@link #request(long)} from unit tests.
113
+ *
112
114
* @param n
115
+ * @warn parameter "n" not described
113
116
*/
114
117
public void requestMore (long n ) {
115
118
request (n );
116
119
}
117
120
118
121
/**
119
- * Get the sequence of items observed by this Subscriber, as an ordered {@link List}.
122
+ * Get the sequence of items observed by this {@link Subscriber} , as an ordered {@link List}.
120
123
*
121
124
* @return a list of items observed by this Subscriber, in the order in which they were observed
122
125
*/
@@ -125,7 +128,7 @@ public List<T> getOnNextEvents() {
125
128
}
126
129
127
130
/**
128
- * Assert that a particular sequence of items was received by this Subscriber in order.
131
+ * Assert that a particular sequence of items was received by this {@link Subscriber} in order.
129
132
*
130
133
* @param items
131
134
* the sequence of items expected to have been observed
@@ -174,8 +177,8 @@ public void assertNoErrors() {
174
177
175
178
176
179
/**
177
- * Blocks until this Subscriber receives a notification that the Observable is complete (either an
178
- * {@code onCompleted} or {@code onError} notification).
180
+ * Blocks until this {@link Subscriber} receives a notification that the {@code Observable} is complete
181
+ * (either an {@code onCompleted} or {@code onError} notification).
179
182
*
180
183
* @throws RuntimeException
181
184
* if the Subscriber is interrupted before the Observable is able to complete
@@ -189,8 +192,8 @@ public void awaitTerminalEvent() {
189
192
}
190
193
191
194
/**
192
- * Blocks until this Subscriber receives a notification that the Observable is complete (either an
193
- * {@code onCompleted} or {@code onError} notification), or until a timeout expires.
195
+ * Blocks until this {@link Subscriber} receives a notification that the {@code Observable} is complete
196
+ * (either an {@code onCompleted} or {@code onError} notification), or until a timeout expires.
194
197
*
195
198
* @param timeout
196
199
* the duration of the timeout
@@ -208,10 +211,10 @@ public void awaitTerminalEvent(long timeout, TimeUnit unit) {
208
211
}
209
212
210
213
/**
211
- * Blocks until this Subscriber receives a notification that the Observable is complete (either an
212
- * {@code onCompleted} or {@code onError} notification), or until a timeout expires; if the Subscriber
213
- * is interrupted before either of these events take place, this method unsubscribes the Subscriber from the
214
- * Observable).
214
+ * Blocks until this {@link Subscriber} receives a notification that the {@code Observable} is complete
215
+ * (either an {@code onCompleted} or {@code onError} notification), or until a timeout expires; if the
216
+ * Subscriber is interrupted before either of these events take place, this method unsubscribes the
217
+ * Subscriber from the Observable).
215
218
*
216
219
* @param timeout
217
220
* the duration of the timeout
@@ -227,7 +230,8 @@ public void awaitTerminalEventAndUnsubscribeOnTimeout(long timeout, TimeUnit uni
227
230
}
228
231
229
232
/**
230
- * Returns the last thread that was in use when an item or notification was received by this Subscriber.
233
+ * Returns the last thread that was in use when an item or notification was received by this
234
+ * {@link Subscriber}.
231
235
*
232
236
* @return the {@code Thread} on which this Subscriber last received an item or notification from the
233
237
* Observable it is subscribed to
0 commit comments