223 |
|
* Future.get on submitted tasks will time out if they compute too long. |
224 |
|
*/ |
225 |
|
public void testTimedCallable() throws Exception { |
226 |
< |
final Runnable sleeper = |
227 |
< |
new RunnableShouldThrow(InterruptedException.class) { |
228 |
< |
public void realRun() throws InterruptedException { |
229 |
< |
Thread.sleep(LONG_DELAY_MS); |
230 |
< |
}}; |
226 |
> |
final Runnable sleeper = new CheckedInterruptedRunnable() { |
227 |
> |
public void realRun() throws InterruptedException { |
228 |
> |
Thread.sleep(LONG_DELAY_MS); |
229 |
> |
}}; |
230 |
|
for (ExecutorService executor : |
231 |
|
new ExecutorService[] { |
232 |
|
Executors.newSingleThreadExecutor(), |
398 |
|
* Without permissions, calling privilegedCallable throws ACE |
399 |
|
*/ |
400 |
|
public void testprivilegedCallableWithNoPrivs() throws Exception { |
401 |
+ |
// Avoid classloader-related SecurityExceptions in swingui.TestRunner |
402 |
+ |
Executors.privilegedCallable(new CheckCCL()); |
403 |
+ |
|
404 |
|
Runnable r = new CheckedRunnable() { |
405 |
|
public void realRun() throws Exception { |
406 |
|
if (System.getSecurityManager() == null) |