135 |
|
threadAssertTrue(f.result == 21); |
136 |
|
threadAssertTrue(f.isDone()); |
137 |
|
} catch (Exception ex) { |
138 |
< |
unexpectedException(); |
138 |
> |
unexpectedException(ex); |
139 |
|
} |
140 |
|
} |
141 |
|
}; |
155 |
|
threadAssertTrue(f.result == 21); |
156 |
|
threadAssertTrue(f.isDone()); |
157 |
|
} catch (Exception ex) { |
158 |
< |
unexpectedException(); |
158 |
> |
unexpectedException(ex); |
159 |
|
} |
160 |
|
} |
161 |
|
}; |
172 |
|
FibAction f = new FibAction(8); |
173 |
|
f.fork(); |
174 |
|
f.get(5L, null); |
175 |
+ |
shouldThrow(); |
176 |
|
} catch (NullPointerException success) { |
177 |
|
} catch (Exception ex) { |
178 |
< |
unexpectedException(); |
178 |
> |
unexpectedException(ex); |
179 |
|
} |
180 |
|
} |
181 |
|
}; |
269 |
|
} |
270 |
|
|
271 |
|
/** |
272 |
< |
* quietelyInvoke task returns when task completes abnormally |
272 |
> |
* quietlyInvoke task returns when task completes abnormally |
273 |
|
*/ |
274 |
|
public void testAbnormalQuietlyInvoke() { |
275 |
|
RecursiveAction a = new RecursiveAction() { |
311 |
|
f.fork(); |
312 |
|
f.get(); |
313 |
|
shouldThrow(); |
314 |
< |
} catch (Exception success) { |
314 |
> |
} catch (ExecutionException success) { |
315 |
> |
} catch (Exception ex) { |
316 |
> |
unexpectedException(ex); |
317 |
|
} |
318 |
|
} |
319 |
|
}; |
331 |
|
f.fork(); |
332 |
|
f.get(5L, TimeUnit.SECONDS); |
333 |
|
shouldThrow(); |
334 |
< |
} catch (Exception success) { |
334 |
> |
} catch (ExecutionException success) { |
335 |
> |
} catch (Exception ex) { |
336 |
> |
unexpectedException(ex); |
337 |
|
} |
338 |
|
} |
339 |
|
}; |
445 |
|
f.fork(); |
446 |
|
f.get(); |
447 |
|
shouldThrow(); |
448 |
< |
} catch (Exception success) { |
448 |
> |
} catch (CancellationException success) { |
449 |
> |
} catch (Exception ex) { |
450 |
> |
unexpectedException(ex); |
451 |
|
} |
452 |
|
} |
453 |
|
}; |
466 |
|
f.fork(); |
467 |
|
f.get(5L, TimeUnit.SECONDS); |
468 |
|
shouldThrow(); |
469 |
< |
} catch (Exception success) { |
469 |
> |
} catch (CancellationException success) { |
470 |
> |
} catch (Exception ex) { |
471 |
> |
unexpectedException(ex); |
472 |
|
} |
473 |
|
} |
474 |
|
}; |
834 |
|
} |
835 |
|
|
836 |
|
/** |
837 |
< |
* invokeAll(collection) throws exception if any task does |
837 |
> |
* invokeAll(collection) throws exception if any task does |
838 |
|
*/ |
839 |
|
public void testAbnormalInvokeAllCollection() { |
840 |
|
RecursiveAction a = new RecursiveAction() { |