Exemplo n.º 1
0
 /** 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));
 }
Exemplo n.º 2
0
 public void tearDown() throws Exception {
   // restore isolation level
   cld.setIsolationLevel(oldIsolationLevel);
   try {
     lockManager.releaseLock(tx1, obj);
     lockManager.releaseLock(tx2, obj);
   } finally {
     super.tearDown();
   }
 }
Exemplo n.º 3
0
 /** Test 4 */
 public void testSingleWriteLock() {
   assertTrue(lockManager.writeLock(tx1, obj, testIsoLevel));
 }
Exemplo n.º 4
0
 /** Test3 */
 public void testReadThenWrite() {
   assertTrue(lockManager.readLock(tx1, obj, testIsoLevel));
   assertTrue(lockManager.writeLock(tx1, obj, testIsoLevel));
 }
Exemplo n.º 5
0
 /** Test 2 */
 public void testUpgradeReadLock() {
   assertTrue(lockManager.readLock(tx1, obj, testIsoLevel));
   assertTrue(lockManager.upgradeLock(tx1, obj, testIsoLevel));
 }
Exemplo n.º 6
0
 /** Test 1 */
 public void testSingleReadLock() {
   assertTrue(lockManager.readLock(tx1, obj, testIsoLevel));
 }
Exemplo n.º 7
0
 /** Test 14 */
 public void testMultipleWriteLock() {
   assertTrue(lockManager.writeLock(tx1, obj, testIsoLevel));
   assertTrue(!lockManager.writeLock(tx2, obj, testIsoLevel));
 }
Exemplo n.º 8
0
 /** Test 17 */
 public void testReleaseWriteLock() {
   assertTrue(lockManager.writeLock(tx1, obj, testIsoLevel));
   assertTrue(lockManager.releaseLock(tx1, obj));
   assertTrue(lockManager.writeLock(tx2, obj, testIsoLevel));
 }
Exemplo n.º 9
0
 /** Test 13 */
 public void testReadWithExistingWriter() {
   assertTrue(lockManager.writeLock(tx1, obj, testIsoLevel));
   assertFalse(lockManager.readLock(tx2, obj, testIsoLevel));
 }
Exemplo n.º 10
0
 /** Test 12 */
 public void testWriteWithMultipleReadersOn1() {
   assertTrue(lockManager.readLock(tx1, obj, testIsoLevel));
   assertTrue(lockManager.readLock(tx2, obj, testIsoLevel));
   assertTrue(lockManager.writeLock(tx1, obj, testIsoLevel));
 }
Exemplo n.º 11
0
 /** Test 9 */
 public void testUpgradeWithMultipleReaders() {
   assertTrue(lockManager.readLock(tx1, obj, testIsoLevel));
   assertTrue(lockManager.readLock(tx2, obj, testIsoLevel));
   assertTrue(lockManager.upgradeLock(tx2, obj, testIsoLevel));
 }
Exemplo n.º 12
0
 /** Test 7 */
 public void testUpgradeWithExistingReader() {
   assertTrue(lockManager.readLock(tx1, obj, testIsoLevel));
   assertTrue(lockManager.upgradeLock(tx2, obj, testIsoLevel));
 }
Exemplo n.º 13
0
 /** Test 6 */
 public void testMultipleReadLock() {
   assertTrue(lockManager.readLock(tx1, obj, testIsoLevel));
   assertTrue(lockManager.readLock(tx2, obj, testIsoLevel));
 }