org.objectweb.cjdbc.scenario.standalone.util
Class ReadPrioritaryFIFOWriteLockTest
java.lang.Object
TestCase
org.objectweb.cjdbc.scenario.templates.NoTemplate
org.objectweb.cjdbc.scenario.standalone.util.ReadPrioritaryFIFOWriteLockTest
- public class ReadPrioritaryFIFOWriteLockTest
- extends NoTemplate
Reader/Writer Lock test class.
- Version:
- 1.0
- Author:
- Emmanuel Cecchet
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TIMEOUT
static final long TIMEOUT
- See Also:
- Constant Field Values
lock
private ReadPrioritaryFIFOWriteLock lock
done
private boolean done
randomTest
private int randomTest
r
private java.util.Random r
ReadPrioritaryFIFOWriteLockTest
public ReadPrioritaryFIFOWriteLockTest()
setUp
protected void setUp()
- See Also:
junit.framework.TestCase#setUp()
testNonBlocking
public void testNonBlocking()
- Acquire 4 read locks, then release them. Acquire 1 write lock and release
it. Finally acquire 1 read lock and release it.
testWriteAfterRead
public void testWriteAfterRead()
- Acquire 4 read locks. Acquire 1 write lock and check that the write lock is
blocked. Release each read lock in turn and check that the write lock is
blocked. Finally check that the write lock has been released.
testReadAfterWrite
public void testReadAfterWrite()
- Acquire 1 write lock. Acquire 4 read locks and check that they are all
blocked. Release the write lock and check that all read locks have been
released.
testRandom
public void testRandom()
- Randomly acquire and release locks. This test should terminate
randomTestComplete
private void randomTestComplete()
acquireReadDoneTrue
private java.lang.Thread acquireReadDoneTrue()
acquireReadDoneFalse
private java.lang.Thread acquireReadDoneFalse()
acquireWriteDoneTrue
private java.lang.Thread acquireWriteDoneTrue()
randomAcquireReleaseRead
private java.lang.Thread randomAcquireReleaseRead()
randomAcquireReleaseWrite
private java.lang.Thread randomAcquireReleaseWrite()
Copyright © 2002, 2005 - ObjectWeb Consortium - All Rights Reserved.