File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
extensions/rxjava-swing/src/main/java/rx/concurrency Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change 15
15
*/
16
16
package rx .concurrency ;
17
17
18
+ import static org .junit .Assert .assertTrue ;
18
19
import static org .mockito .Mockito .*;
19
20
20
21
import java .awt .EventQueue ;
23
24
import java .util .concurrent .TimeUnit ;
24
25
import java .util .concurrent .atomic .AtomicReference ;
25
26
27
+ import javax .swing .SwingUtilities ;
26
28
import javax .swing .Timer ;
27
29
28
30
import org .junit .Rule ;
@@ -187,6 +189,7 @@ public void testPeriodicScheduling() throws Exception {
187
189
@ Override
188
190
public Subscription call () {
189
191
innerAction .call ();
192
+ assertTrue (SwingUtilities .isEventDispatchThread ());
190
193
return Subscriptions .create (unsubscribe );
191
194
}
192
195
};
@@ -215,13 +218,15 @@ public void testNestedActions() throws Exception {
215
218
final Action0 firstAction = new Action0 () {
216
219
@ Override
217
220
public void call () {
221
+ assertTrue (SwingUtilities .isEventDispatchThread ());
218
222
firstStepStart .call ();
219
223
firstStepEnd .call ();
220
224
}
221
225
};
222
226
final Action0 secondAction = new Action0 () {
223
227
@ Override
224
228
public void call () {
229
+ assertTrue (SwingUtilities .isEventDispatchThread ());
225
230
secondStepStart .call ();
226
231
scheduler .schedule (firstAction );
227
232
secondStepEnd .call ();
@@ -230,6 +235,7 @@ public void call() {
230
235
final Action0 thirdAction = new Action0 () {
231
236
@ Override
232
237
public void call () {
238
+ assertTrue (SwingUtilities .isEventDispatchThread ());
233
239
thirdStepStart .call ();
234
240
scheduler .schedule (secondAction );
235
241
thirdStepEnd .call ();
You can’t perform that action at this time.
0 commit comments