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.191 by jsr166, Sun Jan 7 22:59:17 2018 UTC vs.
Revision 1.195 by jsr166, Sun Jul 22 20:09:31 2018 UTC

# Line 41 | Line 41 | import java.util.function.Function;
41   import java.util.function.Predicate;
42   import java.util.function.Supplier;
43  
44 import junit.framework.AssertionFailedError;
44   import junit.framework.Test;
45   import junit.framework.TestSuite;
46  
# Line 60 | Line 59 | public class CompletableFutureTest exten
59          assertFalse(f.isDone());
60          assertFalse(f.isCancelled());
61          assertTrue(f.toString().matches(".*\\[.*Not completed.*\\]"));
62 +
63 +        Object result = null;
64          try {
65 <            assertNull(f.getNow(null));
65 >            result = f.getNow(null);
66          } catch (Throwable fail) { threadUnexpectedException(fail); }
67 +        assertNull(result);
68 +
69          try {
70              f.get(randomExpiredTimeout(), randomTimeUnit());
71              shouldThrow();
# Line 292 | Line 295 | public class CompletableFutureTest exten
295          }
296  
297          f = new CompletableFuture<>();
298 <        f.completeExceptionally(ex = new CFException());
298 >        f.completeExceptionally(new CFException());
299          f.obtrudeValue(v1);
300          checkCompletedNormally(f, v1);
301          f.obtrudeException(ex = new CFException());
# Line 4190 | Line 4193 | public class CompletableFutureTest exten
4193          static void assertZero(CompletableFuture<?> f) {
4194              try {
4195                  f.getNow(null);
4196 <                throw new AssertionFailedError("should throw");
4196 >                throw new AssertionError("should throw");
4197              } catch (CompletionException success) {
4198                  assertTrue(success.getCause() instanceof ZeroException);
4199              }
# Line 4389 | Line 4392 | public class CompletableFutureTest exten
4392              f.complete(null);
4393  
4394              f = new CompletableFuture<>();
4395 <            CompletableFuture.anyOf(new CompletableFuture<?>[] { f, incomplete });
4395 >            CompletableFuture.anyOf(f, incomplete);
4396              f.complete(null);
4397          }
4398  
# Line 4407 | Line 4410 | public class CompletableFutureTest exten
4410              f.complete(null);
4411  
4412              f = new CompletableFuture<>();
4413 <            CompletableFuture.anyOf(new CompletableFuture<?>[] { incomplete, f });
4413 >            CompletableFuture.anyOf(incomplete, f);
4414              f.complete(null);
4415          }
4416      }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines