public class FutureTaskTest extends JSR166TestCase
JSR166TestCase.AdjustablePolicy, JSR166TestCase.CallableOne, JSR166TestCase.CheckedBarrier, JSR166TestCase.CheckedCallable<T>, JSR166TestCase.CheckedInterruptedCallable<T>, JSR166TestCase.CheckedInterruptedRunnable, JSR166TestCase.CheckedRecursiveAction, JSR166TestCase.CheckedRecursiveTask<T>, JSR166TestCase.CheckedRunnable, JSR166TestCase.LongPossiblyInterruptedRunnable, JSR166TestCase.MediumInterruptedRunnable, JSR166TestCase.MediumPossiblyInterruptedRunnable, JSR166TestCase.MediumRunnable, JSR166TestCase.NoOpCallable, JSR166TestCase.NoOpREHandler, JSR166TestCase.NoOpRunnable, JSR166TestCase.NPETask, JSR166TestCase.RunnableShouldThrow, JSR166TestCase.ShortInterruptedRunnable, JSR166TestCase.ShortRunnable, JSR166TestCase.SimpleThreadFactory, JSR166TestCase.SmallCallable, JSR166TestCase.SmallPossiblyInterruptedRunnable, JSR166TestCase.SmallRunnable, JSR166TestCase.StringTask, JSR166TestCase.ThreadShouldThrow, JSR166TestCase.TrackedCallable, JSR166TestCase.TrackedLongRunnable, JSR166TestCase.TrackedMediumRunnable, JSR166TestCase.TrackedNoOpRunnable, JSR166TestCase.TrackedRunnable, JSR166TestCase.TrackedShortRunnable, JSR166TestCase.TrackedSmallRunnable
eight, expensiveTests, five, four, JAVA_CLASS_VERSION, JAVA_SPECIFICATION_VERSION, LONG_DELAY_MS, m1, m10, m2, m3, m4, m5, m6, MEDIUM_DELAY_MS, nine, one, seven, SHORT_DELAY_MS, six, SIZE, SMALL_DELAY_MS, TEST_STRING, testImplementationDetails, three, two, zero
Constructor and Description |
---|
FutureTaskTest() |
Modifier and Type | Method and Description |
---|---|
void |
testCancelAfterRun()
cancel(false) of a completed task fails
|
void |
testCancelAfterRun2()
cancel(true) of a completed task fails
|
void |
testCancelBeforeRun()
cancel(false) before run succeeds
|
void |
testCancelBeforeRun2()
cancel(true) before run succeeds
|
void |
testCancelInterrupt_taskFails()
cancel(true) interrupts a running task that subsequently throws
|
void |
testCancelInterrupt_ThrowsSecurityException()
cancel(true) tries to interrupt a running task, but
Thread.interrupt throws (simulating a restrictive security
manager)
|
void |
testCancelInterrupt()
cancel(true) interrupts a running task that subsequently succeeds
|
void |
testCancelNoInterrupt()
cancel(false) does not interrupt a running task
|
void |
testConstructor()
creating a future with a null callable throws NullPointerException
|
void |
testConstructor2()
creating a future with null runnable throws NullPointerException
|
void |
testGet_ExecutionException()
A runtime exception in task causes get to throw ExecutionException
|
void |
testGet_interruptible()
get is interruptible
|
void |
testGet_NegativeInfinityTimeout()
timed get with most negative timeout works correctly (i.e. no
underflow bug)
|
void |
testGet_NullTimeUnit()
timed get with null TimeUnit throws NullPointerException
|
void |
testGet_TimeoutException()
A timed out timed get throws TimeoutException
|
void |
testGetRun()
run in one thread causes get in another thread to retrieve value
|
void |
testGetSet()
set in one thread causes get in another thread to retrieve value
|
void |
testIsDone()
isDone is true when a task completes
|
void |
testRunAndReset()
runAndReset of a non-cancelled task succeeds
|
void |
testRunAndResetAfterCancel()
runAndReset after cancellation fails
|
void |
testSet()
setting value causes get to return it
|
void |
testSetException_get()
setException causes get to throw ExecutionException
|
void |
testTimedGet_Cancellation_interrupt() |
void |
testTimedGet_Cancellation()
Cancelling a task causes timed get in another thread to throw
CancellationException
|
void |
testTimedGet_Cancellation(boolean mayInterruptIfRunning) |
void |
testTimedGet_ExecutionException2()
A runtime exception in task causes timed get to throw ExecutionException
|
void |
testTimedGet_interruptible()
timed get is interruptible
|
addNamedTestClasses, assertIteratorExhausted, assertThrows, atLeastJava10, atLeastJava6, atLeastJava7, atLeastJava8, atLeastJava9, await, await, await, awaiter, countDowner, getShortDelay, jdk8ParameterizedTestSuite, latchAwaitingStringTask, newTestSuite, parameterizedTestSuite, permissivePolicy, possiblyInterruptedRunnable, runBare, runTest, runTestProfiled, runWithoutPermissions, runWithPermissions, runWithSecurityManagerWithPermissions, setDelays, setUp, shouldThrow, shouldThrow, tearDown, testMethodNames, threadAssertEquals, threadAssertEquals, threadAssertFalse, threadAssertNull, threadAssertSame, threadAssertTrue, threadFail, threadRecordFailure, threadShouldThrow, threadShouldThrow, threadUnexpectedException, trackedRunnable
public void testConstructor()
public void testConstructor2()
public void testIsDone()
public void testRunAndReset()
public void testRunAndResetAfterCancel()
public void testSet() throws Exception
Exception
public void testSetException_get() throws Exception
Exception
public void testCancelBeforeRun()
public void testCancelBeforeRun2()
public void testCancelAfterRun()
public void testCancelAfterRun2()
public void testCancelInterrupt()
public void testCancelInterrupt_ThrowsSecurityException()
public void testCancelInterrupt_taskFails()
public void testCancelNoInterrupt()
public void testGetRun()
public void testGetSet()
public void testTimedGet_Cancellation()
public void testTimedGet_Cancellation_interrupt()
public void testTimedGet_Cancellation(boolean mayInterruptIfRunning)
public void testGet_ExecutionException() throws InterruptedException
InterruptedException
public void testTimedGet_ExecutionException2() throws Exception
Exception
public void testGet_interruptible()
public void testTimedGet_interruptible()
public void testGet_TimeoutException() throws Exception
Exception
public void testGet_NullTimeUnit() throws Exception
Exception