17 |
|
import java.util.concurrent.SynchronousQueue; |
18 |
|
import java.util.concurrent.ThreadLocalRandom; |
19 |
|
import java.util.concurrent.TimeoutException; |
20 |
– |
import java.util.concurrent.TimeUnit; |
20 |
|
|
21 |
|
import junit.framework.Test; |
22 |
|
import junit.framework.TestSuite; |
504 |
|
FibAction f = new FibAction(8); |
505 |
|
assertSame(f, f.fork()); |
506 |
|
helpQuiesce(); |
507 |
+ |
while (!f.isDone()) // wait out race |
508 |
+ |
; |
509 |
|
assertEquals(21, f.result); |
510 |
|
assertEquals(0, getQueuedTaskCount()); |
511 |
|
checkCompletedNormally(f); |
591 |
|
FailingFibAction f = new FailingFibAction(8); |
592 |
|
assertSame(f, f.fork()); |
593 |
|
try { |
594 |
< |
f.get(5L, TimeUnit.SECONDS); |
594 |
> |
f.get(5L, SECONDS); |
595 |
|
shouldThrow(); |
596 |
|
} catch (ExecutionException success) { |
597 |
|
Throwable cause = success.getCause(); |