242 |
|
eh, false); |
243 |
|
try { |
244 |
|
assertSame(eh, p.getUncaughtExceptionHandler()); |
245 |
< |
p.execute(new FibTask(8)); |
246 |
< |
assertTrue(uehInvoked.await(MEDIUM_DELAY_MS, MILLISECONDS)); |
245 |
> |
try { |
246 |
> |
p.execute(new FibTask(8)); |
247 |
> |
assertTrue(uehInvoked.await(MEDIUM_DELAY_MS, MILLISECONDS)); |
248 |
> |
} catch (RejectedExecutionException ok) { |
249 |
> |
} |
250 |
|
} finally { |
251 |
|
p.shutdownNow(); // failure might have prevented processing task |
252 |
|
joinPool(p); |
575 |
|
ForkJoinPool p = new ForkJoinPool(1); |
576 |
|
try { |
577 |
|
p.submit(new Callable() { |
578 |
< |
public Object call() { |
579 |
< |
int i = 5/0; |
577 |
< |
return Boolean.TRUE; |
578 |
< |
}}).get(); |
578 |
> |
public Object call() { throw new ArithmeticException(); }}) |
579 |
> |
.get(); |
580 |
|
shouldThrow(); |
581 |
|
} catch (ExecutionException success) { |
582 |
|
assertTrue(success.getCause() instanceof ArithmeticException); |