public class ReentrantLockTest 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 |
---|
ReentrantLockTest() |
Modifier and Type | Method and Description |
---|---|
void |
testAwait_fair() |
void |
testAwait_IMSE_fair() |
void |
testAwait_IMSE()
Calling await without holding lock throws IllegalMonitorStateException
|
void |
testAwait_IMSE(boolean fair) |
void |
testAwait_Timeout_fair() |
void |
testAwait_Timeout()
timed await without a signal times out
|
void |
testAwait_Timeout(boolean fair) |
void |
testAwait()
await returns when signalled
|
void |
testAwait(boolean fair) |
void |
testAwaitLockCount_fair() |
void |
testAwaitLockCount()
await after multiple reentrant locking preserves lock count
|
void |
testAwaitLockCount(boolean fair) |
void |
testAwaitNanos_Timeout_fair() |
void |
testAwaitNanos_Timeout()
awaitNanos without a signal times out
|
void |
testAwaitNanos_Timeout(boolean fair) |
void |
testAwaitUninterruptibly_fair() |
void |
testAwaitUninterruptibly()
awaitUninterruptibly is uninterruptible
|
void |
testAwaitUninterruptibly(boolean fair) |
void |
testAwaitUntil_Timeout_fair() |
void |
testAwaitUntil_Timeout()
awaitUntil without a signal times out
|
void |
testAwaitUntil_Timeout(boolean fair) |
void |
testConstructor()
Constructor sets given fairness, and is in unlocked state
|
void |
testGetHoldCount_fair() |
void |
testGetHoldCount()
getHoldCount returns number of recursive holds
|
void |
testGetHoldCount(boolean fair) |
void |
testGetQueuedThreads_fair() |
void |
testGetQueuedThreads()
getQueuedThreads includes waiting threads
|
void |
testGetQueuedThreads(boolean fair) |
void |
testGetQueueLength_fair() |
void |
testGetQueueLength()
getQueueLength reports number of waiting threads
|
void |
testGetQueueLength(boolean fair) |
void |
testGetWaitingThreads_fair() |
void |
testGetWaitingThreads()
getWaitingThreads returns only and all waiting threads
|
void |
testGetWaitingThreads(boolean fair) |
void |
testGetWaitingThreadsIAE_fair() |
void |
testGetWaitingThreadsIAE()
getWaitingThreads throws IllegalArgumentException if not owned
|
void |
testGetWaitingThreadsIAE(boolean fair) |
void |
testGetWaitingThreadsIMSE_fair() |
void |
testGetWaitingThreadsIMSE()
getWaitingThreads throws IllegalMonitorStateException if not locked
|
void |
testGetWaitingThreadsIMSE(boolean fair) |
void |
testGetWaitingThreadsNPE_fair() |
void |
testGetWaitingThreadsNPE()
getWaitingThreads throws NPE if null
|
void |
testGetWaitingThreadsNPE(boolean fair) |
void |
testGetWaitQueueLength_fair() |
void |
testGetWaitQueueLength()
getWaitQueueLength returns number of waiting threads
|
void |
testGetWaitQueueLength(boolean fair) |
void |
testGetWaitQueueLengthIAE_fair() |
void |
testGetWaitQueueLengthIAE()
getWaitQueueLength throws IllegalArgumentException if not owned
|
void |
testGetWaitQueueLengthIAE(boolean fair) |
void |
testGetWaitQueueLengthIMSE_fair() |
void |
testGetWaitQueueLengthIMSE()
getWaitQueueLength throws IllegalMonitorStateException if not locked
|
void |
testGetWaitQueueLengthIMSE(boolean fair) |
void |
testGetWaitQueueLengthNPE_fair() |
void |
testGetWaitQueueLengthNPE()
getWaitQueueLength throws NPE if null
|
void |
testGetWaitQueueLengthNPE(boolean fair) |
void |
testHasQueuedThread_fair() |
void |
testHasQueuedThread()
hasQueuedThread reports whether a thread is queued
|
void |
testHasQueuedThread(boolean fair) |
void |
testHasQueuedThreadNPE_fair() |
void |
testHasQueuedThreadNPE()
hasQueuedThread(null) throws NPE
|
void |
testHasQueuedThreadNPE(boolean fair) |
void |
testHasQueuedThreads_fair() |
void |
testHasQueuedThreads()
hasQueuedThreads reports whether there are waiting threads
|
void |
testHasQueuedThreads(boolean fair) |
void |
testHasWaiters_fair() |
void |
testHasWaiters()
hasWaiters returns true when a thread is waiting, else false
|
void |
testHasWaiters(boolean fair) |
void |
testHasWaitersIAE_fair() |
void |
testHasWaitersIAE()
hasWaiters throws IllegalArgumentException if not owned
|
void |
testHasWaitersIAE(boolean fair) |
void |
testHasWaitersIMSE_fair() |
void |
testHasWaitersIMSE()
hasWaiters throws IllegalMonitorStateException if not locked
|
void |
testHasWaitersIMSE(boolean fair) |
void |
testHasWaitersNPE_fair() |
void |
testHasWaitersNPE()
hasWaiters throws NPE if null
|
void |
testHasWaitersNPE(boolean fair) |
void |
testInterruptible_await_fair() |
void |
testInterruptible_await()
await/awaitNanos/awaitUntil is interruptible
|
void |
testInterruptible_awaitNanos_fair() |
void |
testInterruptible_awaitNanos() |
void |
testInterruptible_awaitTimed_fair() |
void |
testInterruptible_awaitTimed() |
void |
testInterruptible_awaitUntil_fair() |
void |
testInterruptible_awaitUntil() |
void |
testInterruptible(boolean fair,
jsr166.ReentrantLockTest.AwaitMethod awaitMethod) |
void |
testIsLocked_fair() |
void |
testIsLocked()
isLocked is true when locked and false when not
|
void |
testIsLocked(boolean fair) |
void |
testLock_fair() |
void |
testLock()
locking an unlocked lock succeeds
|
void |
testLock(boolean fair) |
void |
testLockInterruptibly_fair() |
void |
testLockInterruptibly()
lockInterruptibly succeeds when unlocked, else is interruptible
|
void |
testLockInterruptibly(boolean fair) |
void |
testSerialization_fair() |
void |
testSerialization()
A serialized lock deserializes as unlocked
|
void |
testSerialization(boolean fair) |
void |
testSignal_IMSE_fair() |
void |
testSignal_IMSE()
Calling signal without holding lock throws IllegalMonitorStateException
|
void |
testSignal_IMSE(boolean fair) |
void |
testSignalAll_await_fair() |
void |
testSignalAll_await()
signalAll wakes up all threads
|
void |
testSignalAll_awaitNanos_fair() |
void |
testSignalAll_awaitNanos() |
void |
testSignalAll_awaitTimed_fair() |
void |
testSignalAll_awaitTimed() |
void |
testSignalAll_awaitUntil_fair() |
void |
testSignalAll_awaitUntil() |
void |
testSignalAll(boolean fair,
jsr166.ReentrantLockTest.AwaitMethod awaitMethod) |
void |
testSignalWakesFifo_fair() |
void |
testSignalWakesFifo()
signal wakes up waiting threads in FIFO order
|
void |
testSignalWakesFifo(boolean fair) |
void |
testToString_fair() |
void |
testToString()
toString indicates current lock state
|
void |
testToString(boolean fair) |
void |
testTryLock_fair() |
void |
testTryLock_Interruptible_fair() |
void |
testTryLock_Interruptible()
timed tryLock is interruptible
|
void |
testTryLock_Interruptible(boolean fair) |
void |
testTryLock_Timeout_fair() |
void |
testTryLock_Timeout()
Timed tryLock on a locked lock times out
|
void |
testTryLock_Timeout(boolean fair) |
void |
testTryLock()
tryLock on an unlocked lock succeeds
|
void |
testTryLock(boolean fair) |
void |
testTryLockWhenLocked_fair() |
void |
testTryLockWhenLocked()
tryLock on a locked lock fails
|
void |
testTryLockWhenLocked(boolean fair) |
void |
testUnlock_IMSE_fair() |
void |
testUnlock_IMSE()
Unlocking an unlocked lock throws IllegalMonitorStateException
|
void |
testUnlock_IMSE(boolean fair) |
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 testLock()
public void testLock_fair()
public void testLock(boolean fair)
public void testUnlock_IMSE()
public void testUnlock_IMSE_fair()
public void testUnlock_IMSE(boolean fair)
public void testTryLock()
public void testTryLock_fair()
public void testTryLock(boolean fair)
public void testHasQueuedThreads()
public void testHasQueuedThreads_fair()
public void testHasQueuedThreads(boolean fair)
public void testGetQueueLength()
public void testGetQueueLength_fair()
public void testGetQueueLength(boolean fair)
public void testHasQueuedThreadNPE()
public void testHasQueuedThreadNPE_fair()
public void testHasQueuedThreadNPE(boolean fair)
public void testHasQueuedThread()
public void testHasQueuedThread_fair()
public void testHasQueuedThread(boolean fair)
public void testGetQueuedThreads()
public void testGetQueuedThreads_fair()
public void testGetQueuedThreads(boolean fair)
public void testTryLock_Interruptible()
public void testTryLock_Interruptible_fair()
public void testTryLock_Interruptible(boolean fair)
public void testTryLockWhenLocked()
public void testTryLockWhenLocked_fair()
public void testTryLockWhenLocked(boolean fair)
public void testTryLock_Timeout()
public void testTryLock_Timeout_fair()
public void testTryLock_Timeout(boolean fair)
public void testGetHoldCount()
public void testGetHoldCount_fair()
public void testGetHoldCount(boolean fair)
public void testIsLocked()
public void testIsLocked_fair()
public void testIsLocked(boolean fair)
public void testLockInterruptibly()
public void testLockInterruptibly_fair()
public void testLockInterruptibly(boolean fair)
public void testAwait_IMSE()
public void testAwait_IMSE_fair()
public void testAwait_IMSE(boolean fair)
public void testSignal_IMSE()
public void testSignal_IMSE_fair()
public void testSignal_IMSE(boolean fair)
public void testAwaitNanos_Timeout()
public void testAwaitNanos_Timeout_fair()
public void testAwaitNanos_Timeout(boolean fair)
public void testAwait_Timeout()
public void testAwait_Timeout_fair()
public void testAwait_Timeout(boolean fair)
public void testAwaitUntil_Timeout()
public void testAwaitUntil_Timeout_fair()
public void testAwaitUntil_Timeout(boolean fair)
public void testAwait()
public void testAwait_fair()
public void testAwait(boolean fair)
public void testHasWaitersNPE()
public void testHasWaitersNPE_fair()
public void testHasWaitersNPE(boolean fair)
public void testGetWaitQueueLengthNPE()
public void testGetWaitQueueLengthNPE_fair()
public void testGetWaitQueueLengthNPE(boolean fair)
public void testGetWaitingThreadsNPE()
public void testGetWaitingThreadsNPE_fair()
public void testGetWaitingThreadsNPE(boolean fair)
public void testHasWaitersIAE()
public void testHasWaitersIAE_fair()
public void testHasWaitersIAE(boolean fair)
public void testHasWaitersIMSE()
public void testHasWaitersIMSE_fair()
public void testHasWaitersIMSE(boolean fair)
public void testGetWaitQueueLengthIAE()
public void testGetWaitQueueLengthIAE_fair()
public void testGetWaitQueueLengthIAE(boolean fair)
public void testGetWaitQueueLengthIMSE()
public void testGetWaitQueueLengthIMSE_fair()
public void testGetWaitQueueLengthIMSE(boolean fair)
public void testGetWaitingThreadsIAE()
public void testGetWaitingThreadsIAE_fair()
public void testGetWaitingThreadsIAE(boolean fair)
public void testGetWaitingThreadsIMSE()
public void testGetWaitingThreadsIMSE_fair()
public void testGetWaitingThreadsIMSE(boolean fair)
public void testHasWaiters()
public void testHasWaiters_fair()
public void testHasWaiters(boolean fair)
public void testGetWaitQueueLength()
public void testGetWaitQueueLength_fair()
public void testGetWaitQueueLength(boolean fair)
public void testGetWaitingThreads()
public void testGetWaitingThreads_fair()
public void testGetWaitingThreads(boolean fair)
public void testAwaitUninterruptibly()
public void testAwaitUninterruptibly_fair()
public void testAwaitUninterruptibly(boolean fair)
public void testInterruptible_await()
public void testInterruptible_await_fair()
public void testInterruptible_awaitTimed()
public void testInterruptible_awaitTimed_fair()
public void testInterruptible_awaitNanos()
public void testInterruptible_awaitNanos_fair()
public void testInterruptible_awaitUntil()
public void testInterruptible_awaitUntil_fair()
public void testInterruptible(boolean fair, jsr166.ReentrantLockTest.AwaitMethod awaitMethod)
public void testSignalAll_await()
public void testSignalAll_await_fair()
public void testSignalAll_awaitTimed()
public void testSignalAll_awaitTimed_fair()
public void testSignalAll_awaitNanos()
public void testSignalAll_awaitNanos_fair()
public void testSignalAll_awaitUntil()
public void testSignalAll_awaitUntil_fair()
public void testSignalAll(boolean fair, jsr166.ReentrantLockTest.AwaitMethod awaitMethod)
public void testSignalWakesFifo()
public void testSignalWakesFifo_fair()
public void testSignalWakesFifo(boolean fair)
public void testAwaitLockCount()
public void testAwaitLockCount_fair()
public void testAwaitLockCount(boolean fair)
public void testSerialization()
public void testSerialization_fair()
public void testSerialization(boolean fair)
public void testToString()
public void testToString_fair()
public void testToString(boolean fair)