Skip to content

Commit 2b4fc37

Browse files
Fixed TestSubject bug in onNext
1 parent 69d6aaf commit 2b4fc37

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/main/java/rx/subjects/TestSubject.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
*/
1616
package rx.subjects;
1717

18-
import java.util.concurrent.TimeUnit;
19-
2018
import rx.Observer;
2119
import rx.Scheduler;
2220
import rx.functions.Action0;
@@ -25,6 +23,8 @@
2523
import rx.schedulers.TestScheduler;
2624
import rx.subjects.SubjectSubscriptionManager.SubjectObserver;
2725

26+
import java.util.concurrent.TimeUnit;
27+
2828
/**
2929
* A variety of Subject that is useful for testing purposes. It operates on a {@link TestScheduler} and allows
3030
* you to precisely time emissions and notifications to the Subject's subscribers using relative virtual time
@@ -136,11 +136,11 @@ public void call() {
136136
}
137137

138138
/**
139-
* Schedule a call to {@code onNext} at relative time of "now()" on TestScheduler.
139+
* Schedule a call to {@code onNext} on TestScheduler.
140140
*/
141141
@Override
142142
public void onNext(T v) {
143-
onNext(v, innerScheduler.now());
143+
onNext(v, 0);
144144
}
145145

146146
private void _onNext(T v) {
@@ -154,18 +154,18 @@ private void _onNext(T v) {
154154
*
155155
* @param v
156156
* the item to emit
157-
* @param timeInMilliseconds
157+
* @param delayTime
158158
* the number of milliseconds in the future relative to "now()" at which to call {@code onNext}
159159
*/
160-
public void onNext(final T v, long timeInMilliseconds) {
160+
public void onNext(final T v, long delayTime) {
161161
innerScheduler.schedule(new Action0() {
162162

163163
@Override
164164
public void call() {
165165
_onNext(v);
166166
}
167167

168-
}, timeInMilliseconds, TimeUnit.MILLISECONDS);
168+
}, delayTime, TimeUnit.MILLISECONDS);
169169
}
170170

171171
@Override

0 commit comments

Comments
 (0)