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.18 by dl, Mon Feb 22 11:25:16 2010 UTC vs.
Revision 1.23 by jsr166, Sat Sep 11 19:04:12 2010 UTC

# Line 4 | Line 4
4   * http://creativecommons.org/licenses/publicdomain
5   */
6  
7
7   import junit.framework.*;
8   import java.util.*;
9 < import java.util.concurrent.*;
10 < import static java.util.concurrent.TimeUnit.MILLISECONDS;
9 > import java.util.concurrent.Executor;
10 > import java.util.concurrent.Executors;
11 > import java.util.concurrent.ExecutorService;
12 > import java.util.concurrent.AbstractExecutorService;
13 > import java.util.concurrent.CountDownLatch;
14 > import java.util.concurrent.Callable;
15 > import java.util.concurrent.Future;
16 > import java.util.concurrent.ExecutionException;
17 > import java.util.concurrent.CancellationException;
18 > import java.util.concurrent.RejectedExecutionException;
19 > import java.util.concurrent.ForkJoinPool;
20 > import java.util.concurrent.ForkJoinTask;
21 > import java.util.concurrent.ForkJoinWorkerThread;
22 > import java.util.concurrent.RecursiveAction;
23 > import java.util.concurrent.RecursiveTask;
24 > import java.util.concurrent.TimeUnit;
25   import java.util.concurrent.locks.*;
26   import java.security.*;
27  
28   public class ForkJoinPoolTest extends JSR166TestCase {
29      public static void main(String[] args) {
30 <        junit.textui.TestRunner.run (suite());
30 >        junit.textui.TestRunner.run(suite());
31      }
32 +
33      public static Test suite() {
34          return new TestSuite(ForkJoinPoolTest.class);
35      }
# Line 39 | Line 53 | public class ForkJoinPoolTest extends JS
53      // Some classes to test extension and factory methods
54  
55      static class MyHandler implements Thread.UncaughtExceptionHandler {
56 <        int catches = 0;
56 >        volatile int catches = 0;
57          public void uncaughtException(Thread t, Throwable e) {
58              ++catches;
59          }
# Line 48 | Line 62 | public class ForkJoinPoolTest extends JS
62      // to test handlers
63      static class FailingFJWSubclass extends ForkJoinWorkerThread {
64          public FailingFJWSubclass(ForkJoinPool p) { super(p) ; }
65 <        protected void onStart() { throw new Error(); }
65 >        protected void onStart() { super.onStart(); throw new Error(); }
66      }
67  
68      static class FailingThreadFactory
69              implements ForkJoinPool.ForkJoinWorkerThreadFactory {
70 <        int calls = 0;
70 >        volatile int calls = 0;
71          public ForkJoinWorkerThread newThread(ForkJoinPool p) {
72              if (++calls > 1) return null;
73              return new FailingFJWSubclass(p);
# Line 142 | Line 156 | public class ForkJoinPoolTest extends JS
156       * tasks, and quiescent running state.
157       */
158      public void testDefaultInitialState() {
159 <        ForkJoinPool p = null;
159 >        ForkJoinPool p = new ForkJoinPool(1);
160          try {
147            p = new ForkJoinPool(1);
161              assertTrue(p.getFactory() ==
162                         ForkJoinPool.defaultForkJoinWorkerThreadFactory);
163              assertTrue(p.isQuiescent());
151            assertTrue(p.getMaintainsParallelism());
164              assertFalse(p.getAsyncMode());
165              assertTrue(p.getActiveThreadCount() == 0);
166              assertTrue(p.getStealCount() == 0);
# Line 178 | Line 190 | public class ForkJoinPoolTest extends JS
190       */
191      public void testConstructor2() {
192          try {
193 <            new ForkJoinPool(1, null);
193 >            new ForkJoinPool(1, null, null, false);
194              shouldThrow();
195          } catch (NullPointerException success) {}
196      }
# Line 188 | Line 200 | public class ForkJoinPoolTest extends JS
200       * getParallelism returns size set in constructor
201       */
202      public void testGetParallelism() {
203 <        ForkJoinPool p = null;
192 <        try {
193 <            p = new ForkJoinPool(1);
194 <            assertTrue(p.getParallelism() == 1);
195 <        } finally {
196 <            joinPool(p);
197 <        }
198 <    }
199 <
200 <    /**
201 <     * setParallelism changes reported parallelism level.
202 <     */
203 <    public void testSetParallelism() {
204 <        ForkJoinPool p = null;
205 <        try {
206 <            p = new ForkJoinPool(1);
207 <            assertTrue(p.getParallelism() == 1);
208 <            p.setParallelism(2);
209 <            assertTrue(p.getParallelism() == 2);
210 <        } finally {
211 <            joinPool(p);
212 <        }
213 <    }
214 <
215 <    /**
216 <     * setParallelism with argument <= 0 throws exception
217 <     */
218 <    public void testSetParallelism2() {
219 <        ForkJoinPool p = null;
203 >        ForkJoinPool p = new ForkJoinPool(1);
204          try {
221            p = new ForkJoinPool(1);
205              assertTrue(p.getParallelism() == 1);
223            p.setParallelism(-2);
224            shouldThrow();
225        } catch (IllegalArgumentException success) {
206          } finally {
207              joinPool(p);
208          }
# Line 232 | Line 212 | public class ForkJoinPoolTest extends JS
212       * getPoolSize returns number of started workers.
213       */
214      public void testGetPoolSize() {
215 <        ForkJoinPool p = null;
215 >        ForkJoinPool p = new ForkJoinPool(1);
216          try {
237            p = new ForkJoinPool(1);
217              assertTrue(p.getActiveThreadCount() == 0);
218              Future<String> future = p.submit(new StringTask());
219              assertTrue(p.getPoolSize() == 1);
241
242        } finally {
243            joinPool(p);
244        }
245    }
246
247    /**
248     * setMaximumPoolSize changes size reported by getMaximumPoolSize.
249     */
250    public void testSetMaximumPoolSize() {
251        ForkJoinPool p = null;
252        try {
253            p = new ForkJoinPool(1);
254            p.setMaximumPoolSize(2);
255            assertTrue(p.getMaximumPoolSize() == 2);
256        } finally {
257            joinPool(p);
258        }
259    }
260
261    /**
262     * setMaximumPoolSize with argument <= 0 throws exception
263     */
264    public void testSetMaximumPoolSize2() {
265        ForkJoinPool p = null;
266        try {
267            p = new ForkJoinPool(1);
268            p.setMaximumPoolSize(-2);
269            shouldThrow();
270        } catch (IllegalArgumentException success) {
271        } finally {
272            joinPool(p);
273        }
274    }
275
276    /**
277     * setMaintainsParallelism changes policy reported by
278     * getMaintainsParallelism.
279     */
280    public void testSetMaintainsParallelism() {
281        ForkJoinPool p = null;
282        try {
283            p = new ForkJoinPool(1);
284            p.setMaintainsParallelism(false);
285            assertFalse(p.getMaintainsParallelism());
286        } finally {
287            joinPool(p);
288        }
289    }
290
291    /**
292     * setAsyncMode changes policy reported by
293     * getAsyncMode.
294     */
295    public void testSetAsyncMode() {
296        ForkJoinPool p = null;
297        try {
298            p = new ForkJoinPool(1);
299            p.setAsyncMode(true);
300            assertTrue(p.getAsyncMode());
220          } finally {
221              joinPool(p);
222          }
# Line 310 | Line 229 | public class ForkJoinPoolTest extends JS
229       * performs its defined action
230       */
231      public void testSetUncaughtExceptionHandler() throws InterruptedException {
232 <        ForkJoinPool p = null;
232 >        MyHandler eh = new MyHandler();
233 >        ForkJoinPool p = new ForkJoinPool(1, new FailingThreadFactory(), eh, false);
234          try {
235 <            p = new ForkJoinPool(1, new FailingThreadFactory());
316 <            MyHandler eh = new MyHandler();
317 <            p.setUncaughtExceptionHandler(eh);
318 <            assertEquals(eh, p.getUncaughtExceptionHandler());
235 >            assert(eh == p.getUncaughtExceptionHandler());
236              p.execute(new FailingTask());
237              Thread.sleep(MEDIUM_DELAY_MS);
238              assertTrue(eh.catches > 0);
239          } finally {
240 +            p.shutdownNow();
241              joinPool(p);
242          }
243      }
244  
245      /**
328     * setUncaughtExceptionHandler of null removes handler
329     */
330    public void testSetUncaughtExceptionHandler2() {
331        ForkJoinPool p = null;
332        try {
333            p = new ForkJoinPool(1);
334            p.setUncaughtExceptionHandler(null);
335            assertNull(p.getUncaughtExceptionHandler());
336        } finally {
337            joinPool(p);
338        }
339    }
340
341
342    /**
246       * After invoking a single task, isQuiescent is true,
247       * queues are empty, threads are not active, and
248       * construction parameters continue to hold
249       */
250      public void testisQuiescent() throws InterruptedException {
251 <        ForkJoinPool p = null;
251 >        ForkJoinPool p = new ForkJoinPool(2);
252          try {
350            p = new ForkJoinPool(2);
253              p.invoke(new FibTask(20));
254              assertTrue(p.getFactory() ==
255                         ForkJoinPool.defaultForkJoinWorkerThreadFactory);
256              Thread.sleep(MEDIUM_DELAY_MS);
257              assertTrue(p.isQuiescent());
356            assertTrue(p.getMaintainsParallelism());
258              assertFalse(p.getAsyncMode());
259              assertTrue(p.getActiveThreadCount() == 0);
260              assertTrue(p.getQueuedTaskCount() == 0);
# Line 371 | Line 272 | public class ForkJoinPoolTest extends JS
272       * Completed submit(ForkJoinTask) returns result
273       */
274      public void testSubmitForkJoinTask() throws Throwable {
275 <        ForkJoinPool p = null;
275 >        ForkJoinPool p = new ForkJoinPool(1);
276          try {
376            p = new ForkJoinPool(1);
277              ForkJoinTask<Integer> f = p.submit(new FibTask(8));
278              int r = f.get();
279              assertTrue(r == 21);
# Line 386 | Line 286 | public class ForkJoinPoolTest extends JS
286       * A task submitted after shutdown is rejected
287       */
288      public void testSubmitAfterShutdown() {
289 <        ForkJoinPool p = null;
289 >        ForkJoinPool p = new ForkJoinPool(1);
290          try {
391            p = new ForkJoinPool(1);
291              p.shutdown();
292              assertTrue(p.isShutdown());
293              ForkJoinTask<Integer> f = p.submit(new FibTask(8));
# Line 403 | Line 302 | public class ForkJoinPoolTest extends JS
302       * Pool maintains parallelism when using ManagedBlocker
303       */
304      public void testBlockingForkJoinTask() throws Throwable {
305 <        ForkJoinPool p = null;
305 >        ForkJoinPool p = new ForkJoinPool(4);
306          try {
408            p = new ForkJoinPool(4);
307              ReentrantLock lock = new ReentrantLock();
308              ManagedLocker locker = new ManagedLocker(lock);
309              ForkJoinTask<Integer> f = new LockingFibTask(30, locker, lock);
310              p.execute(f);
413            assertTrue(p.getPoolSize() >= 4);
311              int r = f.get();
312              assertTrue(r == 832040);
313          } finally {
# Line 422 | Line 319 | public class ForkJoinPoolTest extends JS
319       * pollSubmission returns unexecuted submitted task, if present
320       */
321      public void testPollSubmission() {
322 <        SubFJP p = null;
322 >        SubFJP p = new SubFJP();
323          try {
427            p = new SubFJP();
324              ForkJoinTask a = p.submit(new MediumRunnable());
325              ForkJoinTask b = p.submit(new MediumRunnable());
326              ForkJoinTask c = p.submit(new MediumRunnable());
# Line 440 | Line 336 | public class ForkJoinPoolTest extends JS
336       * drainTasksTo transfers unexecuted submitted tasks, if present
337       */
338      public void testDrainTasksTo() {
339 <        SubFJP p = null;
339 >        SubFJP p = new SubFJP();
340          try {
445            p = new SubFJP();
341              ForkJoinTask a = p.submit(new MediumRunnable());
342              ForkJoinTask b = p.submit(new MediumRunnable());
343              ForkJoinTask c = p.submit(new MediumRunnable());
# Line 466 | Line 361 | public class ForkJoinPoolTest extends JS
361       */
362      public void testExecuteRunnable() throws Throwable {
363          ExecutorService e = new ForkJoinPool(1);
364 <        TrackedShortRunnable task = new TrackedShortRunnable();
365 <        assertFalse(task.done);
366 <        Future<?> future = e.submit(task);
367 <        future.get();
368 <        assertTrue(task.done);
364 >        try {
365 >            TrackedShortRunnable task = new TrackedShortRunnable();
366 >            assertFalse(task.done);
367 >            Future<?> future = e.submit(task);
368 >            future.get();
369 >            assertTrue(task.done);
370 >        } finally {
371 >            joinPool(e);
372 >        }
373      }
374  
375  
# Line 479 | Line 378 | public class ForkJoinPoolTest extends JS
378       */
379      public void testSubmitCallable() throws Throwable {
380          ExecutorService e = new ForkJoinPool(1);
381 <        Future<String> future = e.submit(new StringTask());
382 <        String result = future.get();
383 <        assertSame(TEST_STRING, result);
381 >        try {
382 >            Future<String> future = e.submit(new StringTask());
383 >            String result = future.get();
384 >            assertSame(TEST_STRING, result);
385 >        } finally {
386 >            joinPool(e);
387 >        }
388      }
389  
390      /**
# Line 489 | Line 392 | public class ForkJoinPoolTest extends JS
392       */
393      public void testSubmitRunnable() throws Throwable {
394          ExecutorService e = new ForkJoinPool(1);
395 <        Future<?> future = e.submit(new NoOpRunnable());
396 <        future.get();
397 <        assertTrue(future.isDone());
395 >        try {
396 >            Future<?> future = e.submit(new NoOpRunnable());
397 >            future.get();
398 >            assertTrue(future.isDone());
399 >        } finally {
400 >            joinPool(e);
401 >        }
402      }
403  
404      /**
# Line 499 | Line 406 | public class ForkJoinPoolTest extends JS
406       */
407      public void testSubmitRunnable2() throws Throwable {
408          ExecutorService e = new ForkJoinPool(1);
409 <        Future<String> future = e.submit(new NoOpRunnable(), TEST_STRING);
410 <        String result = future.get();
411 <        assertSame(TEST_STRING, result);
409 >        try {
410 >            Future<String> future = e.submit(new NoOpRunnable(), TEST_STRING);
411 >            String result = future.get();
412 >            assertSame(TEST_STRING, result);
413 >        } finally {
414 >            joinPool(e);
415 >        }
416      }
417  
418 +
419      /**
420 <     * A submitted privileged action runs to completion
420 >     * A submitted privileged action to completion
421       */
422      public void testSubmitPrivilegedAction() throws Throwable {
423 <        Runnable r = new CheckedRunnable() {
424 <            public void realRun() throws Exception {
425 <                ExecutorService e = new ForkJoinPool(1);
423 >        Policy savedPolicy = null;
424 >        try {
425 >            savedPolicy = Policy.getPolicy();
426 >            AdjustablePolicy policy = new AdjustablePolicy();
427 >            policy.addPermission(new RuntimePermission("getContextClassLoader"));
428 >            policy.addPermission(new RuntimePermission("setContextClassLoader"));
429 >            Policy.setPolicy(policy);
430 >        } catch (AccessControlException ok) {
431 >            return;
432 >        }
433 >
434 >        try {
435 >            ExecutorService e = new ForkJoinPool(1);
436 >            try {
437                  Future future = e.submit(Executors.callable(new PrivilegedAction() {
438                      public Object run() {
439                          return TEST_STRING;
# Line 518 | Line 441 | public class ForkJoinPoolTest extends JS
441  
442                  Object result = future.get();
443                  assertSame(TEST_STRING, result);
444 <            }};
445 <
446 <        runWithPermissions(r, new RuntimePermission("modifyThread"));
444 >            } finally {
445 >                joinPool(e);
446 >            }
447 >        } finally {
448 >            Policy.setPolicy(savedPolicy);
449 >        }
450      }
451  
452      /**
453 <     * A submitted privileged exception action runs to completion
453 >     * A submitted a privileged exception action runs to completion
454       */
455      public void testSubmitPrivilegedExceptionAction() throws Throwable {
456 <        Runnable r = new CheckedRunnable() {
457 <            public void realRun() throws Exception {
458 <                ExecutorService e = new ForkJoinPool(1);
456 >        Policy savedPolicy = null;
457 >        try {
458 >            savedPolicy = Policy.getPolicy();
459 >            AdjustablePolicy policy = new AdjustablePolicy();
460 >            policy.addPermission(new RuntimePermission("getContextClassLoader"));
461 >            policy.addPermission(new RuntimePermission("setContextClassLoader"));
462 >            Policy.setPolicy(policy);
463 >        } catch (AccessControlException ok) {
464 >            return;
465 >        }
466 >
467 >        try {
468 >            ExecutorService e = new ForkJoinPool(1);
469 >            try {
470                  Future future = e.submit(Executors.callable(new PrivilegedExceptionAction() {
471                      public Object run() {
472                          return TEST_STRING;
# Line 537 | Line 474 | public class ForkJoinPoolTest extends JS
474  
475                  Object result = future.get();
476                  assertSame(TEST_STRING, result);
477 <            }};
478 <
479 <        runWithPermissions(r, new RuntimePermission("modifyThread"));
477 >            } finally {
478 >                joinPool(e);
479 >            }
480 >        } finally {
481 >            Policy.setPolicy(savedPolicy);
482 >        }
483      }
484  
485      /**
486       * A submitted failed privileged exception action reports exception
487       */
488      public void testSubmitFailedPrivilegedExceptionAction() throws Throwable {
489 <        Runnable r = new CheckedRunnable() {
490 <            public void realRun() throws Exception {
491 <                ExecutorService e = new ForkJoinPool(1);
489 >        Policy savedPolicy = null;
490 >        try {
491 >            savedPolicy = Policy.getPolicy();
492 >            AdjustablePolicy policy = new AdjustablePolicy();
493 >            policy.addPermission(new RuntimePermission("getContextClassLoader"));
494 >            policy.addPermission(new RuntimePermission("setContextClassLoader"));
495 >            Policy.setPolicy(policy);
496 >        } catch (AccessControlException ok) {
497 >            return;
498 >        }
499 >
500 >        try {
501 >            ExecutorService e = new ForkJoinPool(1);
502 >            try {
503                  Future future = e.submit(Executors.callable(new PrivilegedExceptionAction() {
504                      public Object run() throws Exception {
505                          throw new IndexOutOfBoundsException();
506                      }}));
507  
508 <                try {
509 <                    Object result = future.get();
510 <                    shouldThrow();
511 <                } catch (ExecutionException success) {
512 <                    assertTrue(success.getCause() instanceof IndexOutOfBoundsException);
513 <                }}};
514 <
515 <        runWithPermissions(r, new RuntimePermission("modifyThread"));
508 >                Object result = future.get();
509 >                shouldThrow();
510 >            } catch (ExecutionException success) {
511 >                assertTrue(success.getCause() instanceof IndexOutOfBoundsException);
512 >            } finally {
513 >                joinPool(e);
514 >            }
515 >        } finally {
516 >            Policy.setPolicy(savedPolicy);
517 >        }
518      }
519  
520      /**
521       * execute(null runnable) throws NullPointerException
522       */
523      public void testExecuteNullRunnable() {
524 +        ExecutorService e = new ForkJoinPool(1);
525          try {
572            ExecutorService e = new ForkJoinPool(1);
526              TrackedShortRunnable task = null;
527              Future<?> future = e.submit(task);
528              shouldThrow();
529 <        } catch (NullPointerException success) {}
529 >        } catch (NullPointerException success) {
530 >        } finally {
531 >            joinPool(e);
532 >        }
533      }
534  
535  
# Line 581 | Line 537 | public class ForkJoinPoolTest extends JS
537       * submit(null callable) throws NullPointerException
538       */
539      public void testSubmitNullCallable() {
540 +        ExecutorService e = new ForkJoinPool(1);
541          try {
585            ExecutorService e = new ForkJoinPool(1);
542              StringTask t = null;
543              Future<String> future = e.submit(t);
544              shouldThrow();
545 <        } catch (NullPointerException success) {}
545 >        } catch (NullPointerException success) {
546 >        } finally {
547 >            joinPool(e);
548 >        }
549      }
550  
551  
# Line 632 | Line 591 | public class ForkJoinPoolTest extends JS
591              shouldThrow();
592          } catch (ExecutionException success) {
593              assertTrue(success.getCause() instanceof ArithmeticException);
594 +        } finally {
595 +            joinPool(p);
596          }
636
637        joinPool(p);
597      }
598  
599      /**
# Line 823 | Line 782 | public class ForkJoinPoolTest extends JS
782      public void testTimedInvokeAny1() throws Throwable {
783          ExecutorService e = new ForkJoinPool(1);
784          try {
785 <            e.invokeAny(null, MEDIUM_DELAY_MS, MILLISECONDS);
785 >            e.invokeAny(null, MEDIUM_DELAY_MS, TimeUnit.MILLISECONDS);
786              shouldThrow();
787          } catch (NullPointerException success) {
788          } finally {
# Line 854 | Line 813 | public class ForkJoinPoolTest extends JS
813          ExecutorService e = new ForkJoinPool(1);
814          try {
815              e.invokeAny(new ArrayList<Callable<String>>(),
816 <                        MEDIUM_DELAY_MS, MILLISECONDS);
816 >                        MEDIUM_DELAY_MS, TimeUnit.MILLISECONDS);
817              shouldThrow();
818          } catch (IllegalArgumentException success) {
819          } finally {
# Line 872 | Line 831 | public class ForkJoinPoolTest extends JS
831          l.add(latchAwaitingStringTask(latch));
832          l.add(null);
833          try {
834 <            e.invokeAny(l, MEDIUM_DELAY_MS, MILLISECONDS);
834 >            e.invokeAny(l, MEDIUM_DELAY_MS, TimeUnit.MILLISECONDS);
835              shouldThrow();
836          } catch (NullPointerException success) {
837          } finally {
# Line 889 | Line 848 | public class ForkJoinPoolTest extends JS
848          List<Callable<String>> l = new ArrayList<Callable<String>>();
849          l.add(new NPETask());
850          try {
851 <            e.invokeAny(l, MEDIUM_DELAY_MS, MILLISECONDS);
851 >            e.invokeAny(l, MEDIUM_DELAY_MS, TimeUnit.MILLISECONDS);
852              shouldThrow();
853          } catch (ExecutionException success) {
854              assertTrue(success.getCause() instanceof NullPointerException);
# Line 907 | Line 866 | public class ForkJoinPoolTest extends JS
866              List<Callable<String>> l = new ArrayList<Callable<String>>();
867              l.add(new StringTask());
868              l.add(new StringTask());
869 <            String result = e.invokeAny(l, MEDIUM_DELAY_MS, MILLISECONDS);
869 >            String result = e.invokeAny(l, MEDIUM_DELAY_MS, TimeUnit.MILLISECONDS);
870              assertSame(TEST_STRING, result);
871          } finally {
872              joinPool(e);
# Line 920 | Line 879 | public class ForkJoinPoolTest extends JS
879      public void testTimedInvokeAll1() throws Throwable {
880          ExecutorService e = new ForkJoinPool(1);
881          try {
882 <            e.invokeAll(null, MEDIUM_DELAY_MS, MILLISECONDS);
882 >            e.invokeAll(null, MEDIUM_DELAY_MS, TimeUnit.MILLISECONDS);
883              shouldThrow();
884          } catch (NullPointerException success) {
885          } finally {
# Line 952 | Line 911 | public class ForkJoinPoolTest extends JS
911          try {
912              List<Future<String>> r
913                  = e.invokeAll(new ArrayList<Callable<String>>(),
914 <                              MEDIUM_DELAY_MS, MILLISECONDS);
914 >                              MEDIUM_DELAY_MS, TimeUnit.MILLISECONDS);
915              assertTrue(r.isEmpty());
916          } finally {
917              joinPool(e);
# Line 968 | Line 927 | public class ForkJoinPoolTest extends JS
927          l.add(new StringTask());
928          l.add(null);
929          try {
930 <            e.invokeAll(l, MEDIUM_DELAY_MS, MILLISECONDS);
930 >            e.invokeAll(l, MEDIUM_DELAY_MS, TimeUnit.MILLISECONDS);
931              shouldThrow();
932          } catch (NullPointerException success) {
933          } finally {
# Line 984 | Line 943 | public class ForkJoinPoolTest extends JS
943          List<Callable<String>> l = new ArrayList<Callable<String>>();
944          l.add(new NPETask());
945          List<Future<String>> futures
946 <            = e.invokeAll(l, MEDIUM_DELAY_MS, MILLISECONDS);
946 >            = e.invokeAll(l, MEDIUM_DELAY_MS, TimeUnit.MILLISECONDS);
947          assertEquals(1, futures.size());
948          try {
949              futures.get(0).get();
# Line 1006 | Line 965 | public class ForkJoinPoolTest extends JS
965              l.add(new StringTask());
966              l.add(new StringTask());
967              List<Future<String>> futures
968 <                = e.invokeAll(l, MEDIUM_DELAY_MS, MILLISECONDS);
968 >                = e.invokeAll(l, MEDIUM_DELAY_MS, TimeUnit.MILLISECONDS);
969              assertEquals(2, futures.size());
970              for (Future<String> future : futures)
971                  assertSame(TEST_STRING, future.get());

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines