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.184 by jsr166, Sat Mar 18 20:42:20 2017 UTC vs.
Revision 1.187 by jsr166, Mon Jul 3 21:18:37 2017 UTC

# Line 64 | Line 64 | public class CompletableFutureTest exten
64              assertNull(f.getNow(null));
65          } catch (Throwable fail) { threadUnexpectedException(fail); }
66          try {
67 <            f.get(0L, SECONDS);
67 >            f.get(randomExpiredTimeout(), randomTimeUnit());
68              shouldThrow();
69          }
70          catch (TimeoutException success) {}
# Line 76 | Line 76 | public class CompletableFutureTest exten
76  
77          try {
78              assertEquals(value, f.join());
79        } catch (Throwable fail) { threadUnexpectedException(fail); }
80        try {
79              assertEquals(value, f.getNow(null));
82        } catch (Throwable fail) { threadUnexpectedException(fail); }
83        try {
80              assertEquals(value, f.get());
81          } catch (Throwable fail) { threadUnexpectedException(fail); }
82          assertTrue(f.isDone());
# Line 1242 | Line 1238 | public class CompletableFutureTest exten
1238          r.assertInvoked();
1239      }}
1240  
1241 +    @SuppressWarnings("FutureReturnValueIgnored")
1242      public void testRunAsync_rejectingExecutor() {
1243          CountingRejectingExecutor e = new CountingRejectingExecutor();
1244          try {
# Line 1288 | Line 1285 | public class CompletableFutureTest exten
1285          r.assertInvoked();
1286      }}
1287  
1288 +    @SuppressWarnings("FutureReturnValueIgnored")
1289      public void testSupplyAsync_rejectingExecutor() {
1290          CountingRejectingExecutor e = new CountingRejectingExecutor();
1291          try {
# Line 3238 | Line 3236 | public class CompletableFutureTest exten
3236      /**
3237       * Completion methods throw NullPointerException with null arguments
3238       */
3239 +    @SuppressWarnings("FutureReturnValueIgnored")
3240      public void testNPE() {
3241          CompletableFuture<Integer> f = new CompletableFuture<>();
3242          CompletableFuture<Integer> g = new CompletableFuture<>();
# Line 4299 | Line 4298 | public class CompletableFutureTest exten
4298      }
4299  
4300      /** Test long recursive chains of CompletableFutures with cascading completions */
4301 +    @SuppressWarnings("FutureReturnValueIgnored")
4302      public void testRecursiveChains() throws Throwable {
4303          for (ExecutionMode m : ExecutionMode.values())
4304          for (boolean addDeadEnds : new boolean[] { true, false })
# Line 4323 | Line 4323 | public class CompletableFutureTest exten
4323       * A single CompletableFuture with many dependents.
4324       * A demo of scalability - runtime is O(n).
4325       */
4326 +    @SuppressWarnings("FutureReturnValueIgnored")
4327      public void testManyDependents() throws Throwable {
4328          final int n = expensiveTests ? 1_000_000 : 10;
4329          final CompletableFuture<Void> head = new CompletableFuture<>();
# Line 4352 | Line 4353 | public class CompletableFutureTest exten
4353      }
4354  
4355      /** ant -Dvmoptions=-Xmx8m -Djsr166.expensiveTests=true -Djsr166.tckTestClass=CompletableFutureTest tck */
4356 +    @SuppressWarnings("FutureReturnValueIgnored")
4357      public void testCoCompletionGarbageRetention() throws Throwable {
4358          final int n = expensiveTests ? 1_000_000 : 10;
4359          final CompletableFuture<Integer> incomplete = new CompletableFuture<>();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines