903 |
|
* timed invokeAny(c) throws NullPointerException if c has null elements |
904 |
|
*/ |
905 |
|
public void testTimedInvokeAny3() throws Throwable { |
906 |
+ |
final CountDownLatch latch = new CountDownLatch(1); |
907 |
|
ExecutorService e = new ForkJoinPool(1); |
908 |
|
try { |
909 |
|
ArrayList<Callable<String>> l = new ArrayList<Callable<String>>(); |
910 |
< |
l.add(new StringTask()); |
910 |
> |
l.add(new Callable<String>() { |
911 |
> |
public String call() { |
912 |
> |
try { |
913 |
> |
latch.await(); |
914 |
> |
} catch (InterruptedException ok) {} |
915 |
> |
return TEST_STRING; |
916 |
> |
}}); |
917 |
|
l.add(null); |
918 |
|
e.invokeAny(l, MEDIUM_DELAY_MS, MILLISECONDS); |
919 |
|
shouldThrow(); |
920 |
|
} catch (NullPointerException success) { |
921 |
|
} finally { |
922 |
+ |
latch.countDown(); |
923 |
|
joinPool(e); |
924 |
|
} |
925 |
|
} |