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.123 by jsr166, Tue Sep 8 19:45:35 2015 UTC vs.
Revision 1.127 by jsr166, Sun Oct 25 02:58:25 2015 UTC

# Line 36 | Line 36 | import java.util.function.BiConsumer;
36   import java.util.function.BiFunction;
37   import java.util.function.Consumer;
38   import java.util.function.Function;
39 + import java.util.function.Predicate;
40   import java.util.function.Supplier;
41  
42   import junit.framework.Test;
# Line 836 | Line 837 | public class CompletableFutureTest exten
837          if (!createIncomplete) assertTrue(f.complete(v1));
838          final CompletableFuture<Integer> g = f.exceptionally
839              ((Throwable t) -> {
839                // Should not be called
840                  a.getAndIncrement();
841 <                throw new AssertionError();
841 >                threadFail("should not be called");
842 >                return null;            // unreached
843              });
844          if (createIncomplete) assertTrue(f.complete(v1));
845  
# Line 897 | Line 898 | public class CompletableFutureTest exten
898       * whenComplete action executes on normal completion, propagating
899       * source result.
900       */
901 <    public void testWhenComplete_normalCompletion1() {
901 >    public void testWhenComplete_normalCompletion() {
902          for (ExecutionMode m : ExecutionMode.values())
903          for (boolean createIncomplete : new boolean[] { true, false })
904          for (Integer v1 : new Integer[] { 1, null })
# Line 3703 | Line 3704 | public class CompletableFutureTest exten
3704          if (!testImplementationDetails) return;
3705          Function<Method, String> toSignature =
3706              (method) -> method.getName() + Arrays.toString(method.getParameterTypes());
3707 +        Predicate<Method> isNotStatic =
3708 +            (method) -> (method.getModifiers() & Modifier.STATIC) == 0;
3709          List<Method> minimalMethods =
3710              Stream.of(Object.class, CompletionStage.class)
3711 <            .map((klazz) -> Stream.of(klazz.getMethods()))
3712 <            .reduce(Stream::concat)
3710 <            .orElseGet(Stream::empty)
3711 <            .filter((method) -> (method.getModifiers() & Modifier.STATIC) == 0)
3711 >            .flatMap((klazz) -> Stream.of(klazz.getMethods()))
3712 >            .filter(isNotStatic)
3713              .collect(Collectors.toList());
3714          // Methods from CompletableFuture permitted NOT to throw UOE
3715          String[] signatureWhitelist = {
# Line 3722 | Line 3723 | public class CompletableFutureTest exten
3723                            Stream.of(signatureWhitelist))
3724              .collect(Collectors.toSet());
3725          List<Method> allMethods = Stream.of(CompletableFuture.class.getMethods())
3726 <            .filter((method) -> (method.getModifiers() & Modifier.STATIC) == 0)
3726 >            .filter(isNotStatic)
3727              .filter((method) -> !permittedMethodSignatures.contains(toSignature.apply(method)))
3728              .collect(Collectors.toList());
3729  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines