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.54 by jsr166, Wed Dec 31 19:05:42 2014 UTC vs.
Revision 1.57 by jsr166, Sat Oct 3 16:57:25 2015 UTC

# Line 32 | Line 32 | import junit.framework.TestSuite;
32  
33   public class ForkJoinPoolTest extends JSR166TestCase {
34      public static void main(String[] args) {
35 <        junit.textui.TestRunner.run(suite());
35 >        main(suite(), args);
36      }
37  
38      public static Test suite() {
# Line 981 | Line 981 | public class ForkJoinPoolTest extends JS
981       * timed invokeAll(c) returns results of all completed tasks in c
982       */
983      public void testTimedInvokeAll5() throws Throwable {
984 <        ExecutorService e = new ForkJoinPool(1);
985 <        try {
984 >        try (PoolCloser<ForkJoinPool> poolCloser
985 >             = new PoolCloser(new ForkJoinPool(1))) {
986 >            ForkJoinPool e = poolCloser.pool;
987              List<Callable<String>> l = new ArrayList<Callable<String>>();
988              l.add(new StringTask());
989              l.add(new StringTask());
990              List<Future<String>> futures
991 <                = e.invokeAll(l, MEDIUM_DELAY_MS, MILLISECONDS);
991 >                = e.invokeAll(l, LONG_DELAY_MS, MILLISECONDS);
992              assertEquals(2, futures.size());
993              for (Future<String> future : futures)
994                  assertSame(TEST_STRING, future.get());
994        } finally {
995            joinPool(e);
995          }
996      }
997  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines