()
| 87 | } |
| 88 | |
| 89 | private static void getExecutionExceptionTest() throws InterruptedException, ExecutionException { |
| 90 | FutureTask<Object> future = new FutureTask<Object>(new Runnable() { |
| 91 | @Override |
| 92 | public void run() { |
| 93 | throw new RuntimeException(); |
| 94 | } |
| 95 | }, null); |
| 96 | |
| 97 | future.run(); |
| 98 | try { |
| 99 | future.get(); |
| 100 | throw new RuntimeException("Exception should have thrown"); |
| 101 | } catch (ExecutionException e) { |
| 102 | // expected |
| 103 | } |
| 104 | } |
| 105 | } |