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

Comparing jsr166/src/test/tck/ForkJoinTaskTest.java (file contents):
Revision 1.34 by jsr166, Mon Jun 3 18:20:05 2013 UTC vs.
Revision 1.39 by jsr166, Wed Dec 31 17:00:58 2014 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 < import java.util.concurrent.ExecutionException;
6 > import java.util.HashSet;
7   import java.util.concurrent.CancellationException;
8 + import java.util.concurrent.ExecutionException;
9   import java.util.concurrent.ForkJoinPool;
10   import java.util.concurrent.ForkJoinTask;
10 import java.util.concurrent.ForkJoinWorkerThread;
11   import java.util.concurrent.RecursiveAction;
12 import java.util.concurrent.TimeUnit;
12   import java.util.concurrent.TimeoutException;
13   import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
14   import static java.util.concurrent.TimeUnit.MILLISECONDS;
15   import static java.util.concurrent.TimeUnit.SECONDS;
17 import java.util.HashSet;
16   import junit.framework.*;
17  
18   public class ForkJoinTaskTest extends JSR166TestCase {
# Line 918 | Line 916 | public class ForkJoinTaskTest extends JS
916      }
917  
918      /**
919 <     * invokeAll(collection)  throws exception if any task does
919 >     * invokeAll(collection) throws exception if any task does
920       */
921      public void testAbnormalInvokeAllCollection() {
922          RecursiveAction a = new CheckedRecursiveAction() {
# Line 1585 | Line 1583 | public class ForkJoinTaskTest extends JS
1583      }
1584  
1585      /**
1586 <     * invokeAll(collection)  throws exception if any task does
1586 >     * invokeAll(collection) throws exception if any task does
1587       */
1588      public void testAbnormalInvokeAllCollectionSingleton() {
1589          RecursiveAction a = new CheckedRecursiveAction() {
# Line 1607 | Line 1605 | public class ForkJoinTaskTest extends JS
1605          testInvokeOnPool(singletonPool(), a);
1606      }
1607  
1608 +    /**
1609 +     * ForkJoinTask.quietlyComplete returns when task completes
1610 +     * normally without setting a value. The most recent value
1611 +     * established by setRawResult(V) (or null by default) is returned
1612 +     * from invoke.
1613 +     */
1614 +    public void testQuietlyComplete() {
1615 +        RecursiveAction a = new CheckedRecursiveAction() {
1616 +                protected void realCompute() {
1617 +                    AsyncFib f = new AsyncFib(8);
1618 +                    f.quietlyComplete();
1619 +                    assertEquals(8, f.number);
1620 +                    checkCompletedNormally(f);
1621 +                }};
1622 +        testInvokeOnPool(mainPool(), a);
1623 +    }
1624 +
1625   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines