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) {} |
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()); |
1238 |
|
r.assertInvoked(); |
1239 |
|
}} |
1240 |
|
|
1241 |
+ |
@SuppressWarnings("FutureReturnValueIgnored") |
1242 |
|
public void testRunAsync_rejectingExecutor() { |
1243 |
|
CountingRejectingExecutor e = new CountingRejectingExecutor(); |
1244 |
|
try { |
1285 |
|
r.assertInvoked(); |
1286 |
|
}} |
1287 |
|
|
1288 |
+ |
@SuppressWarnings("FutureReturnValueIgnored") |
1289 |
|
public void testSupplyAsync_rejectingExecutor() { |
1290 |
|
CountingRejectingExecutor e = new CountingRejectingExecutor(); |
1291 |
|
try { |
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<>(); |
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 }) |
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<>(); |
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<>(); |