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.40 by jsr166, Sun May 15 17:32:29 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 23 | Line 23 | import java.util.concurrent.ForkJoinWork
23   import java.util.concurrent.RecursiveTask;
24   import java.util.concurrent.TimeUnit;
25   import java.util.concurrent.locks.ReentrantLock;
26 + import static java.util.concurrent.TimeUnit.MILLISECONDS;
27   import java.security.AccessControlException;
28   import java.security.Policy;
29   import java.security.PrivilegedAction;
# Line 161 | Line 162 | public class ForkJoinPoolTest extends JS
162      public void testDefaultInitialState() {
163          ForkJoinPool p = new ForkJoinPool(1);
164          try {
165 <            assertTrue(p.getFactory() ==
166 <                       ForkJoinPool.defaultForkJoinWorkerThreadFactory);
166 <            assertTrue(p.isQuiescent());
165 >            assertSame(ForkJoinPool.defaultForkJoinWorkerThreadFactory,
166 >                       p.getFactory());
167              assertFalse(p.getAsyncMode());
168 <            assertTrue(p.getActiveThreadCount() == 0);
169 <            assertTrue(p.getStealCount() == 0);
170 <            assertTrue(p.getQueuedTaskCount() == 0);
171 <            assertTrue(p.getQueuedSubmissionCount() == 0);
168 >            assertEquals(0, p.getActiveThreadCount());
169 >            assertEquals(0, p.getStealCount());
170 >            assertEquals(0, p.getQueuedTaskCount());
171 >            assertEquals(0, p.getQueuedSubmissionCount());
172              assertFalse(p.hasQueuedSubmissions());
173              assertFalse(p.isShutdown());
174              assertFalse(p.isTerminating());
# Line 205 | Line 205 | public class ForkJoinPoolTest extends JS
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      }
# Line 365 | Line 388 | public class ForkJoinPoolTest extends JS
388      public void testExecuteRunnable() throws Throwable {
389          ExecutorService e = new ForkJoinPool(1);
390          try {
391 <            TrackedShortRunnable task = new TrackedShortRunnable();
392 <            assertFalse(task.done);
391 >            TrackedRunnable task = trackedRunnable(SHORT_DELAY_MS);
392 >            assertFalse(task.isDone());
393              Future<?> future = e.submit(task);
394 <            future.get();
395 <            assertTrue(task.done);
394 >            assertNull(future.get());
395 >            assertNull(future.get(MEDIUM_DELAY_MS, MILLISECONDS));
396 >            assertTrue(task.isDone());
397 >            assertTrue(future.isDone());
398 >            assertFalse(future.isCancelled());
399          } finally {
400              joinPool(e);
401          }
# Line 383 | Line 409 | public class ForkJoinPoolTest extends JS
409          ExecutorService e = new ForkJoinPool(1);
410          try {
411              Future<String> future = e.submit(new StringTask());
412 <            String result = future.get();
413 <            assertSame(TEST_STRING, result);
412 >            assertSame(TEST_STRING, future.get());
413 >            assertTrue(future.isDone());
414 >            assertFalse(future.isCancelled());
415          } finally {
416              joinPool(e);
417          }
# Line 397 | Line 424 | public class ForkJoinPoolTest extends JS
424          ExecutorService e = new ForkJoinPool(1);
425          try {
426              Future<?> future = e.submit(new NoOpRunnable());
427 <            future.get();
427 >            assertNull(future.get());
428              assertTrue(future.isDone());
429 +            assertFalse(future.isCancelled());
430          } finally {
431              joinPool(e);
432          }
# Line 411 | Line 439 | public class ForkJoinPoolTest extends JS
439          ExecutorService e = new ForkJoinPool(1);
440          try {
441              Future<String> future = e.submit(new NoOpRunnable(), TEST_STRING);
442 <            String result = future.get();
443 <            assertSame(TEST_STRING, result);
442 >            assertSame(TEST_STRING, future.get());
443 >            assertTrue(future.isDone());
444 >            assertFalse(future.isCancelled());
445          } finally {
446              joinPool(e);
447          }
448      }
449  
421
450      /**
451 <     * A submitted privileged action to completion
451 >     * A submitted privileged action runs to completion
452       */
453 <    public void testSubmitPrivilegedAction() throws Throwable {
454 <        Policy savedPolicy = null;
455 <        try {
456 <            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 {
453 >    public void testSubmitPrivilegedAction() throws Exception {
454 >        Runnable r = new CheckedRunnable() {
455 >            public void realRun() throws Exception {
456 >                ExecutorService e = new ForkJoinPool(1);
457                  Future future = e.submit(Executors.callable(new PrivilegedAction() {
458                      public Object run() {
459                          return TEST_STRING;
460                      }}));
461  
462 <                Object result = future.get();
463 <                assertSame(TEST_STRING, result);
464 <            } finally {
465 <                joinPool(e);
466 <            }
450 <        } finally {
451 <            Policy.setPolicy(savedPolicy);
452 <        }
462 >                assertSame(TEST_STRING, future.get());
463 >            }};
464 >
465 >        runWithPermissions(r,
466 >                           new RuntimePermission("modifyThread"));
467      }
468  
469      /**
470 <     * A submitted a privileged exception action runs to completion
470 >     * A submitted privileged exception action runs to completion
471       */
472 <    public void testSubmitPrivilegedExceptionAction() throws Throwable {
473 <        Policy savedPolicy = null;
474 <        try {
475 <            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 {
472 >    public void testSubmitPrivilegedExceptionAction() throws Exception {
473 >        Runnable r = new CheckedRunnable() {
474 >            public void realRun() throws Exception {
475 >                ExecutorService e = new ForkJoinPool(1);
476                  Future future = e.submit(Executors.callable(new PrivilegedExceptionAction() {
477                      public Object run() {
478                          return TEST_STRING;
479                      }}));
480  
481 <                Object result = future.get();
482 <                assertSame(TEST_STRING, result);
483 <            } finally {
484 <                joinPool(e);
482 <            }
483 <        } finally {
484 <            Policy.setPolicy(savedPolicy);
485 <        }
481 >                assertSame(TEST_STRING, future.get());
482 >            }};
483 >
484 >        runWithPermissions(r, new RuntimePermission("modifyThread"));
485      }
486  
487      /**
488       * A submitted failed privileged exception action reports exception
489       */
490 <    public void testSubmitFailedPrivilegedExceptionAction() throws Throwable {
491 <        Policy savedPolicy = null;
492 <        try {
493 <            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 {
490 >    public void testSubmitFailedPrivilegedExceptionAction() throws Exception {
491 >        Runnable r = new CheckedRunnable() {
492 >            public void realRun() throws Exception {
493 >                ExecutorService e = new ForkJoinPool(1);
494                  Future future = e.submit(Executors.callable(new PrivilegedExceptionAction() {
495                      public Object run() throws Exception {
496                          throw new IndexOutOfBoundsException();
497                      }}));
498  
499 <                Object result = future.get();
500 <                shouldThrow();
501 <            } catch (ExecutionException success) {
502 <                assertTrue(success.getCause() instanceof IndexOutOfBoundsException);
503 <            } finally {
504 <                joinPool(e);
505 <            }
506 <        } finally {
519 <            Policy.setPolicy(savedPolicy);
520 <        }
499 >                try {
500 >                    future.get();
501 >                    shouldThrow();
502 >                } catch (ExecutionException success) {
503 >                    assertTrue(success.getCause() instanceof IndexOutOfBoundsException);
504 >                }}};
505 >
506 >        runWithPermissions(r, new RuntimePermission("modifyThread"));
507      }
508  
509      /**
# Line 526 | Line 512 | public class ForkJoinPoolTest extends JS
512      public void testExecuteNullRunnable() {
513          ExecutorService e = new ForkJoinPool(1);
514          try {
515 <            TrackedShortRunnable task = null;
530 <            Future<?> future = e.submit(task);
515 >            Future<?> future = e.submit((Runnable) null);
516              shouldThrow();
517          } catch (NullPointerException success) {
518          } finally {
# Line 542 | Line 527 | public class ForkJoinPoolTest extends JS
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 553 | Line 537 | public class ForkJoinPoolTest extends JS
537  
538  
539      /**
540 <     * Blocking on submit(callable) throws InterruptedException if
557 <     * caller interrupted.
540 >     * submit(callable).get() throws InterruptedException if interrupted
541       */
542      public void testInterruptedSubmit() throws InterruptedException {
543 <        final ForkJoinPool p = new ForkJoinPool(1);
544 <
545 <        Thread t = new Thread(new CheckedInterruptedRunnable() {
546 <            public void realRun() throws Throwable {
547 <                p.submit(new CheckedCallable<Object>() {
548 <                    public Object realCall() throws Throwable {
549 <                        try {
550 <                            Thread.sleep(MEDIUM_DELAY_MS);
551 <                        } catch (InterruptedException ok) {
552 <                        }
553 <                        return null;
554 <                    }}).get();
555 <            }});
556 <
557 <        t.start();
558 <        Thread.sleep(SHORT_DELAY_MS);
559 <        t.interrupt();
560 <        t.join();
561 <        p.shutdownNow();
562 <        joinPool(p);
543 >        final CountDownLatch submitted    = new CountDownLatch(1);
544 >        final CountDownLatch quittingTime = new CountDownLatch(1);
545 >        final ExecutorService p = new ForkJoinPool(1);
546 >        final Callable<Void> awaiter = new CheckedCallable<Void>() {
547 >            public Void realCall() throws InterruptedException {
548 >                assertTrue(quittingTime.await(MEDIUM_DELAY_MS, MILLISECONDS));
549 >                return null;
550 >            }};
551 >        try {
552 >            Thread t = new Thread(new CheckedInterruptedRunnable() {
553 >                public void realRun() throws Exception {
554 >                    Future<Void> future = p.submit(awaiter);
555 >                    submitted.countDown();
556 >                    future.get();
557 >                }});
558 >            t.start();
559 >            assertTrue(submitted.await(MEDIUM_DELAY_MS, MILLISECONDS));
560 >            t.interrupt();
561 >            t.join();
562 >        } finally {
563 >            quittingTime.countDown();
564 >            joinPool(p);
565 >        }
566      }
567  
568      /**
# Line 785 | Line 771 | public class ForkJoinPoolTest extends JS
771      public void testTimedInvokeAny1() throws Throwable {
772          ExecutorService e = new ForkJoinPool(1);
773          try {
774 <            e.invokeAny(null, MEDIUM_DELAY_MS, TimeUnit.MILLISECONDS);
774 >            e.invokeAny(null, MEDIUM_DELAY_MS, MILLISECONDS);
775              shouldThrow();
776          } catch (NullPointerException success) {
777          } finally {
# Line 816 | Line 802 | public class ForkJoinPoolTest extends JS
802          ExecutorService e = new ForkJoinPool(1);
803          try {
804              e.invokeAny(new ArrayList<Callable<String>>(),
805 <                        MEDIUM_DELAY_MS, TimeUnit.MILLISECONDS);
805 >                        MEDIUM_DELAY_MS, MILLISECONDS);
806              shouldThrow();
807          } catch (IllegalArgumentException success) {
808          } finally {
# Line 834 | Line 820 | public class ForkJoinPoolTest extends JS
820          l.add(latchAwaitingStringTask(latch));
821          l.add(null);
822          try {
823 <            e.invokeAny(l, MEDIUM_DELAY_MS, TimeUnit.MILLISECONDS);
823 >            e.invokeAny(l, MEDIUM_DELAY_MS, MILLISECONDS);
824              shouldThrow();
825          } catch (NullPointerException success) {
826          } finally {
# Line 851 | Line 837 | public class ForkJoinPoolTest extends JS
837          List<Callable<String>> l = new ArrayList<Callable<String>>();
838          l.add(new NPETask());
839          try {
840 <            e.invokeAny(l, MEDIUM_DELAY_MS, TimeUnit.MILLISECONDS);
840 >            e.invokeAny(l, MEDIUM_DELAY_MS, MILLISECONDS);
841              shouldThrow();
842          } catch (ExecutionException success) {
843              assertTrue(success.getCause() instanceof NullPointerException);
# Line 869 | Line 855 | public class ForkJoinPoolTest extends JS
855              List<Callable<String>> l = new ArrayList<Callable<String>>();
856              l.add(new StringTask());
857              l.add(new StringTask());
858 <            String result = e.invokeAny(l, MEDIUM_DELAY_MS, TimeUnit.MILLISECONDS);
858 >            String result = e.invokeAny(l, MEDIUM_DELAY_MS, MILLISECONDS);
859              assertSame(TEST_STRING, result);
860          } finally {
861              joinPool(e);
# Line 882 | Line 868 | public class ForkJoinPoolTest extends JS
868      public void testTimedInvokeAll1() throws Throwable {
869          ExecutorService e = new ForkJoinPool(1);
870          try {
871 <            e.invokeAll(null, MEDIUM_DELAY_MS, TimeUnit.MILLISECONDS);
871 >            e.invokeAll(null, MEDIUM_DELAY_MS, MILLISECONDS);
872              shouldThrow();
873          } catch (NullPointerException success) {
874          } finally {
# Line 914 | Line 900 | public class ForkJoinPoolTest extends JS
900          try {
901              List<Future<String>> r
902                  = e.invokeAll(new ArrayList<Callable<String>>(),
903 <                              MEDIUM_DELAY_MS, TimeUnit.MILLISECONDS);
903 >                              MEDIUM_DELAY_MS, MILLISECONDS);
904              assertTrue(r.isEmpty());
905          } finally {
906              joinPool(e);
# Line 930 | Line 916 | public class ForkJoinPoolTest extends JS
916          l.add(new StringTask());
917          l.add(null);
918          try {
919 <            e.invokeAll(l, MEDIUM_DELAY_MS, TimeUnit.MILLISECONDS);
919 >            e.invokeAll(l, MEDIUM_DELAY_MS, MILLISECONDS);
920              shouldThrow();
921          } catch (NullPointerException success) {
922          } finally {
# Line 946 | Line 932 | public class ForkJoinPoolTest extends JS
932          List<Callable<String>> l = new ArrayList<Callable<String>>();
933          l.add(new NPETask());
934          List<Future<String>> futures
935 <            = e.invokeAll(l, MEDIUM_DELAY_MS, TimeUnit.MILLISECONDS);
935 >            = e.invokeAll(l, MEDIUM_DELAY_MS, MILLISECONDS);
936          assertEquals(1, futures.size());
937          try {
938              futures.get(0).get();
# Line 968 | Line 954 | public class ForkJoinPoolTest extends JS
954              l.add(new StringTask());
955              l.add(new StringTask());
956              List<Future<String>> futures
957 <                = e.invokeAll(l, MEDIUM_DELAY_MS, TimeUnit.MILLISECONDS);
957 >                = e.invokeAll(l, MEDIUM_DELAY_MS, MILLISECONDS);
958              assertEquals(2, futures.size());
959              for (Future<String> future : futures)
960                  assertSame(TEST_STRING, future.get());

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines