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.40 by jsr166, Sun May 15 17:32:29 2011 UTC vs.
Revision 1.42 by jsr166, Sun May 29 07:01:17 2011 UTC

# 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;
# 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       */
# Line 379 | Line 379 | public class ForkJoinPoolTest extends JS
379          }
380      }
381  
382
382      // FJ Versions of AbstractExecutorService tests
383  
384      /**
# Line 388 | Line 387 | public class ForkJoinPoolTest extends JS
387      public void testExecuteRunnable() throws Throwable {
388          ExecutorService e = new ForkJoinPool(1);
389          try {
390 <            TrackedRunnable task = trackedRunnable(SHORT_DELAY_MS);
391 <            assertFalse(task.isDone());
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              assertNull(future.get());
397 <            assertNull(future.get(MEDIUM_DELAY_MS, MILLISECONDS));
398 <            assertTrue(task.isDone());
397 >            assertNull(future.get(0, MILLISECONDS));
398 >            assertTrue(done.get());
399              assertTrue(future.isDone());
400              assertFalse(future.isCancelled());
401          } finally {
# Line 401 | Line 403 | public class ForkJoinPoolTest extends JS
403          }
404      }
405  
404
406      /**
407       * Completed submit(callable) returns result
408       */
# Line 520 | Line 521 | public class ForkJoinPoolTest extends JS
521          }
522      }
523  
523
524      /**
525       * submit(null callable) throws NullPointerException
526       */
# Line 535 | Line 535 | public class ForkJoinPoolTest extends JS
535          }
536      }
537  
538
538      /**
539       * submit(callable).get() throws InterruptedException if interrupted
540       */
# Line 764 | Line 763 | public class ForkJoinPoolTest extends JS
763          }
764      }
765  
767
766      /**
767       * timed invokeAny(null) throws NullPointerException
768       */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines