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.52 by jsr166, Mon May 29 19:15:02 2017 UTC vs.
Revision 1.53 by jsr166, Wed Aug 16 17:18:34 2017 UTC

# Line 8 | Line 8 | import static java.util.concurrent.TimeU
8  
9   import java.util.Arrays;
10   import java.util.HashSet;
11 + import java.util.concurrent.Callable;
12   import java.util.concurrent.CancellationException;
13   import java.util.concurrent.ExecutionException;
14   import java.util.concurrent.ForkJoinPool;
# Line 1648 | Line 1649 | public class ForkJoinTaskTest extends JS
1649          testInvokeOnPool(mainPool(), a);
1650      }
1651  
1652 +    /**
1653 +     * adapt(runnable).toString() contains toString of wrapped task
1654 +     */
1655 +    public void testAdapt_Runnable_toString() {
1656 +        if (testImplementationDetails) {
1657 +            Runnable r = () -> {};
1658 +            ForkJoinTask<?> task = ForkJoinTask.adapt(r);
1659 +            assertEquals(
1660 +                identityString(task) + "[Wrapped task = " + r.toString() + "]",
1661 +                task.toString());
1662 +        }
1663 +    }
1664 +
1665 +    /**
1666 +     * adapt(runnable, x).toString() contains toString of wrapped task
1667 +     */
1668 +    public void testAdapt_Runnable_withResult_toString() {
1669 +        if (testImplementationDetails) {
1670 +            Runnable r = () -> {};
1671 +            ForkJoinTask<String> task = ForkJoinTask.adapt(r, "");
1672 +            assertEquals(
1673 +                identityString(task) + "[Wrapped task = " + r.toString() + "]",
1674 +                task.toString());
1675 +        }
1676 +    }
1677 +
1678 +    /**
1679 +     * adapt(callable).toString() contains toString of wrapped task
1680 +     */
1681 +    public void testAdapt_Callable_toString() {
1682 +        if (testImplementationDetails) {
1683 +            Callable<String> c = () -> "";
1684 +            ForkJoinTask<String> task = ForkJoinTask.adapt(c);
1685 +            assertEquals(
1686 +                identityString(task) + "[Wrapped task = " + c.toString() + "]",
1687 +                task.toString());
1688 +        }
1689 +    }
1690   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines