ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/tck/ReentrantReadWriteLockTest.java
(Generate patch)

Comparing jsr166/src/test/tck/ReentrantReadWriteLockTest.java (file contents):
Revision 1.41 by jsr166, Wed Aug 25 00:07:03 2010 UTC vs.
Revision 1.42 by jsr166, Thu Sep 16 00:52:49 2010 UTC

# Line 270 | Line 270 | public class ReentrantReadWriteLockTest
270          lock.writeLock().lock();
271          Thread t = new Thread(new CheckedRunnable() {
272              public void realRun() {
273 <                threadAssertFalse(lock.writeLock().tryLock());
273 >                assertFalse(lock.writeLock().tryLock());
274              }});
275  
276          t.start();
# Line 286 | Line 286 | public class ReentrantReadWriteLockTest
286          lock.writeLock().lock();
287          Thread t = new Thread(new CheckedRunnable() {
288              public void realRun() {
289 <                threadAssertFalse(lock.readLock().tryLock());
289 >                assertFalse(lock.readLock().tryLock());
290              }});
291  
292          t.start();
# Line 302 | Line 302 | public class ReentrantReadWriteLockTest
302          lock.readLock().lock();
303          Thread t = new Thread(new CheckedRunnable() {
304              public void realRun() {
305 <                threadAssertTrue(lock.readLock().tryLock());
305 >                assertTrue(lock.readLock().tryLock());
306                  lock.readLock().unlock();
307              }});
308  
# Line 573 | Line 573 | public class ReentrantReadWriteLockTest
573          t2.start();
574          Thread.sleep(SHORT_DELAY_MS);
575          assertTrue(lock.isWriteLockedByCurrentThread());
576 <        assertTrue(lock.getWriteHoldCount() == 1);
576 >        assertEquals(1, lock.getWriteHoldCount());
577          lock.writeLock().lock();
578 <        assertTrue(lock.getWriteHoldCount() == 2);
578 >        assertEquals(2, lock.getWriteHoldCount());
579          lock.writeLock().unlock();
580          lock.writeLock().lock();
581          lock.writeLock().unlock();
# Line 595 | Line 595 | public class ReentrantReadWriteLockTest
595          lock.readLock().lock();
596          Thread t = new Thread(new CheckedRunnable() {
597              public void realRun() {
598 <                threadAssertTrue(lock.readLock().tryLock());
598 >                assertTrue(lock.readLock().tryLock());
599                  lock.readLock().unlock();
600              }});
601  
# Line 614 | Line 614 | public class ReentrantReadWriteLockTest
614          lock.readLock().lock();
615          Thread t = new Thread(new CheckedRunnable() {
616              public void realRun() {
617 <                threadAssertFalse(lock.writeLock().tryLock());
617 >                assertFalse(lock.writeLock().tryLock());
618              }});
619  
620          t.start();
# Line 631 | Line 631 | public class ReentrantReadWriteLockTest
631          lock.readLock().lock();
632          Thread t = new Thread(new CheckedRunnable() {
633              public void realRun() {
634 <                threadAssertTrue(lock.readLock().tryLock());
634 >                assertTrue(lock.readLock().tryLock());
635                  lock.readLock().unlock();
636              }});
637  
# Line 650 | Line 650 | public class ReentrantReadWriteLockTest
650          lock.readLock().lock();
651          Thread t = new Thread(new CheckedRunnable() {
652              public void realRun() {
653 <                threadAssertFalse(lock.writeLock().tryLock());
653 >                assertFalse(lock.writeLock().tryLock());
654              }});
655  
656          t.start();
# Line 668 | Line 668 | public class ReentrantReadWriteLockTest
668          lock.writeLock().lock();
669          Thread t = new Thread(new CheckedRunnable() {
670              public void realRun() throws InterruptedException {
671 <                threadAssertFalse(lock.writeLock().tryLock(1, MILLISECONDS));
671 >                assertFalse(lock.writeLock().tryLock(1, MILLISECONDS));
672              }});
673  
674          t.start();
# Line 685 | Line 685 | public class ReentrantReadWriteLockTest
685          lock.writeLock().lock();
686          Thread t = new Thread(new CheckedRunnable() {
687              public void realRun() throws InterruptedException {
688 <                threadAssertFalse(lock.readLock().tryLock(1, MILLISECONDS));
688 >                assertFalse(lock.readLock().tryLock(1, MILLISECONDS));
689              }});
690  
691          t.start();
# Line 1224 | Line 1224 | public class ReentrantReadWriteLockTest
1224          Thread t = new Thread(new CheckedRunnable() {
1225              public void realRun() throws InterruptedException {
1226                  lock.writeLock().lock();
1227 <                threadAssertFalse(lock.hasWaiters(c));
1228 <                threadAssertEquals(0, lock.getWaitQueueLength(c));
1227 >                assertFalse(lock.hasWaiters(c));
1228 >                assertEquals(0, lock.getWaitQueueLength(c));
1229                  c.await();
1230                  lock.writeLock().unlock();
1231              }});
# Line 1255 | Line 1255 | public class ReentrantReadWriteLockTest
1255          Thread t = new Thread(new CheckedRunnable() {
1256              public void realRun() throws InterruptedException {
1257                  lock.writeLock().lock();
1258 <                threadAssertFalse(lock.hasWaiters(c));
1259 <                threadAssertEquals(0, lock.getWaitQueueLength(c));
1258 >                assertFalse(lock.hasWaiters(c));
1259 >                assertEquals(0, lock.getWaitQueueLength(c));
1260                  c.await();
1261                  lock.writeLock().unlock();
1262              }});
# Line 1287 | Line 1287 | public class ReentrantReadWriteLockTest
1287          Thread t1 = new Thread(new CheckedRunnable() {
1288              public void realRun() throws InterruptedException {
1289                  lock.writeLock().lock();
1290 <                threadAssertTrue(lock.getWaitingThreads(c).isEmpty());
1290 >                assertTrue(lock.getWaitingThreads(c).isEmpty());
1291                  c.await();
1292                  lock.writeLock().unlock();
1293              }});
# Line 1295 | Line 1295 | public class ReentrantReadWriteLockTest
1295          Thread t2 = new Thread(new CheckedRunnable() {
1296              public void realRun() throws InterruptedException {
1297                  lock.writeLock().lock();
1298 <                threadAssertFalse(lock.getWaitingThreads(c).isEmpty());
1298 >                assertFalse(lock.getWaitingThreads(c).isEmpty());
1299                  c.await();
1300                  lock.writeLock().unlock();
1301              }});

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines