1 |
|
/* |
2 |
|
* Written by Doug Lea with assistance from members of JCP JSR-166 |
3 |
|
* Expert Group and released to the public domain, as explained at |
4 |
< |
* http://creativecommons.org/licenses/publicdomain |
4 |
> |
* http://creativecommons.org/publicdomain/zero/1.0/ |
5 |
|
* Other contributors include Andrew Wright, Jeffrey Hayes, |
6 |
|
* Pat Fisher, Mike Judd. |
7 |
|
*/ |
589 |
|
try { |
590 |
|
List<Callable<String>> l = new ArrayList<Callable<String>>(); |
591 |
|
l.add(new StringTask()); |
592 |
< |
l.add(Executors.callable(new MediumPossiblyInterruptedRunnable(), TEST_STRING)); |
592 |
> |
l.add(Executors.callable(possiblyInterruptedRunnable(2 * SHORT_DELAY_MS), TEST_STRING)); |
593 |
|
l.add(new StringTask()); |
594 |
|
List<Future<String>> futures = |
595 |
< |
e.invokeAll(l, SMALL_DELAY_MS, MILLISECONDS); |
595 |
> |
e.invokeAll(l, SHORT_DELAY_MS, MILLISECONDS); |
596 |
|
assertEquals(3, futures.size()); |
597 |
|
Iterator<Future<String>> it = futures.iterator(); |
598 |
|
Future<String> f1 = it.next(); |
601 |
|
assertTrue(f1.isDone()); |
602 |
|
assertFalse(f1.isCancelled()); |
603 |
|
assertTrue(f2.isDone()); |
604 |
+ |
assertFalse(f2.isCancelled()); |
605 |
|
assertTrue(f3.isDone()); |
606 |
|
assertTrue(f3.isCancelled()); |
607 |
|
} finally { |