|
||||||||
| 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
ReentrantReadWriteLockTest
public class ReentrantReadWriteLockTest
| 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 | |
|---|---|
ReentrantReadWriteLockTest()
|
|
| 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()
WriteLock.getHoldCount returns number of recursive holds |
void |
testGetQueuedThreads()
getQueuedThreads includes waiting threads |
void |
testGetQueueLength()
getQueueLength reports number of waiting threads |
void |
testGetReadHoldCount()
getReadHoldCount returns number of recursive holds |
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 |
testGetWriteHoldCount()
getWriteHoldCount returns number of recursive holds |
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 |
testLock()
write-locking and read-locking an unlocked lock succeed |
void |
testMultipleReadLocks()
Multiple threads can hold a read lock when not write-locked |
void |
testReadAfterWriteLock()
Readlocks succeed only after a writing thread unlocks |
void |
testReaderWriterReaderFairFifo()
A thread that tries to acquire a fair read lock (non-reentrantly) will block if there is a waiting writer thread. |
void |
testReadHoldingWriteLock()
Read trylock succeeds if write locked by current thread |
void |
testReadHoldingWriteLock2()
Read lock succeeds if write locked by current thread even if other threads are waiting for readlock |
void |
testReadHoldingWriteLock3()
Read lock succeeds if write locked by current thread even if other threads are waiting for writelock |
void |
testReadHoldingWriteLockFair()
Fair Read trylock succeeds if write locked by current thread |
void |
testReadHoldingWriteLockFair2()
Fair Read lock succeeds if write locked by current thread even if other threads are waiting for readlock |
void |
testReadHoldingWriteLockFair3()
Fair Read lock succeeds if write locked by current thread even if other threads are waiting for writelock |
void |
testReadLockInterruptibly_Interrupted()
read-lockInterruptibly is interruptible |
void |
testReadLockInterruptibly()
read lockInterruptibly succeeds if lock free else is interruptible |
void |
testReadLockToString()
readLock.toString indicates current lock state |
void |
testReadTryLock_Interrupted()
timed read-tryLock is interruptible |
void |
testReadTryLock_Timeout()
read timed tryLock times out if write-locked |
void |
testReadTryLockWhenLocked()
read-tryLock fails if locked |
void |
testReadUnlock_IllegalMonitorStateException()
read-unlocking an unlocked lock throws IllegalMonitorStateException |
void |
testSerialization()
A serialized lock deserializes as unlocked |
void |
testSignal_IllegalMonitor()
Calling signal without holding lock throws IllegalMonitorStateException |
void |
testSignalAll_IllegalMonitor()
Calling signalAll without holding lock throws IllegalMonitorStateException |
void |
testSignalAll()
signalAll wakes up all threads |
void |
testSignalWakesFifo()
signal wakes up waiting threads in FIFO order. |
void |
testToString()
toString indicates current lock state |
void |
testTryLockWhenReadLocked()
Read tryLock succeeds if readlocked but not writelocked |
void |
testTryLockWhenReadLockedFair()
Fair Read tryLock succeeds if readlocked but not writelocked |
void |
testWriteAfterMultipleReadLocks()
A writelock succeeds only after reading threads unlock |
void |
testWriteAfterReadLock()
A writelock succeeds only after a reading thread unlocks |
void |
testWriteHoldingWriteLock4()
Write lock succeeds if write locked by current thread even if other threads are waiting for writelock |
void |
testWriteHoldingWriteLockFair4()
Fair Write lock succeeds if write locked by current thread even if other threads are waiting for writelock |
void |
testWriteLockInterruptibly_Interrupted()
write-lockInterruptibly is interruptible |
void |
testWriteLockInterruptibly()
write lockInterruptibly succeeds if lock free else is interruptible |
void |
testWriteLockToString()
writeLock.toString indicates current lock state |
void |
testWriteTryLock_Interrupted()
timed write-tryLock is interruptible |
void |
testWriteTryLock_Timeout()
write timed tryLock times out if locked |
void |
testWriteTryLockWhenLocked()
write-tryLock fails if locked |
void |
testWriteTryLockWhenReadLocked()
write tryLock fails when readlocked |
void |
testWriteTryLockWhenReadLockedFair()
Fair write tryLock fails when readlocked |
void |
testWriteUnlock_IllegalMonitorStateException()
write-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 ReentrantReadWriteLockTest()
| 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 testGetWriteHoldCount()
public void testGetHoldCount()
public void testGetReadHoldCount()
public void testWriteUnlock_IllegalMonitorStateException()
public void testReadUnlock_IllegalMonitorStateException()
public void testWriteLockInterruptibly_Interrupted()
throws java.lang.Exception
java.lang.Exception
public void testWriteTryLock_Interrupted()
throws java.lang.InterruptedException
java.lang.InterruptedException
public void testReadLockInterruptibly_Interrupted()
throws java.lang.InterruptedException
java.lang.InterruptedException
public void testReadTryLock_Interrupted()
throws java.lang.InterruptedException
java.lang.InterruptedException
public void testWriteTryLockWhenLocked()
throws java.lang.InterruptedException
java.lang.InterruptedException
public void testReadTryLockWhenLocked()
throws java.lang.InterruptedException
java.lang.InterruptedException
public void testMultipleReadLocks()
throws java.lang.InterruptedException
java.lang.InterruptedException
public void testWriteAfterReadLock()
throws java.lang.InterruptedException
java.lang.InterruptedException
public void testWriteAfterMultipleReadLocks()
throws java.lang.InterruptedException
java.lang.InterruptedException
public void testReaderWriterReaderFairFifo()
throws java.lang.InterruptedException
java.lang.InterruptedException
public void testReadAfterWriteLock()
throws java.lang.InterruptedException
java.lang.InterruptedExceptionpublic void testReadHoldingWriteLock()
public void testReadHoldingWriteLock2()
throws java.lang.InterruptedException
java.lang.InterruptedException
public void testReadHoldingWriteLock3()
throws java.lang.InterruptedException
java.lang.InterruptedException
public void testWriteHoldingWriteLock4()
throws java.lang.InterruptedException
java.lang.InterruptedExceptionpublic void testReadHoldingWriteLockFair()
public void testReadHoldingWriteLockFair2()
throws java.lang.InterruptedException
java.lang.InterruptedException
public void testReadHoldingWriteLockFair3()
throws java.lang.InterruptedException
java.lang.InterruptedException
public void testWriteHoldingWriteLockFair4()
throws java.lang.InterruptedException
java.lang.InterruptedException
public void testTryLockWhenReadLocked()
throws java.lang.InterruptedException
java.lang.InterruptedException
public void testWriteTryLockWhenReadLocked()
throws java.lang.InterruptedException
java.lang.InterruptedException
public void testTryLockWhenReadLockedFair()
throws java.lang.InterruptedException
java.lang.InterruptedException
public void testWriteTryLockWhenReadLockedFair()
throws java.lang.InterruptedException
java.lang.InterruptedException
public void testWriteTryLock_Timeout()
throws java.lang.InterruptedException
java.lang.InterruptedException
public void testReadTryLock_Timeout()
throws java.lang.InterruptedException
java.lang.InterruptedException
public void testWriteLockInterruptibly()
throws java.lang.InterruptedException
java.lang.InterruptedException
public void testReadLockInterruptibly()
throws java.lang.InterruptedException
java.lang.InterruptedException
public void testAwait_IllegalMonitor()
throws java.lang.InterruptedException
java.lang.InterruptedExceptionpublic void testSignal_IllegalMonitor()
public void testSignalAll_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.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 testSignalWakesFifo()
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.Exception
public void testHasQueuedThreads()
throws java.lang.InterruptedException
java.lang.InterruptedExceptionpublic void testHasQueuedThreadNPE()
public void testHasQueuedThread()
throws java.lang.InterruptedException
java.lang.InterruptedException
public void testGetQueueLength()
throws java.lang.InterruptedException
java.lang.InterruptedException
public void testGetQueuedThreads()
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.InterruptedExceptionpublic void testToString()
public void testReadLockToString()
public void testWriteLockToString()
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||