213 |
|
new ArrayBlockingQueue<Runnable>(10)); |
214 |
|
|
215 |
|
Callable c = new Callable() { |
216 |
< |
public Object call() { return 5/0; }}; |
216 |
> |
public Object call() { throw new ArithmeticException(); }}; |
217 |
|
|
218 |
|
try { |
219 |
|
p.submit(c).get(); |
257 |
|
*/ |
258 |
|
public void testInvokeAny3() throws Exception { |
259 |
|
ExecutorService e = new DirectExecutorService(); |
260 |
< |
List<Callable<Integer>> l = new ArrayList<Callable<Integer>>(); |
261 |
< |
l.add(new Callable<Integer>() { |
262 |
< |
public Integer call() { return 5/0; }}); |
260 |
> |
List<Callable<Long>> l = new ArrayList<Callable<Long>>(); |
261 |
> |
l.add(new Callable<Long>() { |
262 |
> |
public Long call() { throw new ArithmeticException(); }}); |
263 |
|
l.add(null); |
264 |
|
try { |
265 |
|
e.invokeAny(l); |
435 |
|
*/ |
436 |
|
public void testTimedInvokeAny3() throws Exception { |
437 |
|
ExecutorService e = new DirectExecutorService(); |
438 |
< |
List<Callable<Integer>> l = new ArrayList<Callable<Integer>>(); |
439 |
< |
l.add(new Callable<Integer>() { |
440 |
< |
public Integer call() { return 5/0; }}); |
438 |
> |
List<Callable<Long>> l = new ArrayList<Callable<Long>>(); |
439 |
> |
l.add(new Callable<Long>() { |
440 |
> |
public Long call() { throw new ArithmeticException(); }}); |
441 |
|
l.add(null); |
442 |
|
try { |
443 |
|
e.invokeAny(l, MEDIUM_DELAY_MS, MILLISECONDS); |