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.164 by jsr166, Sun Jul 3 18:58:15 2016 UTC vs.
Revision 1.165 by jsr166, Sun Jul 3 19:35:50 2016 UTC

# Line 3935 | Line 3935 | public class CompletableFutureTest exten
3935      }}
3936  
3937      /**
3938 <     * Minimal completion stages throw UOE for all non-CompletionStage methods
3938 >     * Minimal completion stages throw UOE for most non-CompletionStage methods
3939       */
3940      public void testMinimalCompletionStage_minimality() {
3941          if (!testImplementationDetails) return;
# Line 3964 | Line 3964 | public class CompletableFutureTest exten
3964              .filter((method) -> !permittedMethodSignatures.contains(toSignature.apply(method)))
3965              .collect(Collectors.toList());
3966  
3967 <        CompletionStage<Integer> minimalStage =
3968 <            new CompletableFuture<Integer>().minimalCompletionStage();
3967 >        List<CompletionStage<Integer>> stages = new ArrayList<>();
3968 >        stages.add(new CompletableFuture<Integer>().minimalCompletionStage());
3969 >        stages.add(CompletableFuture.completedStage(1));
3970  
3971          List<Method> bugs = new ArrayList<>();
3972          for (Method method : allMethods) {
# Line 3981 | Line 3982 | public class CompletableFutureTest exten
3982                  else if (parameterTypes[i] == long.class)
3983                      args[i] = 0L;
3984              }
3985 <            try {
3986 <                method.invoke(minimalStage, args);
3987 <                bugs.add(method);
3987 <            }
3988 <            catch (java.lang.reflect.InvocationTargetException expected) {
3989 <                if (! (expected.getCause() instanceof UnsupportedOperationException)) {
3985 >            for (CompletionStage<Integer> stage : stages) {
3986 >                try {
3987 >                    method.invoke(stage, args);
3988                      bugs.add(method);
3991                    // expected.getCause().printStackTrace();
3989                  }
3990 +                catch (java.lang.reflect.InvocationTargetException expected) {
3991 +                    if (! (expected.getCause() instanceof UnsupportedOperationException)) {
3992 +                        bugs.add(method);
3993 +                        // expected.getCause().printStackTrace();
3994 +                    }
3995 +                }
3996 +                catch (ReflectiveOperationException bad) { throw new Error(bad); }
3997              }
3994            catch (ReflectiveOperationException bad) { throw new Error(bad); }
3998          }
3999          if (!bugs.isEmpty())
4000 <            throw new Error("Methods did not throw UOE: " + bugs.toString());
4000 >            throw new Error("Methods did not throw UOE: " + bugs);
4001      }
4002  
4003      static class Monad {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines