/** Test 20 */
 public void testReadWriteReleaseCheckRead() {
   assertTrue(lockManager.readLock(tx2, obj, testIsoLevel));
   assertTrue(lockManager.writeLock(tx2, obj, testIsoLevel));
   assertTrue(lockManager.hasRead(tx2, obj));
   assertTrue(lockManager.releaseLock(tx2, obj));
   assertFalse(lockManager.hasRead(tx2, obj));
 }
 public void tearDown() throws Exception {
   // restore isolation level
   cld.setIsolationLevel(oldIsolationLevel);
   try {
     lockManager.releaseLock(tx1, obj);
     lockManager.releaseLock(tx2, obj);
   } finally {
     super.tearDown();
   }
 }
 /** Test 4 */
 public void testSingleWriteLock() {
   assertTrue(lockManager.writeLock(tx1, obj, testIsoLevel));
 }
 /** Test3 */
 public void testReadThenWrite() {
   assertTrue(lockManager.readLock(tx1, obj, testIsoLevel));
   assertTrue(lockManager.writeLock(tx1, obj, testIsoLevel));
 }
 /** Test 2 */
 public void testUpgradeReadLock() {
   assertTrue(lockManager.readLock(tx1, obj, testIsoLevel));
   assertTrue(lockManager.upgradeLock(tx1, obj, testIsoLevel));
 }
 /** Test 1 */
 public void testSingleReadLock() {
   assertTrue(lockManager.readLock(tx1, obj, testIsoLevel));
 }
 /** Test 14 */
 public void testMultipleWriteLock() {
   assertTrue(lockManager.writeLock(tx1, obj, testIsoLevel));
   assertTrue(!lockManager.writeLock(tx2, obj, testIsoLevel));
 }
 /** Test 17 */
 public void testReleaseWriteLock() {
   assertTrue(lockManager.writeLock(tx1, obj, testIsoLevel));
   assertTrue(lockManager.releaseLock(tx1, obj));
   assertTrue(lockManager.writeLock(tx2, obj, testIsoLevel));
 }
 /** Test 13 */
 public void testReadWithExistingWriter() {
   assertTrue(lockManager.writeLock(tx1, obj, testIsoLevel));
   assertFalse(lockManager.readLock(tx2, obj, testIsoLevel));
 }
 /** Test 12 */
 public void testWriteWithMultipleReadersOn1() {
   assertTrue(lockManager.readLock(tx1, obj, testIsoLevel));
   assertTrue(lockManager.readLock(tx2, obj, testIsoLevel));
   assertTrue(lockManager.writeLock(tx1, obj, testIsoLevel));
 }
 /** Test 9 */
 public void testUpgradeWithMultipleReaders() {
   assertTrue(lockManager.readLock(tx1, obj, testIsoLevel));
   assertTrue(lockManager.readLock(tx2, obj, testIsoLevel));
   assertTrue(lockManager.upgradeLock(tx2, obj, testIsoLevel));
 }
 /** Test 7 */
 public void testUpgradeWithExistingReader() {
   assertTrue(lockManager.readLock(tx1, obj, testIsoLevel));
   assertTrue(lockManager.upgradeLock(tx2, obj, testIsoLevel));
 }
 /** Test 6 */
 public void testMultipleReadLock() {
   assertTrue(lockManager.readLock(tx1, obj, testIsoLevel));
   assertTrue(lockManager.readLock(tx2, obj, testIsoLevel));
 }