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()); |
3234 |
|
/** |
3235 |
|
* Completion methods throw NullPointerException with null arguments |
3236 |
|
*/ |
3237 |
+ |
@SuppressWarnings("FutureReturnValueIgnored") |
3238 |
|
public void testNPE() { |
3239 |
|
CompletableFuture<Integer> f = new CompletableFuture<>(); |
3240 |
|
CompletableFuture<Integer> g = new CompletableFuture<>(); |