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

Comparing jsr166/src/test/tck/ForkJoinTask8Test.java (file contents):
Revision 1.9 by jsr166, Sat Feb 7 17:43:38 2015 UTC vs.
Revision 1.11 by jsr166, Sat Feb 7 19:24:47 2015 UTC

# Line 721 | Line 721 | public class ForkJoinTask8Test extends J
721      }
722  
723      /**
724 <     * invokeAll(tasks) with any null task throws NPE
724 >     * invokeAll(tasks) with any null task throws NullPointerException
725       */
726 <    public void testInvokeAllNPE() {
726 >    public void testInvokeAllNullTask() {
727          RecursiveAction a = new CheckedRecursiveAction() {
728              protected void realCompute() {
729                  AsyncFib f = new AsyncFib(8);
730                  AsyncFib g = new AsyncFib(9);
731 <                AsyncFib h = null;
731 >                AsyncFib nul = null;
732                  Runnable[] throwingActions = {
733 <                    () -> invokeAll(h),
734 <                    () -> invokeAll(f, g, h),
735 <                    () -> invokeAll(f, h, g),
736 <                    () -> invokeAll(h, f, g),
733 >                    () -> invokeAll(nul),
734 >                    () -> invokeAll(nul, nul),
735 >                    () -> invokeAll(f, g, nul),
736 >                    () -> invokeAll(f, nul, g),
737 >                    () -> invokeAll(nul, f, g),
738                  };
739                  assertThrows(NullPointerException.class, throwingActions);
740              }};
# Line 1301 | Line 1302 | public class ForkJoinTask8Test extends J
1302      }
1303  
1304      /**
1305 <     * invokeAll(tasks) with any null task throws NPE
1305 >     * invokeAll(tasks) with any null task throws NullPointerException
1306       */
1307 <    public void testInvokeAllNPESingleton() {
1307 >    public void testInvokeAllNullTaskSingleton() {
1308          RecursiveAction a = new CheckedRecursiveAction() {
1309              protected void realCompute() {
1310                  AsyncFib f = new AsyncFib(8);
1311                  AsyncFib g = new AsyncFib(9);
1312 <                AsyncFib h = null;
1313 <                try {
1314 <                    invokeAll(f, g, h);
1315 <                    shouldThrow();
1316 <                } catch (NullPointerException success) {}
1312 >                AsyncFib nul = null;
1313 >                Runnable[] throwingActions = {
1314 >                    () -> invokeAll(nul),
1315 >                    () -> invokeAll(nul, nul),
1316 >                    () -> invokeAll(f, g, nul),
1317 >                    () -> invokeAll(f, nul, g),
1318 >                    () -> invokeAll(nul, f, g),
1319 >                };
1320 >                assertThrows(NullPointerException.class, throwingActions);
1321              }};
1322          testInvokeOnPool(singletonPool(), a);
1323      }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines