public class AbstractQueuedSynchronizerTest 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 |
---|
AbstractQueuedSynchronizerTest() |
Modifier and Type | Method and Description |
---|---|
void |
testAcquire()
acquiring released sync succeeds
|
void |
testAcquireInterruptibly()
acquireInterruptibly succeeds when released, else is interruptible
|
void |
testAcquireNanos_Timeout()
tryAcquireNanos on an exclusively held sync times out
|
void |
testAcquireSharedInterruptibly_Interruptible()
acquireSharedInterruptibly is interruptible
|
void |
testAcquireSharedInterruptibly()
acquireSharedInterruptibly returns after release, but not before
|
void |
testAwait_IMSE()
Calling await without holding sync throws IllegalMonitorStateException
|
void |
testAwait_NegativeInfinity()
awaitNanos/timed await with maximum negative wait times does not underflow
|
void |
testAwait_Timeout(jsr166.AbstractQueuedSynchronizerTest.AwaitMethod awaitMethod) |
void |
testAwait_Zero()
awaitNanos/timed await with 0 wait times out immediately
|
void |
testAwaitNanos_Timeout() |
void |
testAwaitTimed_Timeout()
await/awaitNanos/awaitUntil without a signal times out
|
void |
testAwaitUninterruptibly()
awaitUninterruptibly is uninterruptible
|
void |
testAwaitUntil_Timeout() |
void |
testGetExclusiveQueuedThreads()
getExclusiveQueuedThreads returns all exclusive waiting threads
|
void |
testGetFirstQueuedThread()
getFirstQueuedThread returns first waiting thread or null if none
|
void |
testGetQueuedThreads()
getQueuedThreads returns all waiting threads
|
void |
testGetSharedQueuedThreads_Exclusive()
getSharedQueuedThreads does not include exclusively waiting threads
|
void |
testGetSharedQueuedThreads_Shared()
getSharedQueuedThreads returns all shared waiting threads
|
void |
testGetState()
getState is true when acquired and false when not
|
void |
testGetStateWithReleaseShared()
tryReleaseShared setting state changes getState
|
void |
testGetWaitingThreads()
getWaitingThreads returns only and all waiting threads
|
void |
testGetWaitingThreadsIAE()
getWaitingThreads throws IllegalArgumentException if not owned
|
void |
testGetWaitingThreadsIMSE()
getWaitingThreads throws IllegalMonitorStateException if not synced
|
void |
testGetWaitingThreadsNPE()
getWaitingThreads(null) throws NullPointerException
|
void |
testGetWaitQueueLength()
getWaitQueueLength returns number of waiting threads
|
void |
testGetWaitQueueLengthIAE()
getWaitQueueLength throws IllegalArgumentException if not owned
|
void |
testGetWaitQueueLengthIMSE()
getWaitQueueLength throws IllegalMonitorStateException if not synced
|
void |
testGetWaitQueueLengthNPE()
getWaitQueueLength(null) throws NullPointerException
|
void |
testHasContended()
hasContended reports false if no thread has ever blocked, else true
|
void |
testHasQueuedThreads()
hasQueuedThreads reports whether there are waiting threads
|
void |
testHasWaiters()
hasWaiters returns true when a thread is waiting, else false
|
void |
testHasWaitersIAE()
hasWaiters throws IllegalArgumentException if not owned
|
void |
testHasWaitersIMSE()
hasWaiters throws IllegalMonitorStateException if not synced
|
void |
testHasWaitersNPE()
hasWaiters(null) throws NullPointerException
|
void |
testInterruptible_await()
await/awaitNanos/awaitUntil is interruptible
|
void |
testInterruptible_awaitNanos() |
void |
testInterruptible_awaitTimed() |
void |
testInterruptible_awaitUntil() |
void |
testInterruptible(jsr166.AbstractQueuedSynchronizerTest.AwaitMethod awaitMethod) |
void |
testIsHeldExclusively()
isHeldExclusively is false upon construction
|
void |
testIsQueued()
isQueued reports whether a thread is queued
|
void |
testIsQueuedNPE()
isQueued(null) throws NullPointerException
|
void |
testOwns()
owns is true for a condition created by sync else false
|
void |
testReleaseShared()
releaseShared has no effect when already signalled
|
void |
testSerialization()
A serialized AQS deserializes with current state, but no queued threads
|
void |
testSignal_await()
await/awaitNanos/awaitUntil returns when signalled
|
void |
testSignal_awaitNanos() |
void |
testSignal_awaitTimed() |
void |
testSignal_awaitUntil() |
void |
testSignal_IMSE()
Calling signal without holding sync throws IllegalMonitorStateException
|
void |
testSignal(jsr166.AbstractQueuedSynchronizerTest.AwaitMethod awaitMethod) |
void |
testSignalAll_await()
signalAll wakes up all threads
|
void |
testSignalAll_awaitNanos() |
void |
testSignalAll_awaitTimed() |
void |
testSignalAll_awaitUntil() |
void |
testSignalAll_IMSE()
Calling signalAll without holding sync throws IllegalMonitorStateException
|
void |
testSignalAll(jsr166.AbstractQueuedSynchronizerTest.AwaitMethod awaitMethod) |
void |
testToString()
toString indicates current state
|
void |
testTryAcquire()
tryAcquire on a released sync succeeds
|
void |
testTryAcquireNanos_Interruptible()
tryAcquireNanos is interruptible
|
void |
testTryAcquireSharedNanos_Interruptible()
tryAcquireSharedNanos is interruptible
|
void |
testTryAcquireSharedNanos_Timeout()
tryAcquireSharedNanos times out if not released before timeout
|
void |
testTryAcquireSharedNanos()
tryAcquireSharedNanos returns after release, but not before
|
void |
testTryAcquireWhenSynced()
tryAcquire on exclusively held sync fails
|
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 testIsHeldExclusively()
public void testAcquire()
public void testTryAcquire()
public void testHasQueuedThreads()
public void testIsQueuedNPE()
public void testIsQueued()
public void testGetFirstQueuedThread()
public void testHasContended()
public void testGetQueuedThreads()
public void testGetExclusiveQueuedThreads()
public void testGetSharedQueuedThreads_Exclusive()
public void testGetSharedQueuedThreads_Shared()
public void testTryAcquireNanos_Interruptible()
public void testTryAcquireWhenSynced()
public void testAcquireNanos_Timeout()
public void testGetState()
public void testAcquireInterruptibly() throws InterruptedException
InterruptedException
public void testOwns()
public void testAwait_IMSE()
public void testSignal_IMSE()
public void testSignalAll_IMSE()
public void testAwaitTimed_Timeout()
public void testAwaitNanos_Timeout()
public void testAwaitUntil_Timeout()
public void testAwait_Timeout(jsr166.AbstractQueuedSynchronizerTest.AwaitMethod awaitMethod)
public void testSignal_await()
public void testSignal_awaitTimed()
public void testSignal_awaitNanos()
public void testSignal_awaitUntil()
public void testSignal(jsr166.AbstractQueuedSynchronizerTest.AwaitMethod awaitMethod)
public void testHasWaitersNPE()
public void testGetWaitQueueLengthNPE()
public void testGetWaitingThreadsNPE()
public void testHasWaitersIAE()
public void testHasWaitersIMSE()
public void testGetWaitQueueLengthIAE()
public void testGetWaitQueueLengthIMSE()
public void testGetWaitingThreadsIAE()
public void testGetWaitingThreadsIMSE()
public void testHasWaiters()
public void testGetWaitQueueLength()
public void testGetWaitingThreads()
public void testAwaitUninterruptibly()
public void testInterruptible_await()
public void testInterruptible_awaitTimed()
public void testInterruptible_awaitNanos()
public void testInterruptible_awaitUntil()
public void testInterruptible(jsr166.AbstractQueuedSynchronizerTest.AwaitMethod awaitMethod)
public void testSignalAll_await()
public void testSignalAll_awaitTimed()
public void testSignalAll_awaitNanos()
public void testSignalAll_awaitUntil()
public void testSignalAll(jsr166.AbstractQueuedSynchronizerTest.AwaitMethod awaitMethod)
public void testToString()
public void testSerialization()
public void testGetStateWithReleaseShared()
public void testReleaseShared()
public void testAcquireSharedInterruptibly()
public void testTryAcquireSharedNanos()
public void testAcquireSharedInterruptibly_Interruptible()
public void testTryAcquireSharedNanos_Interruptible()
public void testTryAcquireSharedNanos_Timeout()
public void testAwait_Zero() throws InterruptedException
InterruptedException
public void testAwait_NegativeInfinity() throws InterruptedException
InterruptedException