374 |
|
TrackedRunnable task = trackedRunnable(SHORT_DELAY_MS); |
375 |
|
assertFalse(task.isDone()); |
376 |
|
Future<?> future = e.submit(task); |
377 |
< |
future.get(); |
377 |
> |
assertNull(future.get()); |
378 |
|
assertTrue(task.isDone()); |
379 |
+ |
assertFalse(future.isCancelled()); |
380 |
|
} finally { |
381 |
|
joinPool(e); |
382 |
|
} |
390 |
|
ExecutorService e = new ForkJoinPool(1); |
391 |
|
try { |
392 |
|
Future<String> future = e.submit(new StringTask()); |
393 |
< |
String result = future.get(); |
394 |
< |
assertSame(TEST_STRING, result); |
393 |
> |
assertSame(TEST_STRING, future.get()); |
394 |
> |
assertTrue(future.isDone()); |
395 |
> |
assertFalse(future.isCancelled()); |
396 |
|
} finally { |
397 |
|
joinPool(e); |
398 |
|
} |
405 |
|
ExecutorService e = new ForkJoinPool(1); |
406 |
|
try { |
407 |
|
Future<?> future = e.submit(new NoOpRunnable()); |
408 |
< |
future.get(); |
408 |
> |
assertNull(future.get()); |
409 |
|
assertTrue(future.isDone()); |
410 |
+ |
assertFalse(future.isCancelled()); |
411 |
|
} finally { |
412 |
|
joinPool(e); |
413 |
|
} |
420 |
|
ExecutorService e = new ForkJoinPool(1); |
421 |
|
try { |
422 |
|
Future<String> future = e.submit(new NoOpRunnable(), TEST_STRING); |
423 |
< |
String result = future.get(); |
424 |
< |
assertSame(TEST_STRING, result); |
423 |
> |
assertSame(TEST_STRING, future.get()); |
424 |
> |
assertTrue(future.isDone()); |
425 |
> |
assertFalse(future.isCancelled()); |
426 |
|
} finally { |
427 |
|
joinPool(e); |
428 |
|
} |
430 |
|
|
431 |
|
|
432 |
|
/** |
433 |
< |
* A submitted privileged action to completion |
433 |
> |
* A submitted privileged action runs to completion |
434 |
|
*/ |
435 |
|
public void testSubmitPrivilegedAction() throws Throwable { |
436 |
|
Policy savedPolicy = null; |
463 |
|
} |
464 |
|
|
465 |
|
/** |
466 |
< |
* A submitted a privileged exception action runs to completion |
466 |
> |
* A submitted privileged exception action runs to completion |
467 |
|
*/ |
468 |
|
public void testSubmitPrivilegedExceptionAction() throws Throwable { |
469 |
|
Policy savedPolicy = null; |