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.33 by jsr166, Tue Nov 17 14:33:55 2009 UTC vs.
Revision 1.34 by jsr166, Tue Nov 17 14:45:32 2009 UTC

# Line 693 | Line 693 | public class ReentrantReadWriteLockTest
693  
694          t.start();
695          t.join();
696 +        assertTrue(lock.writeLock().isHeldByCurrentThread());
697          lock.writeLock().unlock();
698      }
699  
# Line 709 | Line 710 | public class ReentrantReadWriteLockTest
710  
711          t.start();
712          t.join();
713 +        assertTrue(lock.writeLock().isHeldByCurrentThread());
714          lock.writeLock().unlock();
715      }
716  
# Line 791 | Line 793 | public class ReentrantReadWriteLockTest
793      /**
794       *  timed await without a signal times out
795       */
796 <    public void testAwait_Timeout() {
796 >    public void testAwait_Timeout() throws InterruptedException {
797          final ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
798          final Condition c = lock.writeLock().newCondition();
799          lock.writeLock().lock();
800 +        assertFalse(c.await(SHORT_DELAY_MS, TimeUnit.MILLISECONDS));
801          lock.writeLock().unlock();
802      }
803  
804      /**
805       * awaitUntil without a signal times out
806       */
807 <    public void testAwaitUntil_Timeout() {
807 >    public void testAwaitUntil_Timeout() throws InterruptedException {
808          final ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
809          final Condition c = lock.writeLock().newCondition();
810          lock.writeLock().lock();
811          java.util.Date d = new java.util.Date();
812 +        assertFalse(c.awaitUntil(new java.util.Date(d.getTime() + 10)));
813          lock.writeLock().unlock();
814      }
815  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines