|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectjunit.framework.Assert
junit.framework.TestCase
JSR166TestCase
ReentrantLockTest
public class ReentrantLockTest
| Nested Class Summary |
|---|
| Field Summary |
|---|
| Fields inherited from class JSR166TestCase |
|---|
eight, expensiveTests, five, four, 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, three, two, zero |
| Constructor Summary | |
|---|---|
ReentrantLockTest()
|
|
| Method Summary | |
|---|---|
static void |
main(java.lang.String[] args)
|
static junit.framework.Test |
suite()
|
void |
testAwait_IllegalMonitor()
Calling await without holding lock throws IllegalMonitorStateException |
void |
testAwait_Interrupt()
await is interruptible |
void |
testAwait_Timeout()
timed await without a signal times out |
void |
testAwait()
await returns when signalled |
void |
testAwaitLockCount()
await after multiple reentrant locking preserves lock count |
void |
testAwaitNanos_Interrupt()
awaitNanos is interruptible |
void |
testAwaitNanos_Timeout()
awaitNanos without a signal times out |
void |
testAwaitUninterruptibly()
awaitUninterruptibly doesn't abort on interrupt |
void |
testAwaitUntil_Interrupt()
awaitUntil is interruptible |
void |
testAwaitUntil_Timeout()
awaitUntil without a signal times out |
void |
testConstructor()
Constructor sets given fairness, and is in unlocked state |
void |
testFairLock()
locking an unlocked fair lock succeeds |
void |
testGetHoldCount()
getHoldCount returns number of recursive holds |
void |
testGetQueuedThreads()
getQueuedThreads includes waiting threads |
void |
testGetQueueLength_fair()
getQueueLength reports number of waiting threads |
void |
testGetQueueLength()
getQueueLength reports number of waiting threads |
void |
testGetWaitingThreads()
getWaitingThreads returns only and all waiting threads |
void |
testGetWaitingThreadsIAE()
getWaitingThreads throws IllegalArgumentException if not owned |
void |
testGetWaitingThreadsIMSE()
getWaitingThreads throws IllegalMonitorStateException if not locked |
void |
testGetWaitingThreadsNPE()
getWaitingThreads throws NPE if null |
void |
testGetWaitQueueLength()
getWaitQueueLength returns number of waiting threads |
void |
testGetWaitQueueLengthIAE()
getWaitQueueLength throws IllegalArgumentException if not owned |
void |
testGetWaitQueueLengthIMSE()
getWaitQueueLength throws IllegalMonitorStateException if not locked |
void |
testGetWaitQueueLengthNPE()
getWaitQueueLength throws NPE if null |
void |
testHasQueuedThread()
hasQueuedThread reports whether a thread is queued. |
void |
testHasQueuedThreadNPE()
hasQueuedThread(null) throws NPE |
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 locked |
void |
testHasWaitersNPE()
hasWaiters throws NPE if null |
void |
testIsLocked()
isLocked is true when locked and false when not |
void |
testLock()
locking an unlocked lock succeeds |
void |
testLockInterruptibly_Interrupted()
lockInterruptibly is interruptible. |
void |
testLockInterruptibly_Interrupted2()
lockInterruptibly succeeds when unlocked, else is interruptible |
void |
testSerialization()
A serialized lock deserializes as unlocked |
void |
testSignal_IllegalMonitor()
Calling signal without holding lock throws IllegalMonitorStateException |
void |
testSignalAll()
signalAll wakes up all threads |
void |
testToString()
toString indicates current lock state |
void |
testTryLock_Interrupted()
timed tryLock is interruptible. |
void |
testTryLock_Timeout()
Timed tryLock on a locked lock times out |
void |
testTryLock()
tryLock on an unlocked lock succeeds |
void |
testTryLockWhenLocked()
tryLock on a locked lock fails |
void |
testUnlock_IllegalMonitorStateException()
Unlocking an unlocked lock throws IllegalMonitorStateException |
| Methods inherited from class junit.framework.TestCase |
|---|
countTestCases, createResult, getName, run, run, runBare, setName, toString |
| Methods inherited from class junit.framework.Assert |
|---|
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame, format |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ReentrantLockTest()
| Method Detail |
|---|
public static void main(java.lang.String[] args)
public static junit.framework.Test suite()
public void testConstructor()
public void testLock()
public void testFairLock()
public void testUnlock_IllegalMonitorStateException()
public void testTryLock()
public void testHasQueuedThreads()
throws java.lang.InterruptedException
java.lang.InterruptedException
public void testGetQueueLength()
throws java.lang.InterruptedException
java.lang.InterruptedException
public void testGetQueueLength_fair()
throws java.lang.InterruptedException
java.lang.InterruptedExceptionpublic void testHasQueuedThreadNPE()
public void testHasQueuedThread()
throws java.lang.InterruptedException
java.lang.InterruptedException
public void testGetQueuedThreads()
throws java.lang.InterruptedException
java.lang.InterruptedException
public void testTryLock_Interrupted()
throws java.lang.InterruptedException
java.lang.InterruptedException
public void testTryLockWhenLocked()
throws java.lang.InterruptedException
java.lang.InterruptedException
public void testTryLock_Timeout()
throws java.lang.InterruptedException
java.lang.InterruptedExceptionpublic void testGetHoldCount()
public void testIsLocked()
throws java.lang.Exception
java.lang.Exception
public void testLockInterruptibly_Interrupted()
throws java.lang.InterruptedException
java.lang.InterruptedException
public void testLockInterruptibly_Interrupted2()
throws java.lang.InterruptedException
java.lang.InterruptedException
public void testAwait_IllegalMonitor()
throws java.lang.InterruptedException
java.lang.InterruptedExceptionpublic void testSignal_IllegalMonitor()
public void testAwaitNanos_Timeout()
throws java.lang.InterruptedException
java.lang.InterruptedException
public void testAwait_Timeout()
throws java.lang.InterruptedException
java.lang.InterruptedException
public void testAwaitUntil_Timeout()
throws java.lang.InterruptedException
java.lang.InterruptedException
public void testAwait()
throws java.lang.InterruptedException
java.lang.InterruptedExceptionpublic 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()
throws java.lang.InterruptedException
java.lang.InterruptedException
public void testGetWaitQueueLength()
throws java.lang.InterruptedException
java.lang.InterruptedException
public void testGetWaitingThreads()
throws java.lang.InterruptedException
java.lang.InterruptedException
public void testAwaitUninterruptibly()
throws java.lang.InterruptedException
java.lang.InterruptedException
public void testAwait_Interrupt()
throws java.lang.InterruptedException
java.lang.InterruptedException
public void testAwaitNanos_Interrupt()
throws java.lang.InterruptedException
java.lang.InterruptedException
public void testAwaitUntil_Interrupt()
throws java.lang.InterruptedException
java.lang.InterruptedException
public void testSignalAll()
throws java.lang.InterruptedException
java.lang.InterruptedException
public void testAwaitLockCount()
throws java.lang.InterruptedException
java.lang.InterruptedException
public void testSerialization()
throws java.lang.Exception
java.lang.Exceptionpublic void testToString()
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||