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

Comparing jsr166/src/test/tck/CompletableFutureTest.java (file contents):
Revision 1.15 by jsr166, Wed Apr 3 16:59:57 2013 UTC vs.
Revision 1.19 by jsr166, Sun Apr 7 15:04:14 2013 UTC

# Line 282 | Line 282 | public class CompletableFutureTest exten
282          checkCompletedNormally(f, "test");
283      }
284  
285 +    // Choose non-commutative actions for better coverage
286 +
287      static final Supplier<Integer> supplyOne =
288          () -> Integer.valueOf(1);
289      static final Function<Integer, Integer> inc =
290          (Integer x) -> Integer.valueOf(x.intValue() + 1);
291 <    static final BiFunction<Integer, Integer, Integer> add =
292 <        (Integer x, Integer y) -> Integer.valueOf(x.intValue() + y.intValue());
291 >    static final BiFunction<Integer, Integer, Integer> subtract =
292 >        (Integer x, Integer y) -> Integer.valueOf(x.intValue() - y.intValue());
293      static final class IncAction implements Consumer<Integer> {
294          int value;
295          public void accept(Integer x) { value = x.intValue() + 1; }
# Line 328 | Line 330 | public class CompletableFutureTest exten
330          public void run() { ran = true; throw new CFException(); }
331      }
332  
333 <    static final class CompletableFutureInc implements Function<Integer, CompletableFuture<Integer>> {
333 >    static final class CompletableFutureInc
334 >        implements Function<Integer, CompletableFuture<Integer>> {
335          public CompletableFuture<Integer> apply(Integer x) {
336              CompletableFuture<Integer> f = new CompletableFuture<Integer>();
337              f.complete(Integer.valueOf(x.intValue() + 1));
# Line 336 | Line 339 | public class CompletableFutureTest exten
339          }
340      }
341  
342 <    static final class FailingCompletableFutureFunction implements Function<Integer, CompletableFuture<Integer>> {
342 >    static final class FailingCompletableFutureFunction
343 >        implements Function<Integer, CompletableFuture<Integer>> {
344          boolean ran;
345          public CompletableFuture<Integer> apply(Integer x) {
346              ran = true; throw new CFException();
# Line 345 | Line 349 | public class CompletableFutureTest exten
349  
350      // Used for explicit executor tests
351      static final class ThreadExecutor implements Executor {
352 +        AtomicInteger count = new AtomicInteger(0);
353 +
354          public void execute(Runnable r) {
355 +            count.getAndIncrement();
356              new Thread(r).start();
357          }
358      }
# Line 432 | Line 439 | public class CompletableFutureTest exten
439       */
440      public void testRunAsync2() {
441          Noop r = new Noop();
442 <        CompletableFuture<Void> f = CompletableFuture.runAsync(r, new ThreadExecutor());
442 >        ThreadExecutor exec = new ThreadExecutor();
443 >        CompletableFuture<Void> f = CompletableFuture.runAsync(r, exec);
444          assertNull(f.join());
445          assertTrue(r.ran);
446          checkCompletedNormally(f, null);
447 +        assertEquals(1, exec.count.get());
448      }
449  
450      /**
# Line 452 | Line 461 | public class CompletableFutureTest exten
461       * supplyAsync completes with result of supplier
462       */
463      public void testSupplyAsync() {
464 <        CompletableFuture<Integer> f = CompletableFuture.supplyAsync(supplyOne);
464 >        CompletableFuture<Integer> f;
465 >        f = CompletableFuture.supplyAsync(supplyOne);
466          assertEquals(f.join(), one);
467 +        checkCompletedNormally(f, one);
468      }
469  
470      /**
471       * supplyAsync with executor completes with result of supplier
472       */
473      public void testSupplyAsync2() {
474 <        CompletableFuture<Integer> f = CompletableFuture.supplyAsync(supplyOne, new ThreadExecutor());
474 >        CompletableFuture<Integer> f;
475 >        f = CompletableFuture.supplyAsync(supplyOne, new ThreadExecutor());
476          assertEquals(f.join(), one);
477 +        checkCompletedNormally(f, one);
478      }
479  
480      /**
# Line 617 | Line 630 | public class CompletableFutureTest exten
630  
631  
632      /**
633 <     * thenCombine result completes normally after normal completion of sources
633 >     * thenCombine result completes normally after normal completion
634 >     * of sources
635       */
636      public void testThenCombine() {
637 <        CompletableFuture<Integer> f = new CompletableFuture<Integer>();
624 <        CompletableFuture<Integer> f2 = new CompletableFuture<Integer>();
625 <        CompletableFuture<Integer> g = f.thenCombine(f2, add);
626 <        f.complete(one);
627 <        checkIncomplete(g);
628 <        f2.complete(two);
629 <        checkCompletedNormally(g, three);
637 >        CompletableFuture<Integer> f, g, h;
638  
639          f = new CompletableFuture<Integer>();
640 <        f.complete(one);
641 <        f2 = new CompletableFuture<Integer>();
642 <        g = f.thenCombine(f2, add);
643 <        checkIncomplete(g);
644 <        f2.complete(two);
645 <        checkCompletedNormally(g, three);
640 >        g = new CompletableFuture<Integer>();
641 >        h = f.thenCombine(g, subtract);
642 >        f.complete(3);
643 >        checkIncomplete(h);
644 >        g.complete(1);
645 >        checkCompletedNormally(h, 2);
646 >
647 >        f = new CompletableFuture<Integer>();
648 >        g = new CompletableFuture<Integer>();
649 >        h = f.thenCombine(g, subtract);
650 >        g.complete(1);
651 >        checkIncomplete(h);
652 >        f.complete(3);
653 >        checkCompletedNormally(h, 2);
654 >
655 >        f = new CompletableFuture<Integer>();
656 >        g = new CompletableFuture<Integer>();
657 >        g.complete(1);
658 >        f.complete(3);
659 >        h = f.thenCombine(g, subtract);
660 >        checkCompletedNormally(h, 2);
661      }
662  
663      /**
# Line 642 | Line 665 | public class CompletableFutureTest exten
665       * completion of either source
666       */
667      public void testThenCombine2() {
668 <        CompletableFuture<Integer> f = new CompletableFuture<Integer>();
669 <        CompletableFuture<Integer> f2 = new CompletableFuture<Integer>();
670 <        CompletableFuture<Integer> g = f.thenCombine(f2, add);
668 >        CompletableFuture<Integer> f, g, h;
669 >
670 >        f = new CompletableFuture<Integer>();
671 >        g = new CompletableFuture<Integer>();
672 >        h = f.thenCombine(g, subtract);
673          f.completeExceptionally(new CFException());
674 <        f2.complete(two);
675 <        checkCompletedWithWrappedCFException(g);
674 >        checkIncomplete(h);
675 >        g.complete(1);
676 >        checkCompletedWithWrappedCFException(h);
677  
678          f = new CompletableFuture<Integer>();
679 <        f.complete(one);
680 <        f2 = new CompletableFuture<Integer>();
681 <        g = f.thenCombine(f2, add);
682 <        f2.completeExceptionally(new CFException());
683 <        checkCompletedWithWrappedCFException(g);
679 >        g = new CompletableFuture<Integer>();
680 >        h = f.thenCombine(g, subtract);
681 >        g.completeExceptionally(new CFException());
682 >        checkIncomplete(h);
683 >        f.complete(3);
684 >        checkCompletedWithWrappedCFException(h);
685 >
686 >        f = new CompletableFuture<Integer>();
687 >        g = new CompletableFuture<Integer>();
688 >        f.complete(3);
689 >        g.completeExceptionally(new CFException());
690 >        h = f.thenCombine(g, subtract);
691 >        checkCompletedWithWrappedCFException(h);
692 >
693 >        f = new CompletableFuture<Integer>();
694 >        g = new CompletableFuture<Integer>();
695 >        f.completeExceptionally(new CFException());
696 >        g.complete(3);
697 >        h = f.thenCombine(g, subtract);
698 >        checkCompletedWithWrappedCFException(h);
699      }
700  
701      /**
# Line 667 | Line 708 | public class CompletableFutureTest exten
708          CompletableFuture<Integer> g = f.thenCombine(f2, r);
709          f.complete(one);
710          checkIncomplete(g);
711 +        assertFalse(r.ran);
712          f2.complete(two);
713          checkCompletedWithWrappedCFException(g);
714 +        assertTrue(r.ran);
715      }
716  
717      /**
718       * thenCombine result completes exceptionally if either source cancelled
719       */
720      public void testThenCombine4() {
721 <        CompletableFuture<Integer> f = new CompletableFuture<Integer>();
722 <        CompletableFuture<Integer> f2 = new CompletableFuture<Integer>();
723 <        CompletableFuture<Integer> g = f.thenCombine(f2, add);
721 >        CompletableFuture<Integer> f, g, h;
722 >
723 >        f = new CompletableFuture<Integer>();
724 >        g = new CompletableFuture<Integer>();
725 >        h = f.thenCombine(g, subtract);
726          assertTrue(f.cancel(true));
727 <        f2.complete(two);
728 <        checkCompletedWithWrappedCancellationException(g);
727 >        checkIncomplete(h);
728 >        g.complete(1);
729 >        checkCompletedWithWrappedCancellationException(h);
730 >
731          f = new CompletableFuture<Integer>();
732 <        f2 = new CompletableFuture<Integer>();
733 <        g = f.thenCombine(f2, add);
734 <        f.complete(one);
735 <        assertTrue(f2.cancel(true));
736 <        checkCompletedWithWrappedCancellationException(g);
732 >        g = new CompletableFuture<Integer>();
733 >        h = f.thenCombine(g, subtract);
734 >        assertTrue(g.cancel(true));
735 >        checkIncomplete(h);
736 >        f.complete(3);
737 >        checkCompletedWithWrappedCancellationException(h);
738 >
739 >        f = new CompletableFuture<Integer>();
740 >        g = new CompletableFuture<Integer>();
741 >        assertTrue(f.cancel(true));
742 >        assertTrue(g.cancel(true));
743 >        h = f.thenCombine(g, subtract);
744 >        checkCompletedWithWrappedCancellationException(h);
745      }
746  
747      /**
# Line 1259 | Line 1314 | public class CompletableFutureTest exten
1314          assertTrue(f.cancel(true));
1315          checkCompletedWithWrappedCancellationException(g);
1316      }
1317 +
1318      /**
1319       * thenCombineAsync result completes normally after normal
1320       * completion of sources
1321       */
1322      public void testThenCombineAsync() {
1323 <        CompletableFuture<Integer> f = new CompletableFuture<Integer>();
1324 <        CompletableFuture<Integer> f2 = new CompletableFuture<Integer>();
1325 <        CompletableFuture<Integer> g = f.thenCombineAsync(f2, add);
1326 <        f.complete(one);
1327 <        checkIncomplete(g);
1328 <        f2.complete(two);
1329 <        checkCompletedNormally(g, three);
1323 >        CompletableFuture<Integer> f, g, h;
1324 >
1325 >        f = new CompletableFuture<Integer>();
1326 >        g = new CompletableFuture<Integer>();
1327 >        h = f.thenCombineAsync(g, subtract);
1328 >        f.complete(3);
1329 >        checkIncomplete(h);
1330 >        g.complete(1);
1331 >        checkCompletedNormally(h, 2);
1332 >
1333 >        f = new CompletableFuture<Integer>();
1334 >        g = new CompletableFuture<Integer>();
1335 >        h = f.thenCombineAsync(g, subtract);
1336 >        g.complete(1);
1337 >        checkIncomplete(h);
1338 >        f.complete(3);
1339 >        checkCompletedNormally(h, 2);
1340 >
1341 >        f = new CompletableFuture<Integer>();
1342 >        g = new CompletableFuture<Integer>();
1343 >        g.complete(1);
1344 >        f.complete(3);
1345 >        h = f.thenCombineAsync(g, subtract);
1346 >        checkCompletedNormally(h, 2);
1347      }
1348  
1349      /**
1350       * thenCombineAsync result completes exceptionally after exceptional
1351 <     * completion of source
1351 >     * completion of either source
1352       */
1353      public void testThenCombineAsync2() {
1354 <        CompletableFuture<Integer> f = new CompletableFuture<Integer>();
1355 <        CompletableFuture<Integer> f2 = new CompletableFuture<Integer>();
1356 <        CompletableFuture<Integer> g = f.thenCombineAsync(f2, add);
1354 >        CompletableFuture<Integer> f, g, h;
1355 >
1356 >        f = new CompletableFuture<Integer>();
1357 >        g = new CompletableFuture<Integer>();
1358 >        h = f.thenCombineAsync(g, subtract);
1359          f.completeExceptionally(new CFException());
1360 <        f2.complete(two);
1361 <        checkCompletedWithWrappedCFException(g);
1360 >        checkIncomplete(h);
1361 >        g.complete(1);
1362 >        checkCompletedWithWrappedCFException(h);
1363  
1364          f = new CompletableFuture<Integer>();
1365 <        f2 = new CompletableFuture<Integer>();
1366 <        g = f.thenCombineAsync(f2, add);
1367 <        f.complete(one);
1368 <        f2.completeExceptionally(new CFException());
1369 <        checkCompletedWithWrappedCFException(g);
1365 >        g = new CompletableFuture<Integer>();
1366 >        h = f.thenCombineAsync(g, subtract);
1367 >        g.completeExceptionally(new CFException());
1368 >        checkIncomplete(h);
1369 >        f.complete(3);
1370 >        checkCompletedWithWrappedCFException(h);
1371 >
1372 >        f = new CompletableFuture<Integer>();
1373 >        g = new CompletableFuture<Integer>();
1374 >        g.completeExceptionally(new CFException());
1375 >        f.complete(3);
1376 >        h = f.thenCombineAsync(g, subtract);
1377 >        checkCompletedWithWrappedCFException(h);
1378      }
1379  
1380      /**
# Line 1303 | Line 1387 | public class CompletableFutureTest exten
1387          CompletableFuture<Integer> g = f.thenCombineAsync(f2, r);
1388          f.complete(one);
1389          checkIncomplete(g);
1390 +        assertFalse(r.ran);
1391          f2.complete(two);
1392          checkCompletedWithWrappedCFException(g);
1393 +        assertTrue(r.ran);
1394      }
1395  
1396      /**
1397       * thenCombineAsync result completes exceptionally if either source cancelled
1398       */
1399      public void testThenCombineAsync4() {
1400 <        CompletableFuture<Integer> f = new CompletableFuture<Integer>();
1401 <        CompletableFuture<Integer> f2 = new CompletableFuture<Integer>();
1402 <        CompletableFuture<Integer> g = f.thenCombineAsync(f2, add);
1400 >        CompletableFuture<Integer> f, g, h;
1401 >
1402 >        f = new CompletableFuture<Integer>();
1403 >        g = new CompletableFuture<Integer>();
1404 >        h = f.thenCombineAsync(g, subtract);
1405          assertTrue(f.cancel(true));
1406 <        f2.complete(two);
1407 <        checkCompletedWithWrappedCancellationException(g);
1406 >        checkIncomplete(h);
1407 >        g.complete(1);
1408 >        checkCompletedWithWrappedCancellationException(h);
1409  
1410          f = new CompletableFuture<Integer>();
1411 <        f2 = new CompletableFuture<Integer>();
1412 <        g = f.thenCombineAsync(f2, add);
1413 <        f.complete(one);
1414 <        assertTrue(f2.cancel(true));
1415 <        checkCompletedWithWrappedCancellationException(g);
1411 >        g = new CompletableFuture<Integer>();
1412 >        h = f.thenCombineAsync(g, subtract);
1413 >        assertTrue(g.cancel(true));
1414 >        checkIncomplete(h);
1415 >        f.complete(3);
1416 >        checkCompletedWithWrappedCancellationException(h);
1417 >
1418 >        f = new CompletableFuture<Integer>();
1419 >        g = new CompletableFuture<Integer>();
1420 >        g.complete(3);
1421 >        assertTrue(f.cancel(true));
1422 >        h = f.thenCombineAsync(g, subtract);
1423 >        checkCompletedWithWrappedCancellationException(h);
1424 >
1425 >        f = new CompletableFuture<Integer>();
1426 >        g = new CompletableFuture<Integer>();
1427 >        f.complete(3);
1428 >        assertTrue(g.cancel(true));
1429 >        h = f.thenCombineAsync(g, subtract);
1430 >        checkCompletedWithWrappedCancellationException(h);
1431      }
1432  
1433      /**
# Line 1882 | Line 1986 | public class CompletableFutureTest exten
1986          assertTrue(f.cancel(true));
1987          checkCompletedWithWrappedCancellationException(g);
1988      }
1989 +
1990      /**
1991       * thenCombineAsync result completes normally after normal
1992       * completion of sources
1993       */
1994      public void testThenCombineAsyncE() {
1995 <        CompletableFuture<Integer> f = new CompletableFuture<Integer>();
1996 <        CompletableFuture<Integer> f2 = new CompletableFuture<Integer>();
1997 <        CompletableFuture<Integer> g = f.thenCombineAsync(f2, add, new ThreadExecutor());
1998 <        f.complete(one);
1999 <        checkIncomplete(g);
2000 <        f2.complete(two);
2001 <        checkCompletedNormally(g, three);
1995 >        CompletableFuture<Integer> f, g, h;
1996 >        ThreadExecutor e = new ThreadExecutor();
1997 >        int count = 0;
1998 >
1999 >        f = new CompletableFuture<Integer>();
2000 >        g = new CompletableFuture<Integer>();
2001 >        h = f.thenCombineAsync(g, subtract, e);
2002 >        f.complete(3);
2003 >        checkIncomplete(h);
2004 >        g.complete(1);
2005 >        checkCompletedNormally(h, 2);
2006 >        assertEquals(++count, e.count.get());
2007 >
2008 >        f = new CompletableFuture<Integer>();
2009 >        g = new CompletableFuture<Integer>();
2010 >        h = f.thenCombineAsync(g, subtract, e);
2011 >        g.complete(1);
2012 >        checkIncomplete(h);
2013 >        f.complete(3);
2014 >        checkCompletedNormally(h, 2);
2015 >        assertEquals(++count, e.count.get());
2016 >
2017 >        f = new CompletableFuture<Integer>();
2018 >        g = new CompletableFuture<Integer>();
2019 >        g.complete(1);
2020 >        f.complete(3);
2021 >        h = f.thenCombineAsync(g, subtract, e);
2022 >        checkCompletedNormally(h, 2);
2023 >        assertEquals(++count, e.count.get());
2024      }
2025  
2026      /**
2027       * thenCombineAsync result completes exceptionally after exceptional
2028 <     * completion of source
2028 >     * completion of either source
2029       */
2030      public void testThenCombineAsync2E() {
2031 <        CompletableFuture<Integer> f = new CompletableFuture<Integer>();
2032 <        CompletableFuture<Integer> f2 = new CompletableFuture<Integer>();
2033 <        CompletableFuture<Integer> g = f.thenCombineAsync(f2, add, new ThreadExecutor());
2031 >        CompletableFuture<Integer> f, g, h;
2032 >        ThreadExecutor e = new ThreadExecutor();
2033 >        int count = 0;
2034 >
2035 >        f = new CompletableFuture<Integer>();
2036 >        g = new CompletableFuture<Integer>();
2037 >        h = f.thenCombineAsync(g, subtract, e);
2038          f.completeExceptionally(new CFException());
2039 <        f2.complete(two);
2040 <        checkCompletedWithWrappedCFException(g);
2039 >        checkIncomplete(h);
2040 >        g.complete(1);
2041 >        checkCompletedWithWrappedCFException(h);
2042  
2043          f = new CompletableFuture<Integer>();
2044 <        f2 = new CompletableFuture<Integer>();
2045 <        g = f.thenCombineAsync(f2, add, new ThreadExecutor());
2046 <        f.complete(one);
2047 <        f2.completeExceptionally(new CFException());
2048 <        checkCompletedWithWrappedCFException(g);
2044 >        g = new CompletableFuture<Integer>();
2045 >        h = f.thenCombineAsync(g, subtract, e);
2046 >        g.completeExceptionally(new CFException());
2047 >        checkIncomplete(h);
2048 >        f.complete(3);
2049 >        checkCompletedWithWrappedCFException(h);
2050 >
2051 >        f = new CompletableFuture<Integer>();
2052 >        g = new CompletableFuture<Integer>();
2053 >        g.completeExceptionally(new CFException());
2054 >        h = f.thenCombineAsync(g, subtract, e);
2055 >        checkIncomplete(h);
2056 >        f.complete(3);
2057 >        checkCompletedWithWrappedCFException(h);
2058 >
2059 >        assertEquals(0, e.count.get());
2060      }
2061  
2062      /**
# Line 1926 | Line 2069 | public class CompletableFutureTest exten
2069          CompletableFuture<Integer> g = f.thenCombineAsync(f2, r, new ThreadExecutor());
2070          f.complete(one);
2071          checkIncomplete(g);
2072 +        assertFalse(r.ran);
2073          f2.complete(two);
2074          checkCompletedWithWrappedCFException(g);
2075 +        assertTrue(r.ran);
2076      }
2077  
2078      /**
2079       * thenCombineAsync result completes exceptionally if either source cancelled
2080       */
2081      public void testThenCombineAsync4E() {
2082 <        CompletableFuture<Integer> f = new CompletableFuture<Integer>();
2083 <        CompletableFuture<Integer> f2 = new CompletableFuture<Integer>();
2084 <        CompletableFuture<Integer> g = f.thenCombineAsync(f2, add, new ThreadExecutor());
2082 >        CompletableFuture<Integer> f, g, h;
2083 >        ThreadExecutor e = new ThreadExecutor();
2084 >
2085 >        f = new CompletableFuture<Integer>();
2086 >        g = new CompletableFuture<Integer>();
2087 >        h = f.thenCombineAsync(g, subtract, e);
2088          assertTrue(f.cancel(true));
2089 <        f2.complete(two);
2090 <        checkCompletedWithWrappedCancellationException(g);
2089 >        checkIncomplete(h);
2090 >        g.complete(1);
2091 >        checkCompletedWithWrappedCancellationException(h);
2092  
2093          f = new CompletableFuture<Integer>();
2094 <        f2 = new CompletableFuture<Integer>();
2095 <        g = f.thenCombineAsync(f2, add, new ThreadExecutor());
2096 <        f.complete(one);
2097 <        assertTrue(f2.cancel(true));
2098 <        checkCompletedWithWrappedCancellationException(g);
2094 >        g = new CompletableFuture<Integer>();
2095 >        h = f.thenCombineAsync(g, subtract, e);
2096 >        assertTrue(g.cancel(true));
2097 >        checkIncomplete(h);
2098 >        f.complete(3);
2099 >        checkCompletedWithWrappedCancellationException(h);
2100 >
2101 >        f = new CompletableFuture<Integer>();
2102 >        g = new CompletableFuture<Integer>();
2103 >        assertTrue(g.cancel(true));
2104 >        h = f.thenCombineAsync(g, subtract, e);
2105 >        checkIncomplete(h);
2106 >        f.complete(3);
2107 >        checkCompletedWithWrappedCancellationException(h);
2108 >
2109 >        f = new CompletableFuture<Integer>();
2110 >        g = new CompletableFuture<Integer>();
2111 >        assertTrue(f.cancel(true));
2112 >        assertTrue(g.cancel(true));
2113 >        h = f.thenCombineAsync(g, subtract, e);
2114 >        checkCompletedWithWrappedCancellationException(h);
2115 >
2116 >        assertEquals(0, e.count.get());
2117      }
2118  
2119      /**
# Line 2418 | Line 2585 | public class CompletableFutureTest exten
2585          CompletableFuture<Integer> g = new CompletableFuture<Integer>();
2586          CompletableFuture<Integer> nullFuture = (CompletableFuture<Integer>)null;
2587          CompletableFuture<?> h;
2588 <        Executor exec = new ThreadExecutor();
2588 >        ThreadExecutor exec = new ThreadExecutor();
2589  
2590          Runnable[] throwingActions = {
2591              () -> { CompletableFuture.supplyAsync(null); },
2592              () -> { CompletableFuture.supplyAsync(null, exec); },
2593 <            () -> { CompletableFuture.supplyAsync(() -> one, null); },
2593 >            () -> { CompletableFuture.supplyAsync(supplyOne, null); },
2594  
2595              () -> { CompletableFuture.runAsync(null); },
2596              () -> { CompletableFuture.runAsync(null, exec); },
# Line 2512 | Line 2679 | public class CompletableFutureTest exten
2679              () -> { CompletableFuture.anyOf((CompletableFuture<?>[])null); },
2680              () -> { CompletableFuture.anyOf(f, null); },
2681              () -> { CompletableFuture.anyOf(null, f); },
2515
2516            // TODO: Crashes javac with lambda-8-2013-03-31...
2517            //() -> { CompletableFuture<?> x = f.thenAccept(null); },
2518            //() -> { CompletableFuture<Void> x = f.thenRun(null); },
2519            //() -> { CompletableFuture<Integer> x = f.thenApply(() -> { ; }); },
2682          };
2683  
2684          assertThrows(NullPointerException.class, throwingActions);
2685 +        assertEquals(0, exec.count.get());
2686      }
2687  
2688   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines