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.25 by jsr166, Mon Sep 13 20:48:58 2010 UTC vs.
Revision 1.43 by jsr166, Sun May 29 13:45:35 2011 UTC

# Line 1 | Line 1
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   */
6  
7   import junit.framework.*;
# Line 22 | Line 22 | import java.util.concurrent.ForkJoinTask
22   import java.util.concurrent.ForkJoinWorkerThread;
23   import java.util.concurrent.RecursiveTask;
24   import java.util.concurrent.TimeUnit;
25 + import java.util.concurrent.atomic.AtomicBoolean;
26   import java.util.concurrent.locks.ReentrantLock;
27 + import static java.util.concurrent.TimeUnit.MILLISECONDS;
28   import java.security.AccessControlException;
29   import java.security.Policy;
30   import java.security.PrivilegedAction;
# Line 161 | Line 163 | public class ForkJoinPoolTest extends JS
163      public void testDefaultInitialState() {
164          ForkJoinPool p = new ForkJoinPool(1);
165          try {
166 <            assertTrue(p.getFactory() ==
167 <                       ForkJoinPool.defaultForkJoinWorkerThreadFactory);
166 <            assertTrue(p.isQuiescent());
166 >            assertSame(ForkJoinPool.defaultForkJoinWorkerThreadFactory,
167 >                       p.getFactory());
168              assertFalse(p.getAsyncMode());
169 <            assertTrue(p.getActiveThreadCount() == 0);
170 <            assertTrue(p.getStealCount() == 0);
171 <            assertTrue(p.getQueuedTaskCount() == 0);
172 <            assertTrue(p.getQueuedSubmissionCount() == 0);
169 >            assertEquals(0, p.getActiveThreadCount());
170 >            assertEquals(0, p.getStealCount());
171 >            assertEquals(0, p.getQueuedTaskCount());
172 >            assertEquals(0, p.getQueuedSubmissionCount());
173              assertFalse(p.hasQueuedSubmissions());
174              assertFalse(p.isShutdown());
175              assertFalse(p.isTerminating());
# Line 198 | Line 199 | public class ForkJoinPoolTest extends JS
199          } catch (NullPointerException success) {}
200      }
201  
201
202      /**
203       * getParallelism returns size set in constructor
204       */
205      public void testGetParallelism() {
206          ForkJoinPool p = new ForkJoinPool(1);
207          try {
208 <            assertTrue(p.getParallelism() == 1);
208 >            assertEquals(1, p.getParallelism());
209          } finally {
210              joinPool(p);
211          }
# Line 217 | Line 217 | public class ForkJoinPoolTest extends JS
217      public void testGetPoolSize() {
218          ForkJoinPool p = new ForkJoinPool(1);
219          try {
220 <            assertTrue(p.getActiveThreadCount() == 0);
220 >            assertEquals(0, p.getActiveThreadCount());
221              Future<String> future = p.submit(new StringTask());
222 <            assertTrue(p.getPoolSize() == 1);
222 >            assertEquals(1, p.getPoolSize());
223          } finally {
224              joinPool(p);
225          }
# Line 232 | Line 232 | public class ForkJoinPoolTest extends JS
232       * performs its defined action
233       */
234      public void testSetUncaughtExceptionHandler() throws InterruptedException {
235 <        MyHandler eh = new MyHandler();
236 <        ForkJoinPool p = new ForkJoinPool(1, new FailingThreadFactory(), eh, false);
237 <        try {
238 <            assert(eh == p.getUncaughtExceptionHandler());
239 <            p.execute(new FailingTask());
240 <            Thread.sleep(MEDIUM_DELAY_MS);
241 <            assertTrue(eh.catches > 0);
235 >        final CountDownLatch uehInvoked = new CountDownLatch(1);
236 >        final Thread.UncaughtExceptionHandler eh =
237 >            new Thread.UncaughtExceptionHandler() {
238 >                public void uncaughtException(Thread t, Throwable e) {
239 >                    uehInvoked.countDown();
240 >                }};
241 >        ForkJoinPool p = new ForkJoinPool(1, new FailingThreadFactory(),
242 >                                          eh, false);
243 >        try {
244 >            assertSame(eh, p.getUncaughtExceptionHandler());
245 >            p.execute(new FibTask(8));
246 >            assertTrue(uehInvoked.await(MEDIUM_DELAY_MS, MILLISECONDS));
247          } finally {
248 <            p.shutdownNow();
248 >            p.shutdownNow(); // failure might have prevented processing task
249              joinPool(p);
250          }
251      }
252  
253      /**
254 <     * After invoking a single task, isQuiescent is true,
255 <     * queues are empty, threads are not active, and
256 <     * construction parameters continue to hold
254 >     * After invoking a single task, isQuiescent eventually becomes
255 >     * true, at which time queues are empty, threads are not active,
256 >     * the task has completed successfully, and construction
257 >     * parameters continue to hold
258       */
259 <    public void testisQuiescent() throws InterruptedException {
259 >    public void testIsQuiescent() throws Exception {
260          ForkJoinPool p = new ForkJoinPool(2);
261          try {
262 <            p.invoke(new FibTask(20));
263 <            assertTrue(p.getFactory() ==
264 <                       ForkJoinPool.defaultForkJoinWorkerThreadFactory);
265 <            Thread.sleep(MEDIUM_DELAY_MS);
262 >            assertTrue(p.isQuiescent());
263 >            long startTime = System.nanoTime();
264 >            FibTask f = new FibTask(20);
265 >            p.invoke(f);
266 >            assertSame(ForkJoinPool.defaultForkJoinWorkerThreadFactory,
267 >                       p.getFactory());
268 >            while (! p.isQuiescent()) {
269 >                if (millisElapsedSince(startTime) > LONG_DELAY_MS)
270 >                    throw new AssertionFailedError("timed out");
271 >                assertFalse(p.getAsyncMode());
272 >                assertFalse(p.isShutdown());
273 >                assertFalse(p.isTerminating());
274 >                assertFalse(p.isTerminated());
275 >                Thread.yield();
276 >            }
277 >
278              assertTrue(p.isQuiescent());
279              assertFalse(p.getAsyncMode());
280 <            assertTrue(p.getActiveThreadCount() == 0);
281 <            assertTrue(p.getQueuedTaskCount() == 0);
282 <            assertTrue(p.getQueuedSubmissionCount() == 0);
280 >            assertEquals(0, p.getActiveThreadCount());
281 >            assertEquals(0, p.getQueuedTaskCount());
282 >            assertEquals(0, p.getQueuedSubmissionCount());
283              assertFalse(p.hasQueuedSubmissions());
284              assertFalse(p.isShutdown());
285              assertFalse(p.isTerminating());
286              assertFalse(p.isTerminated());
287 +            assertTrue(f.isDone());
288 +            assertEquals(6765, (int) f.get());
289          } finally {
290              joinPool(p);
291          }
# Line 278 | Line 298 | public class ForkJoinPoolTest extends JS
298          ForkJoinPool p = new ForkJoinPool(1);
299          try {
300              ForkJoinTask<Integer> f = p.submit(new FibTask(8));
301 <            int r = f.get();
282 <            assertTrue(r == 21);
301 >            assertEquals(21, (int) f.get());
302          } finally {
303              joinPool(p);
304          }
# Line 293 | Line 312 | public class ForkJoinPoolTest extends JS
312          try {
313              p.shutdown();
314              assertTrue(p.isShutdown());
315 <            ForkJoinTask<Integer> f = p.submit(new FibTask(8));
316 <            shouldThrow();
317 <        } catch (RejectedExecutionException success) {
315 >            try {
316 >                ForkJoinTask<Integer> f = p.submit(new FibTask(8));
317 >                shouldThrow();
318 >            } catch (RejectedExecutionException success) {}
319          } finally {
320              joinPool(p);
321          }
# Line 309 | Line 329 | public class ForkJoinPoolTest extends JS
329          try {
330              ReentrantLock lock = new ReentrantLock();
331              ManagedLocker locker = new ManagedLocker(lock);
332 <            ForkJoinTask<Integer> f = new LockingFibTask(30, locker, lock);
332 >            ForkJoinTask<Integer> f = new LockingFibTask(20, locker, lock);
333              p.execute(f);
334 <            int r = f.get();
315 <            assertTrue(r == 832040);
334 >            assertEquals(6765, (int) f.get());
335          } finally {
336              p.shutdownNow(); // don't wait out shutdown
337          }
# Line 322 | Line 341 | public class ForkJoinPoolTest extends JS
341       * pollSubmission returns unexecuted submitted task, if present
342       */
343      public void testPollSubmission() {
344 +        final CountDownLatch done = new CountDownLatch(1);
345          SubFJP p = new SubFJP();
346          try {
347 <            ForkJoinTask a = p.submit(new MediumRunnable());
348 <            ForkJoinTask b = p.submit(new MediumRunnable());
349 <            ForkJoinTask c = p.submit(new MediumRunnable());
347 >            ForkJoinTask a = p.submit(awaiter(done));
348 >            ForkJoinTask b = p.submit(awaiter(done));
349 >            ForkJoinTask c = p.submit(awaiter(done));
350              ForkJoinTask r = p.pollSubmission();
351              assertTrue(r == a || r == b || r == c);
352              assertFalse(r.isDone());
353          } finally {
354 +            done.countDown();
355              joinPool(p);
356          }
357      }
# Line 339 | Line 360 | public class ForkJoinPoolTest extends JS
360       * drainTasksTo transfers unexecuted submitted tasks, if present
361       */
362      public void testDrainTasksTo() {
363 +        final CountDownLatch done = new CountDownLatch(1);
364          SubFJP p = new SubFJP();
365          try {
366 <            ForkJoinTask a = p.submit(new MediumRunnable());
367 <            ForkJoinTask b = p.submit(new MediumRunnable());
368 <            ForkJoinTask c = p.submit(new MediumRunnable());
366 >            ForkJoinTask a = p.submit(awaiter(done));
367 >            ForkJoinTask b = p.submit(awaiter(done));
368 >            ForkJoinTask c = p.submit(awaiter(done));
369              ArrayList<ForkJoinTask> al = new ArrayList();
370              p.drainTasksTo(al);
371              assertTrue(al.size() > 0);
# Line 352 | Line 374 | public class ForkJoinPoolTest extends JS
374                  assertFalse(r.isDone());
375              }
376          } finally {
377 +            done.countDown();
378              joinPool(p);
379          }
380      }
381  
359
382      // FJ Versions of AbstractExecutorService tests
383  
384      /**
# Line 365 | Line 387 | public class ForkJoinPoolTest extends JS
387      public void testExecuteRunnable() throws Throwable {
388          ExecutorService e = new ForkJoinPool(1);
389          try {
390 <            TrackedShortRunnable task = new TrackedShortRunnable();
391 <            assertFalse(task.done);
390 >            final AtomicBoolean done = new AtomicBoolean(false);
391 >            CheckedRunnable task = new CheckedRunnable() {
392 >                public void realRun() {
393 >                    done.set(true);
394 >                }};
395              Future<?> future = e.submit(task);
396 <            future.get();
397 <            assertTrue(task.done);
396 >            assertNull(future.get());
397 >            assertNull(future.get(0, MILLISECONDS));
398 >            assertTrue(done.get());
399 >            assertTrue(future.isDone());
400 >            assertFalse(future.isCancelled());
401          } finally {
402              joinPool(e);
403          }
404      }
405  
378
406      /**
407       * Completed submit(callable) returns result
408       */
# Line 383 | Line 410 | public class ForkJoinPoolTest extends JS
410          ExecutorService e = new ForkJoinPool(1);
411          try {
412              Future<String> future = e.submit(new StringTask());
413 <            String result = future.get();
414 <            assertSame(TEST_STRING, result);
413 >            assertSame(TEST_STRING, future.get());
414 >            assertTrue(future.isDone());
415 >            assertFalse(future.isCancelled());
416          } finally {
417              joinPool(e);
418          }
# Line 397 | Line 425 | public class ForkJoinPoolTest extends JS
425          ExecutorService e = new ForkJoinPool(1);
426          try {
427              Future<?> future = e.submit(new NoOpRunnable());
428 <            future.get();
428 >            assertNull(future.get());
429              assertTrue(future.isDone());
430 +            assertFalse(future.isCancelled());
431          } finally {
432              joinPool(e);
433          }
# Line 411 | Line 440 | public class ForkJoinPoolTest extends JS
440          ExecutorService e = new ForkJoinPool(1);
441          try {
442              Future<String> future = e.submit(new NoOpRunnable(), TEST_STRING);
443 <            String result = future.get();
444 <            assertSame(TEST_STRING, result);
443 >            assertSame(TEST_STRING, future.get());
444 >            assertTrue(future.isDone());
445 >            assertFalse(future.isCancelled());
446          } finally {
447              joinPool(e);
448          }
449      }
450  
421
451      /**
452 <     * A submitted privileged action to completion
452 >     * A submitted privileged action runs to completion
453       */
454 <    public void testSubmitPrivilegedAction() throws Throwable {
455 <        Policy savedPolicy = null;
456 <        try {
457 <            savedPolicy = Policy.getPolicy();
429 <            AdjustablePolicy policy = new AdjustablePolicy();
430 <            policy.addPermission(new RuntimePermission("getContextClassLoader"));
431 <            policy.addPermission(new RuntimePermission("setContextClassLoader"));
432 <            Policy.setPolicy(policy);
433 <        } catch (AccessControlException ok) {
434 <            return;
435 <        }
436 <
437 <        try {
438 <            ExecutorService e = new ForkJoinPool(1);
439 <            try {
454 >    public void testSubmitPrivilegedAction() throws Exception {
455 >        Runnable r = new CheckedRunnable() {
456 >            public void realRun() throws Exception {
457 >                ExecutorService e = new ForkJoinPool(1);
458                  Future future = e.submit(Executors.callable(new PrivilegedAction() {
459                      public Object run() {
460                          return TEST_STRING;
461                      }}));
462  
463 <                Object result = future.get();
464 <                assertSame(TEST_STRING, result);
465 <            } finally {
466 <                joinPool(e);
467 <            }
450 <        } finally {
451 <            Policy.setPolicy(savedPolicy);
452 <        }
463 >                assertSame(TEST_STRING, future.get());
464 >            }};
465 >
466 >        runWithPermissions(r,
467 >                           new RuntimePermission("modifyThread"));
468      }
469  
470      /**
471 <     * A submitted a privileged exception action runs to completion
471 >     * A submitted privileged exception action runs to completion
472       */
473 <    public void testSubmitPrivilegedExceptionAction() throws Throwable {
474 <        Policy savedPolicy = null;
475 <        try {
476 <            savedPolicy = Policy.getPolicy();
462 <            AdjustablePolicy policy = new AdjustablePolicy();
463 <            policy.addPermission(new RuntimePermission("getContextClassLoader"));
464 <            policy.addPermission(new RuntimePermission("setContextClassLoader"));
465 <            Policy.setPolicy(policy);
466 <        } catch (AccessControlException ok) {
467 <            return;
468 <        }
469 <
470 <        try {
471 <            ExecutorService e = new ForkJoinPool(1);
472 <            try {
473 >    public void testSubmitPrivilegedExceptionAction() throws Exception {
474 >        Runnable r = new CheckedRunnable() {
475 >            public void realRun() throws Exception {
476 >                ExecutorService e = new ForkJoinPool(1);
477                  Future future = e.submit(Executors.callable(new PrivilegedExceptionAction() {
478                      public Object run() {
479                          return TEST_STRING;
480                      }}));
481  
482 <                Object result = future.get();
483 <                assertSame(TEST_STRING, result);
484 <            } finally {
485 <                joinPool(e);
482 <            }
483 <        } finally {
484 <            Policy.setPolicy(savedPolicy);
485 <        }
482 >                assertSame(TEST_STRING, future.get());
483 >            }};
484 >
485 >        runWithPermissions(r, new RuntimePermission("modifyThread"));
486      }
487  
488      /**
489       * A submitted failed privileged exception action reports exception
490       */
491 <    public void testSubmitFailedPrivilegedExceptionAction() throws Throwable {
492 <        Policy savedPolicy = null;
493 <        try {
494 <            savedPolicy = Policy.getPolicy();
495 <            AdjustablePolicy policy = new AdjustablePolicy();
496 <            policy.addPermission(new RuntimePermission("getContextClassLoader"));
497 <            policy.addPermission(new RuntimePermission("setContextClassLoader"));
498 <            Policy.setPolicy(policy);
499 <        } catch (AccessControlException ok) {
500 <            return;
501 <        }
502 <
503 <        try {
504 <            ExecutorService e = new ForkJoinPool(1);
505 <            try {
491 >    public void testSubmitFailedPrivilegedExceptionAction() throws Exception {
492 >        Runnable r = new CheckedRunnable() {
493 >            public void realRun() throws Exception {
494 >                ExecutorService e = new ForkJoinPool(1);
495                  Future future = e.submit(Executors.callable(new PrivilegedExceptionAction() {
496                      public Object run() throws Exception {
497                          throw new IndexOutOfBoundsException();
498                      }}));
499  
500 <                Object result = future.get();
501 <                shouldThrow();
502 <            } catch (ExecutionException success) {
503 <                assertTrue(success.getCause() instanceof IndexOutOfBoundsException);
504 <            } finally {
505 <                joinPool(e);
506 <            }
507 <        } finally {
519 <            Policy.setPolicy(savedPolicy);
520 <        }
500 >                try {
501 >                    future.get();
502 >                    shouldThrow();
503 >                } catch (ExecutionException success) {
504 >                    assertTrue(success.getCause() instanceof IndexOutOfBoundsException);
505 >                }}};
506 >
507 >        runWithPermissions(r, new RuntimePermission("modifyThread"));
508      }
509  
510      /**
# Line 526 | Line 513 | public class ForkJoinPoolTest extends JS
513      public void testExecuteNullRunnable() {
514          ExecutorService e = new ForkJoinPool(1);
515          try {
516 <            TrackedShortRunnable task = null;
530 <            Future<?> future = e.submit(task);
516 >            Future<?> future = e.submit((Runnable) null);
517              shouldThrow();
518          } catch (NullPointerException success) {
519          } finally {
# Line 535 | Line 521 | public class ForkJoinPoolTest extends JS
521          }
522      }
523  
538
524      /**
525       * submit(null callable) throws NullPointerException
526       */
527      public void testSubmitNullCallable() {
528          ExecutorService e = new ForkJoinPool(1);
529          try {
530 <            StringTask t = null;
546 <            Future<String> future = e.submit(t);
530 >            Future<String> future = e.submit((Callable) null);
531              shouldThrow();
532          } catch (NullPointerException success) {
533          } finally {
# Line 551 | Line 535 | public class ForkJoinPoolTest extends JS
535          }
536      }
537  
554
538      /**
539 <     * Blocking on submit(callable) throws InterruptedException if
557 <     * caller interrupted.
539 >     * submit(callable).get() throws InterruptedException if interrupted
540       */
541      public void testInterruptedSubmit() throws InterruptedException {
542 <        final ForkJoinPool p = new ForkJoinPool(1);
543 <
544 <        Thread t = new Thread(new CheckedInterruptedRunnable() {
545 <            public void realRun() throws Throwable {
546 <                p.submit(new CheckedCallable<Object>() {
547 <                    public Object realCall() throws Throwable {
548 <                        try {
549 <                            Thread.sleep(MEDIUM_DELAY_MS);
550 <                        } catch (InterruptedException ok) {
551 <                        }
552 <                        return null;
553 <                    }}).get();
554 <            }});
555 <
556 <        t.start();
557 <        Thread.sleep(SHORT_DELAY_MS);
558 <        t.interrupt();
559 <        t.join();
560 <        p.shutdownNow();
561 <        joinPool(p);
542 >        final CountDownLatch submitted    = new CountDownLatch(1);
543 >        final CountDownLatch quittingTime = new CountDownLatch(1);
544 >        final ExecutorService p = new ForkJoinPool(1);
545 >        final Callable<Void> awaiter = new CheckedCallable<Void>() {
546 >            public Void realCall() throws InterruptedException {
547 >                assertTrue(quittingTime.await(MEDIUM_DELAY_MS, MILLISECONDS));
548 >                return null;
549 >            }};
550 >        try {
551 >            Thread t = new Thread(new CheckedInterruptedRunnable() {
552 >                public void realRun() throws Exception {
553 >                    Future<Void> future = p.submit(awaiter);
554 >                    submitted.countDown();
555 >                    future.get();
556 >                }});
557 >            t.start();
558 >            assertTrue(submitted.await(MEDIUM_DELAY_MS, MILLISECONDS));
559 >            t.interrupt();
560 >            t.join();
561 >        } finally {
562 >            quittingTime.countDown();
563 >            joinPool(p);
564 >        }
565      }
566  
567      /**
# Line 778 | Line 763 | public class ForkJoinPoolTest extends JS
763          }
764      }
765  
781
766      /**
767       * timed invokeAny(null) throws NullPointerException
768       */
769      public void testTimedInvokeAny1() throws Throwable {
770          ExecutorService e = new ForkJoinPool(1);
771          try {
772 <            e.invokeAny(null, MEDIUM_DELAY_MS, TimeUnit.MILLISECONDS);
772 >            e.invokeAny(null, MEDIUM_DELAY_MS, MILLISECONDS);
773              shouldThrow();
774          } catch (NullPointerException success) {
775          } finally {
# Line 816 | Line 800 | public class ForkJoinPoolTest extends JS
800          ExecutorService e = new ForkJoinPool(1);
801          try {
802              e.invokeAny(new ArrayList<Callable<String>>(),
803 <                        MEDIUM_DELAY_MS, TimeUnit.MILLISECONDS);
803 >                        MEDIUM_DELAY_MS, MILLISECONDS);
804              shouldThrow();
805          } catch (IllegalArgumentException success) {
806          } finally {
# Line 834 | Line 818 | public class ForkJoinPoolTest extends JS
818          l.add(latchAwaitingStringTask(latch));
819          l.add(null);
820          try {
821 <            e.invokeAny(l, MEDIUM_DELAY_MS, TimeUnit.MILLISECONDS);
821 >            e.invokeAny(l, MEDIUM_DELAY_MS, MILLISECONDS);
822              shouldThrow();
823          } catch (NullPointerException success) {
824          } finally {
# Line 851 | Line 835 | public class ForkJoinPoolTest extends JS
835          List<Callable<String>> l = new ArrayList<Callable<String>>();
836          l.add(new NPETask());
837          try {
838 <            e.invokeAny(l, MEDIUM_DELAY_MS, TimeUnit.MILLISECONDS);
838 >            e.invokeAny(l, MEDIUM_DELAY_MS, MILLISECONDS);
839              shouldThrow();
840          } catch (ExecutionException success) {
841              assertTrue(success.getCause() instanceof NullPointerException);
# Line 869 | Line 853 | public class ForkJoinPoolTest extends JS
853              List<Callable<String>> l = new ArrayList<Callable<String>>();
854              l.add(new StringTask());
855              l.add(new StringTask());
856 <            String result = e.invokeAny(l, MEDIUM_DELAY_MS, TimeUnit.MILLISECONDS);
856 >            String result = e.invokeAny(l, MEDIUM_DELAY_MS, MILLISECONDS);
857              assertSame(TEST_STRING, result);
858          } finally {
859              joinPool(e);
# Line 882 | Line 866 | public class ForkJoinPoolTest extends JS
866      public void testTimedInvokeAll1() throws Throwable {
867          ExecutorService e = new ForkJoinPool(1);
868          try {
869 <            e.invokeAll(null, MEDIUM_DELAY_MS, TimeUnit.MILLISECONDS);
869 >            e.invokeAll(null, MEDIUM_DELAY_MS, MILLISECONDS);
870              shouldThrow();
871          } catch (NullPointerException success) {
872          } finally {
# Line 914 | Line 898 | public class ForkJoinPoolTest extends JS
898          try {
899              List<Future<String>> r
900                  = e.invokeAll(new ArrayList<Callable<String>>(),
901 <                              MEDIUM_DELAY_MS, TimeUnit.MILLISECONDS);
901 >                              MEDIUM_DELAY_MS, MILLISECONDS);
902              assertTrue(r.isEmpty());
903          } finally {
904              joinPool(e);
# Line 930 | Line 914 | public class ForkJoinPoolTest extends JS
914          l.add(new StringTask());
915          l.add(null);
916          try {
917 <            e.invokeAll(l, MEDIUM_DELAY_MS, TimeUnit.MILLISECONDS);
917 >            e.invokeAll(l, MEDIUM_DELAY_MS, MILLISECONDS);
918              shouldThrow();
919          } catch (NullPointerException success) {
920          } finally {
# Line 946 | Line 930 | public class ForkJoinPoolTest extends JS
930          List<Callable<String>> l = new ArrayList<Callable<String>>();
931          l.add(new NPETask());
932          List<Future<String>> futures
933 <            = e.invokeAll(l, MEDIUM_DELAY_MS, TimeUnit.MILLISECONDS);
933 >            = e.invokeAll(l, MEDIUM_DELAY_MS, MILLISECONDS);
934          assertEquals(1, futures.size());
935          try {
936              futures.get(0).get();
# Line 968 | Line 952 | public class ForkJoinPoolTest extends JS
952              l.add(new StringTask());
953              l.add(new StringTask());
954              List<Future<String>> futures
955 <                = e.invokeAll(l, MEDIUM_DELAY_MS, TimeUnit.MILLISECONDS);
955 >                = e.invokeAll(l, MEDIUM_DELAY_MS, MILLISECONDS);
956              assertEquals(2, futures.size());
957              for (Future<String> future : futures)
958                  assertSame(TEST_STRING, future.get());

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines