ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/tck/ForkJoinPoolTest.java
(Generate patch)

Comparing jsr166/src/test/tck/ForkJoinPoolTest.java (file contents):
Revision 1.14 by jsr166, Tue Dec 1 06:47:14 2009 UTC vs.
Revision 1.15 by jsr166, Tue Dec 1 09:54:17 2009 UTC

# Line 903 | Line 903 | public class ForkJoinPoolTest extends JS
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      }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines