14 |
|
|
15 |
|
public class ScheduledExecutorTest extends JSR166TestCase { |
16 |
|
public static void main(String[] args) { |
17 |
< |
junit.textui.TestRunner.run (suite()); |
17 |
> |
junit.textui.TestRunner.run(suite()); |
18 |
|
} |
19 |
|
public static Test suite() { |
20 |
< |
return new TestSuite(ScheduledExecutorTest.class); |
20 |
> |
return new TestSuite(ScheduledExecutorTest.class); |
21 |
|
} |
22 |
|
|
23 |
|
|
25 |
|
* execute successfully executes a runnable |
26 |
|
*/ |
27 |
|
public void testExecute() throws InterruptedException { |
28 |
< |
TrackedShortRunnable runnable =new TrackedShortRunnable(); |
28 |
> |
TrackedShortRunnable runnable = new TrackedShortRunnable(); |
29 |
|
ScheduledThreadPoolExecutor p1 = new ScheduledThreadPoolExecutor(1); |
30 |
|
p1.execute(runnable); |
31 |
|
assertFalse(runnable.done); |
54 |
|
} |
55 |
|
|
56 |
|
/** |
57 |
< |
* delayed schedule of runnable successfully executes after delay |
57 |
> |
* delayed schedule of runnable successfully executes after delay |
58 |
|
*/ |
59 |
|
public void testSchedule3() throws InterruptedException { |
60 |
|
TrackedShortRunnable runnable = new TrackedShortRunnable(); |
137 |
|
|
138 |
|
|
139 |
|
/** |
140 |
< |
* execute (null) throws NPE |
140 |
> |
* execute(null) throws NPE |
141 |
|
*/ |
142 |
|
public void testExecuteNull() throws InterruptedException { |
143 |
|
ScheduledThreadPoolExecutor se = null; |
144 |
|
try { |
145 |
< |
se = new ScheduledThreadPoolExecutor(1); |
146 |
< |
se.execute(null); |
145 |
> |
se = new ScheduledThreadPoolExecutor(1); |
146 |
> |
se.execute(null); |
147 |
|
shouldThrow(); |
148 |
< |
} catch (NullPointerException success) {} |
148 |
> |
} catch (NullPointerException success) {} |
149 |
|
|
150 |
< |
joinPool(se); |
150 |
> |
joinPool(se); |
151 |
|
} |
152 |
|
|
153 |
|
/** |
154 |
< |
* schedule (null) throws NPE |
154 |
> |
* schedule(null) throws NPE |
155 |
|
*/ |
156 |
|
public void testScheduleNull() throws InterruptedException { |
157 |
|
ScheduledThreadPoolExecutor se = new ScheduledThreadPoolExecutor(1); |
158 |
< |
try { |
158 |
> |
try { |
159 |
|
TrackedCallable callable = null; |
160 |
< |
Future f = se.schedule(callable, SHORT_DELAY_MS, MILLISECONDS); |
160 |
> |
Future f = se.schedule(callable, SHORT_DELAY_MS, MILLISECONDS); |
161 |
|
shouldThrow(); |
162 |
< |
} catch (NullPointerException success) {} |
163 |
< |
joinPool(se); |
162 |
> |
} catch (NullPointerException success) {} |
163 |
> |
joinPool(se); |
164 |
|
} |
165 |
|
|
166 |
|
/** |
178 |
|
} |
179 |
|
|
180 |
|
joinPool(se); |
181 |
– |
|
181 |
|
} |
182 |
|
|
183 |
|
/** |
213 |
|
} |
214 |
|
|
215 |
|
/** |
216 |
< |
* scheduleAtFixedRate throws RejectedExecutionException if shutdown |
216 |
> |
* scheduleAtFixedRate throws RejectedExecutionException if shutdown |
217 |
|
*/ |
218 |
|
public void testScheduleAtFixedRate1_RejectedExecutionException() throws InterruptedException { |
219 |
|
ScheduledThreadPoolExecutor se = new ScheduledThreadPoolExecutor(1); |
245 |
|
} |
246 |
|
|
247 |
|
/** |
248 |
< |
* getActiveCount increases but doesn't overestimate, when a |
249 |
< |
* thread becomes active |
248 |
> |
* getActiveCount increases but doesn't overestimate, when a |
249 |
> |
* thread becomes active |
250 |
|
*/ |
251 |
|
public void testGetActiveCount() throws InterruptedException { |
252 |
|
ScheduledThreadPoolExecutor p2 = new ScheduledThreadPoolExecutor(2); |
258 |
|
} |
259 |
|
|
260 |
|
/** |
261 |
< |
* getCompletedTaskCount increases, but doesn't overestimate, |
262 |
< |
* when tasks complete |
261 |
> |
* getCompletedTaskCount increases, but doesn't overestimate, |
262 |
> |
* when tasks complete |
263 |
|
*/ |
264 |
|
public void testGetCompletedTaskCount() throws InterruptedException { |
265 |
|
ScheduledThreadPoolExecutor p2 = new ScheduledThreadPoolExecutor(2); |
271 |
|
} |
272 |
|
|
273 |
|
/** |
274 |
< |
* getCorePoolSize returns size given in constructor if not otherwise set |
274 |
> |
* getCorePoolSize returns size given in constructor if not otherwise set |
275 |
|
*/ |
276 |
|
public void testGetCorePoolSize() throws InterruptedException { |
277 |
|
ScheduledThreadPoolExecutor p1 = new ScheduledThreadPoolExecutor(1); |
280 |
|
} |
281 |
|
|
282 |
|
/** |
283 |
< |
* getLargestPoolSize increases, but doesn't overestimate, when |
284 |
< |
* multiple threads active |
283 |
> |
* getLargestPoolSize increases, but doesn't overestimate, when |
284 |
> |
* multiple threads active |
285 |
|
*/ |
286 |
|
public void testGetLargestPoolSize() throws InterruptedException { |
287 |
|
ScheduledThreadPoolExecutor p2 = new ScheduledThreadPoolExecutor(2); |
294 |
|
} |
295 |
|
|
296 |
|
/** |
297 |
< |
* getPoolSize increases, but doesn't overestimate, when threads |
298 |
< |
* become active |
297 |
> |
* getPoolSize increases, but doesn't overestimate, when threads |
298 |
> |
* become active |
299 |
|
*/ |
300 |
|
public void testGetPoolSize() throws InterruptedException { |
301 |
|
ScheduledThreadPoolExecutor p1 = new ScheduledThreadPoolExecutor(1); |
306 |
|
} |
307 |
|
|
308 |
|
/** |
309 |
< |
* getTaskCount increases, but doesn't overestimate, when tasks |
310 |
< |
* submitted |
309 |
> |
* getTaskCount increases, but doesn't overestimate, when tasks |
310 |
> |
* submitted |
311 |
|
*/ |
312 |
|
public void testGetTaskCount() throws InterruptedException { |
313 |
|
ScheduledThreadPoolExecutor p1 = new ScheduledThreadPoolExecutor(1); |
324 |
|
*/ |
325 |
|
public void testGetThreadFactory() throws InterruptedException { |
326 |
|
ThreadFactory tf = new SimpleThreadFactory(); |
327 |
< |
ScheduledThreadPoolExecutor p = new ScheduledThreadPoolExecutor(1, tf); |
327 |
> |
ScheduledThreadPoolExecutor p = new ScheduledThreadPoolExecutor(1, tf); |
328 |
|
assertSame(tf, p.getThreadFactory()); |
329 |
|
joinPool(p); |
330 |
|
} |
334 |
|
*/ |
335 |
|
public void testSetThreadFactory() throws InterruptedException { |
336 |
|
ThreadFactory tf = new SimpleThreadFactory(); |
337 |
< |
ScheduledThreadPoolExecutor p = new ScheduledThreadPoolExecutor(1); |
337 |
> |
ScheduledThreadPoolExecutor p = new ScheduledThreadPoolExecutor(1); |
338 |
|
p.setThreadFactory(tf); |
339 |
|
assertSame(tf, p.getThreadFactory()); |
340 |
|
joinPool(p); |
344 |
|
* setThreadFactory(null) throws NPE |
345 |
|
*/ |
346 |
|
public void testSetThreadFactoryNull() throws InterruptedException { |
347 |
< |
ScheduledThreadPoolExecutor p = new ScheduledThreadPoolExecutor(1); |
347 |
> |
ScheduledThreadPoolExecutor p = new ScheduledThreadPoolExecutor(1); |
348 |
|
try { |
349 |
|
p.setThreadFactory(null); |
350 |
|
shouldThrow(); |
355 |
|
} |
356 |
|
|
357 |
|
/** |
358 |
< |
* is isShutDown is false before shutdown, true after |
358 |
> |
* isShutDown is false before shutdown, true after |
359 |
|
*/ |
360 |
|
public void testIsShutdown() { |
361 |
|
|
362 |
< |
ScheduledThreadPoolExecutor p1 = new ScheduledThreadPoolExecutor(1); |
362 |
> |
ScheduledThreadPoolExecutor p1 = new ScheduledThreadPoolExecutor(1); |
363 |
|
try { |
364 |
|
assertFalse(p1.isShutdown()); |
365 |
|
} |
366 |
|
finally { |
367 |
|
try { p1.shutdown(); } catch (SecurityException ok) { return; } |
368 |
|
} |
369 |
< |
assertTrue(p1.isShutdown()); |
369 |
> |
assertTrue(p1.isShutdown()); |
370 |
|
} |
371 |
|
|
372 |
|
|
373 |
|
/** |
374 |
< |
* isTerminated is false before termination, true after |
374 |
> |
* isTerminated is false before termination, true after |
375 |
|
*/ |
376 |
|
public void testIsTerminated() throws InterruptedException { |
377 |
< |
ScheduledThreadPoolExecutor p1 = new ScheduledThreadPoolExecutor(1); |
377 |
> |
ScheduledThreadPoolExecutor p1 = new ScheduledThreadPoolExecutor(1); |
378 |
|
try { |
379 |
|
p1.execute(new SmallRunnable()); |
380 |
|
} finally { |
385 |
|
} |
386 |
|
|
387 |
|
/** |
388 |
< |
* isTerminating is not true when running or when terminated |
388 |
> |
* isTerminating is not true when running or when terminated |
389 |
|
*/ |
390 |
|
public void testIsTerminating() throws InterruptedException { |
391 |
< |
ScheduledThreadPoolExecutor p1 = new ScheduledThreadPoolExecutor(1); |
391 |
> |
ScheduledThreadPoolExecutor p1 = new ScheduledThreadPoolExecutor(1); |
392 |
|
assertFalse(p1.isTerminating()); |
393 |
|
try { |
394 |
|
p1.execute(new SmallRunnable()); |
448 |
|
} |
449 |
|
|
450 |
|
/** |
451 |
< |
* purge removes cancelled tasks from the queue |
451 |
> |
* purge removes cancelled tasks from the queue |
452 |
|
*/ |
453 |
|
public void testPurge() throws InterruptedException { |
454 |
|
ScheduledThreadPoolExecutor p1 = new ScheduledThreadPoolExecutor(1); |
477 |
|
} |
478 |
|
|
479 |
|
/** |
480 |
< |
* shutDownNow returns a list containing tasks that were not run |
480 |
> |
* shutDownNow returns a list containing tasks that were not run |
481 |
|
*/ |
482 |
|
public void testShutDownNow() throws InterruptedException { |
483 |
< |
ScheduledThreadPoolExecutor p1 = new ScheduledThreadPoolExecutor(1); |
483 |
> |
ScheduledThreadPoolExecutor p1 = new ScheduledThreadPoolExecutor(1); |
484 |
|
for (int i = 0; i < 5; i++) |
485 |
|
p1.schedule(new SmallPossiblyInterruptedRunnable(), SHORT_DELAY_MS, MILLISECONDS); |
486 |
|
List l; |
489 |
|
} catch (SecurityException ok) { |
490 |
|
return; |
491 |
|
} |
492 |
< |
assertTrue(p1.isShutdown()); |
493 |
< |
assertTrue(l.size() > 0 && l.size() <= 5); |
492 |
> |
assertTrue(p1.isShutdown()); |
493 |
> |
assertTrue(l.size() > 0 && l.size() <= 5); |
494 |
|
joinPool(p1); |
495 |
|
} |
496 |
|
|
658 |
|
* invokeAny(c) throws NPE if c has null elements |
659 |
|
*/ |
660 |
|
public void testInvokeAny3() throws Exception { |
661 |
< |
final CountDownLatch latch = new CountDownLatch(1); |
661 |
> |
CountDownLatch latch = new CountDownLatch(1); |
662 |
|
ExecutorService e = new ScheduledThreadPoolExecutor(2); |
663 |
+ |
List<Callable<String>> l = new ArrayList<Callable<String>>(); |
664 |
+ |
l.add(latchAwaitingStringTask(latch)); |
665 |
+ |
l.add(null); |
666 |
|
try { |
665 |
– |
ArrayList<Callable<String>> l = new ArrayList<Callable<String>>(); |
666 |
– |
l.add(new Callable<String>() { |
667 |
– |
public String call() { |
668 |
– |
try { |
669 |
– |
latch.await(); |
670 |
– |
} catch (InterruptedException ok) {} |
671 |
– |
return TEST_STRING; |
672 |
– |
}}); |
673 |
– |
l.add(null); |
667 |
|
e.invokeAny(l); |
668 |
|
shouldThrow(); |
669 |
|
} catch (NullPointerException success) { |
678 |
|
*/ |
679 |
|
public void testInvokeAny4() throws Exception { |
680 |
|
ExecutorService e = new ScheduledThreadPoolExecutor(2); |
681 |
+ |
List<Callable<String>> l = new ArrayList<Callable<String>>(); |
682 |
+ |
l.add(new NPETask()); |
683 |
|
try { |
689 |
– |
ArrayList<Callable<String>> l = new ArrayList<Callable<String>>(); |
690 |
– |
l.add(new NPETask()); |
684 |
|
e.invokeAny(l); |
685 |
|
shouldThrow(); |
686 |
|
} catch (ExecutionException success) { |
696 |
|
public void testInvokeAny5() throws Exception { |
697 |
|
ExecutorService e = new ScheduledThreadPoolExecutor(2); |
698 |
|
try { |
699 |
< |
ArrayList<Callable<String>> l = new ArrayList<Callable<String>>(); |
699 |
> |
List<Callable<String>> l = new ArrayList<Callable<String>>(); |
700 |
|
l.add(new StringTask()); |
701 |
|
l.add(new StringTask()); |
702 |
|
String result = e.invokeAny(l); |
738 |
|
*/ |
739 |
|
public void testInvokeAll3() throws Exception { |
740 |
|
ExecutorService e = new ScheduledThreadPoolExecutor(2); |
741 |
+ |
List<Callable<String>> l = new ArrayList<Callable<String>>(); |
742 |
+ |
l.add(new StringTask()); |
743 |
+ |
l.add(null); |
744 |
|
try { |
749 |
– |
ArrayList<Callable<String>> l = new ArrayList<Callable<String>>(); |
750 |
– |
l.add(new StringTask()); |
751 |
– |
l.add(null); |
745 |
|
e.invokeAll(l); |
746 |
|
shouldThrow(); |
747 |
|
} catch (NullPointerException success) { |
755 |
|
*/ |
756 |
|
public void testInvokeAll4() throws Exception { |
757 |
|
ExecutorService e = new ScheduledThreadPoolExecutor(2); |
758 |
+ |
List<Callable<String>> l = new ArrayList<Callable<String>>(); |
759 |
+ |
l.add(new NPETask()); |
760 |
+ |
List<Future<String>> futures = e.invokeAll(l); |
761 |
+ |
assertEquals(1, futures.size()); |
762 |
|
try { |
763 |
< |
ArrayList<Callable<String>> l = new ArrayList<Callable<String>>(); |
767 |
< |
l.add(new NPETask()); |
768 |
< |
List<Future<String>> result = e.invokeAll(l); |
769 |
< |
assertEquals(1, result.size()); |
770 |
< |
for (Future<String> future : result) |
771 |
< |
future.get(); |
763 |
> |
futures.get(0).get(); |
764 |
|
shouldThrow(); |
765 |
|
} catch (ExecutionException success) { |
766 |
|
assertTrue(success.getCause() instanceof NullPointerException); |
775 |
|
public void testInvokeAll5() throws Exception { |
776 |
|
ExecutorService e = new ScheduledThreadPoolExecutor(2); |
777 |
|
try { |
778 |
< |
ArrayList<Callable<String>> l = new ArrayList<Callable<String>>(); |
778 |
> |
List<Callable<String>> l = new ArrayList<Callable<String>>(); |
779 |
|
l.add(new StringTask()); |
780 |
|
l.add(new StringTask()); |
781 |
< |
List<Future<String>> result = e.invokeAll(l); |
782 |
< |
assertEquals(2, result.size()); |
783 |
< |
for (Future<String> future : result) |
781 |
> |
List<Future<String>> futures = e.invokeAll(l); |
782 |
> |
assertEquals(2, futures.size()); |
783 |
> |
for (Future<String> future : futures) |
784 |
|
assertSame(TEST_STRING, future.get()); |
785 |
|
} finally { |
786 |
|
joinPool(e); |
806 |
|
*/ |
807 |
|
public void testTimedInvokeAnyNullTimeUnit() throws Exception { |
808 |
|
ExecutorService e = new ScheduledThreadPoolExecutor(2); |
809 |
+ |
List<Callable<String>> l = new ArrayList<Callable<String>>(); |
810 |
+ |
l.add(new StringTask()); |
811 |
|
try { |
818 |
– |
ArrayList<Callable<String>> l = new ArrayList<Callable<String>>(); |
819 |
– |
l.add(new StringTask()); |
812 |
|
e.invokeAny(l, MEDIUM_DELAY_MS, null); |
813 |
|
shouldThrow(); |
814 |
|
} catch (NullPointerException success) { |
835 |
|
* timed invokeAny(c) throws NPE if c has null elements |
836 |
|
*/ |
837 |
|
public void testTimedInvokeAny3() throws Exception { |
838 |
< |
final CountDownLatch latch = new CountDownLatch(1); |
838 |
> |
CountDownLatch latch = new CountDownLatch(1); |
839 |
|
ExecutorService e = new ScheduledThreadPoolExecutor(2); |
840 |
+ |
List<Callable<String>> l = new ArrayList<Callable<String>>(); |
841 |
+ |
l.add(latchAwaitingStringTask(latch)); |
842 |
+ |
l.add(null); |
843 |
|
try { |
849 |
– |
ArrayList<Callable<String>> l = new ArrayList<Callable<String>>(); |
850 |
– |
l.add(new Callable<String>() { |
851 |
– |
public String call() { |
852 |
– |
try { |
853 |
– |
latch.await(); |
854 |
– |
} catch (InterruptedException ok) {} |
855 |
– |
return TEST_STRING; |
856 |
– |
}}); |
857 |
– |
l.add(null); |
844 |
|
e.invokeAny(l, MEDIUM_DELAY_MS, MILLISECONDS); |
845 |
|
shouldThrow(); |
846 |
|
} catch (NullPointerException success) { |
855 |
|
*/ |
856 |
|
public void testTimedInvokeAny4() throws Exception { |
857 |
|
ExecutorService e = new ScheduledThreadPoolExecutor(2); |
858 |
+ |
List<Callable<String>> l = new ArrayList<Callable<String>>(); |
859 |
+ |
l.add(new NPETask()); |
860 |
|
try { |
873 |
– |
ArrayList<Callable<String>> l = new ArrayList<Callable<String>>(); |
874 |
– |
l.add(new NPETask()); |
861 |
|
e.invokeAny(l, MEDIUM_DELAY_MS, MILLISECONDS); |
862 |
|
shouldThrow(); |
863 |
|
} catch (ExecutionException success) { |
873 |
|
public void testTimedInvokeAny5() throws Exception { |
874 |
|
ExecutorService e = new ScheduledThreadPoolExecutor(2); |
875 |
|
try { |
876 |
< |
ArrayList<Callable<String>> l = new ArrayList<Callable<String>>(); |
876 |
> |
List<Callable<String>> l = new ArrayList<Callable<String>>(); |
877 |
|
l.add(new StringTask()); |
878 |
|
l.add(new StringTask()); |
879 |
|
String result = e.invokeAny(l, MEDIUM_DELAY_MS, MILLISECONDS); |
902 |
|
*/ |
903 |
|
public void testTimedInvokeAllNullTimeUnit() throws Exception { |
904 |
|
ExecutorService e = new ScheduledThreadPoolExecutor(2); |
905 |
+ |
List<Callable<String>> l = new ArrayList<Callable<String>>(); |
906 |
+ |
l.add(new StringTask()); |
907 |
|
try { |
920 |
– |
ArrayList<Callable<String>> l = new ArrayList<Callable<String>>(); |
921 |
– |
l.add(new StringTask()); |
908 |
|
e.invokeAll(l, MEDIUM_DELAY_MS, null); |
909 |
|
shouldThrow(); |
910 |
|
} catch (NullPointerException success) { |
931 |
|
*/ |
932 |
|
public void testTimedInvokeAll3() throws Exception { |
933 |
|
ExecutorService e = new ScheduledThreadPoolExecutor(2); |
934 |
+ |
List<Callable<String>> l = new ArrayList<Callable<String>>(); |
935 |
+ |
l.add(new StringTask()); |
936 |
+ |
l.add(null); |
937 |
|
try { |
949 |
– |
ArrayList<Callable<String>> l = new ArrayList<Callable<String>>(); |
950 |
– |
l.add(new StringTask()); |
951 |
– |
l.add(null); |
938 |
|
e.invokeAll(l, MEDIUM_DELAY_MS, MILLISECONDS); |
939 |
|
shouldThrow(); |
940 |
|
} catch (NullPointerException success) { |
948 |
|
*/ |
949 |
|
public void testTimedInvokeAll4() throws Exception { |
950 |
|
ExecutorService e = new ScheduledThreadPoolExecutor(2); |
951 |
+ |
List<Callable<String>> l = new ArrayList<Callable<String>>(); |
952 |
+ |
l.add(new NPETask()); |
953 |
+ |
List<Future<String>> futures = |
954 |
+ |
e.invokeAll(l, MEDIUM_DELAY_MS, MILLISECONDS); |
955 |
+ |
assertEquals(1, futures.size()); |
956 |
|
try { |
957 |
< |
ArrayList<Callable<String>> l = new ArrayList<Callable<String>>(); |
967 |
< |
l.add(new NPETask()); |
968 |
< |
List<Future<String>> result = e.invokeAll(l, MEDIUM_DELAY_MS, MILLISECONDS); |
969 |
< |
assertEquals(1, result.size()); |
970 |
< |
for (Future<String> future : result) |
971 |
< |
future.get(); |
957 |
> |
futures.get(0).get(); |
958 |
|
shouldThrow(); |
959 |
|
} catch (ExecutionException success) { |
960 |
|
assertTrue(success.getCause() instanceof NullPointerException); |
969 |
|
public void testTimedInvokeAll5() throws Exception { |
970 |
|
ExecutorService e = new ScheduledThreadPoolExecutor(2); |
971 |
|
try { |
972 |
< |
ArrayList<Callable<String>> l = new ArrayList<Callable<String>>(); |
972 |
> |
List<Callable<String>> l = new ArrayList<Callable<String>>(); |
973 |
|
l.add(new StringTask()); |
974 |
|
l.add(new StringTask()); |
975 |
< |
List<Future<String>> result = e.invokeAll(l, MEDIUM_DELAY_MS, MILLISECONDS); |
976 |
< |
assertEquals(2, result.size()); |
977 |
< |
for (Future<String> future : result) |
975 |
> |
List<Future<String>> futures = |
976 |
> |
e.invokeAll(l, MEDIUM_DELAY_MS, MILLISECONDS); |
977 |
> |
assertEquals(2, futures.size()); |
978 |
> |
for (Future<String> future : futures) |
979 |
|
assertSame(TEST_STRING, future.get()); |
980 |
|
} finally { |
981 |
|
joinPool(e); |
988 |
|
public void testTimedInvokeAll6() throws Exception { |
989 |
|
ExecutorService e = new ScheduledThreadPoolExecutor(2); |
990 |
|
try { |
991 |
< |
ArrayList<Callable<String>> l = new ArrayList<Callable<String>>(); |
991 |
> |
List<Callable<String>> l = new ArrayList<Callable<String>>(); |
992 |
|
l.add(new StringTask()); |
993 |
|
l.add(Executors.callable(new MediumPossiblyInterruptedRunnable(), TEST_STRING)); |
994 |
|
l.add(new StringTask()); |
995 |
< |
List<Future<String>> result = e.invokeAll(l, SHORT_DELAY_MS, MILLISECONDS); |
996 |
< |
assertEquals(3, result.size()); |
997 |
< |
Iterator<Future<String>> it = result.iterator(); |
995 |
> |
List<Future<String>> futures = |
996 |
> |
e.invokeAll(l, SHORT_DELAY_MS, MILLISECONDS); |
997 |
> |
assertEquals(3, futures.size()); |
998 |
> |
Iterator<Future<String>> it = futures.iterator(); |
999 |
|
Future<String> f1 = it.next(); |
1000 |
|
Future<String> f2 = it.next(); |
1001 |
|
Future<String> f3 = it.next(); |