コード例 #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));
 }
コード例 #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();
   }
 }
コード例 #3
0
 /** Test 4 */
 public void testSingleWriteLock() {
   assertTrue(lockManager.writeLock(tx1, obj, testIsoLevel));
 }
コード例 #4
0
 /** Test3 */
 public void testReadThenWrite() {
   assertTrue(lockManager.readLock(tx1, obj, testIsoLevel));
   assertTrue(lockManager.writeLock(tx1, obj, testIsoLevel));
 }
コード例 #5
0
 /** Test 2 */
 public void testUpgradeReadLock() {
   assertTrue(lockManager.readLock(tx1, obj, testIsoLevel));
   assertTrue(lockManager.upgradeLock(tx1, obj, testIsoLevel));
 }
コード例 #6
0
 /** Test 1 */
 public void testSingleReadLock() {
   assertTrue(lockManager.readLock(tx1, obj, testIsoLevel));
 }
コード例 #7
0
 /** Test 14 */
 public void testMultipleWriteLock() {
   assertTrue(lockManager.writeLock(tx1, obj, testIsoLevel));
   assertTrue(!lockManager.writeLock(tx2, obj, testIsoLevel));
 }
コード例 #8
0
 /** Test 17 */
 public void testReleaseWriteLock() {
   assertTrue(lockManager.writeLock(tx1, obj, testIsoLevel));
   assertTrue(lockManager.releaseLock(tx1, obj));
   assertTrue(lockManager.writeLock(tx2, obj, testIsoLevel));
 }
コード例 #9
0
 /** Test 13 */
 public void testReadWithExistingWriter() {
   assertTrue(lockManager.writeLock(tx1, obj, testIsoLevel));
   assertFalse(lockManager.readLock(tx2, obj, testIsoLevel));
 }
コード例 #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));
 }
コード例 #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));
 }
コード例 #12
0
 /** Test 7 */
 public void testUpgradeWithExistingReader() {
   assertTrue(lockManager.readLock(tx1, obj, testIsoLevel));
   assertTrue(lockManager.upgradeLock(tx2, obj, testIsoLevel));
 }
コード例 #13
0
 /** Test 6 */
 public void testMultipleReadLock() {
   assertTrue(lockManager.readLock(tx1, obj, testIsoLevel));
   assertTrue(lockManager.readLock(tx2, obj, testIsoLevel));
 }