ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/tck/CountedCompleterTest.java
(Generate patch)

Comparing jsr166/src/test/tck/CountedCompleterTest.java (file contents):
Revision 1.15 by jsr166, Wed Dec 31 17:00:58 2014 UTC vs.
Revision 1.19 by jsr166, Sun Oct 4 18:40:57 2015 UTC

# Line 3 | Line 3
3   * Expert Group and released to the public domain, as explained at
4   * http://creativecommons.org/publicdomain/zero/1.0/
5   */
6 +
7 + import static java.util.concurrent.TimeUnit.MILLISECONDS;
8 + import static java.util.concurrent.TimeUnit.SECONDS;
9 +
10   import java.util.HashSet;
11   import java.util.concurrent.CancellationException;
12   import java.util.concurrent.CountedCompleter;
# Line 12 | Line 16 | import java.util.concurrent.ForkJoinTask
16   import java.util.concurrent.TimeoutException;
17   import java.util.concurrent.atomic.AtomicInteger;
18   import java.util.concurrent.atomic.AtomicReference;
19 < import static java.util.concurrent.TimeUnit.MILLISECONDS;
20 < import static java.util.concurrent.TimeUnit.SECONDS;
21 < import junit.framework.*;
19 >
20 > import junit.framework.Test;
21 > import junit.framework.TestSuite;
22  
23   public class CountedCompleterTest extends JSR166TestCase {
24  
25      public static void main(String[] args) {
26 <        junit.textui.TestRunner.run(suite());
26 >        main(suite(), args);
27      }
28  
29      public static Test suite() {
# Line 45 | Line 49 | public class CountedCompleterTest extend
49      }
50  
51      private void testInvokeOnPool(ForkJoinPool pool, ForkJoinTask a) {
52 <        try {
52 >        try (PoolCleaner cleaner = cleaner(pool)) {
53              assertFalse(a.isDone());
54              assertFalse(a.isCompletedNormally());
55              assertFalse(a.isCompletedAbnormally());
# Line 61 | Line 65 | public class CountedCompleterTest extend
65              assertFalse(a.isCancelled());
66              assertNull(a.getException());
67              assertNull(a.getRawResult());
64        } finally {
65            joinPool(pool);
68          }
69      }
70  
# Line 194 | Line 196 | public class CountedCompleterTest extend
196          try {
197              a.invoke();
198              shouldThrow();
199 <        } catch (Throwable ex) {
200 <            assertSame(t, ex);
199 >        } catch (Throwable success) {
200 >            assertSame(t, success);
201          }
202      }
203  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines