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

Comparing jsr166/src/test/tck/ReentrantLockTest.java (file contents):
Revision 1.7 by dl, Thu Sep 25 11:02:41 2003 UTC vs.
Revision 1.9 by dl, Mon Nov 3 13:50:07 2003 UTC

# Line 69 | Line 69 | public class ReentrantLockTest extends J
69  
70      }
71  
72 <    /*
72 >    /**
73 >     * Constructor sets given fairness
74 >     */
75 >    public void testConstructor() {
76 >        ReentrantLock rl = new ReentrantLock();
77 >        assertFalse(rl.isFair());
78 >        ReentrantLock r2 = new ReentrantLock(true);
79 >        assertTrue(r2.isFair());
80 >    }
81 >
82 >    /**
83       * locking an unlocked lock succeeds
84       */
85      public void testLock() {
# Line 79 | Line 89 | public class ReentrantLockTest extends J
89          rl.unlock();
90      }
91  
92 <    /*
92 >    /**
93       * locking an unlocked fair lock succeeds
94       */
95      public void testFairLock() {
# Line 89 | Line 99 | public class ReentrantLockTest extends J
99          rl.unlock();
100      }
101  
102 <    /*
102 >    /**
103       * Unlocking an unlocked lock throws IllegalMonitorStateException
104       */
105      public void testUnlock_IllegalMonitorStateException() {
# Line 101 | Line 111 | public class ReentrantLockTest extends J
111          } catch(IllegalMonitorStateException success){}
112      }
113  
114 <    /*
114 >    /**
115       * trylock on an unlocked lock succeeds
116       */
117      public void testTryLock() {
# Line 112 | Line 122 | public class ReentrantLockTest extends J
122      }
123  
124  
125 <    /*
125 >    /**
126       * getQueueLength reports number of waiting threads
127       */
128      public void testGetQueueLength() {
# Line 141 | Line 151 | public class ReentrantLockTest extends J
151          }
152      }
153  
154 <    /*
154 >    /**
155       * getQueuedThreads includes waiting threads
156       */
157      public void testGetQueuedThreads() {
# Line 174 | Line 184 | public class ReentrantLockTest extends J
184      }
185  
186  
187 <    /*
187 >    /**
188       * timed trylock is interruptible.
189       */
190      public void testInterruptedException2() {
# Line 290 | Line 300 | public class ReentrantLockTest extends J
300      }
301  
302  
303 <    /*
303 >    /**
304       * lockInterruptibly is interruptible.
305       */
306      public void testLockInterruptibly1() {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines