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() { |
89 |
|
rl.unlock(); |
90 |
|
} |
91 |
|
|
92 |
< |
/* |
92 |
> |
/** |
93 |
|
* locking an unlocked fair lock succeeds |
94 |
|
*/ |
95 |
|
public void testFairLock() { |
99 |
|
rl.unlock(); |
100 |
|
} |
101 |
|
|
102 |
< |
/* |
102 |
> |
/** |
103 |
|
* Unlocking an unlocked lock throws IllegalMonitorStateException |
104 |
|
*/ |
105 |
|
public void testUnlock_IllegalMonitorStateException() { |
111 |
|
} catch(IllegalMonitorStateException success){} |
112 |
|
} |
113 |
|
|
114 |
< |
/* |
114 |
> |
/** |
115 |
|
* trylock on an unlocked lock succeeds |
116 |
|
*/ |
117 |
|
public void testTryLock() { |
122 |
|
} |
123 |
|
|
124 |
|
|
125 |
< |
/* |
125 |
> |
/** |
126 |
|
* getQueueLength reports number of waiting threads |
127 |
|
*/ |
128 |
|
public void testGetQueueLength() { |
151 |
|
} |
152 |
|
} |
153 |
|
|
154 |
< |
/* |
154 |
> |
/** |
155 |
|
* getQueuedThreads includes waiting threads |
156 |
|
*/ |
157 |
|
public void testGetQueuedThreads() { |
184 |
|
} |
185 |
|
|
186 |
|
|
187 |
< |
/* |
187 |
> |
/** |
188 |
|
* timed trylock is interruptible. |
189 |
|
*/ |
190 |
|
public void testInterruptedException2() { |
300 |
|
} |
301 |
|
|
302 |
|
|
303 |
< |
/* |
303 |
> |
/** |
304 |
|
* lockInterruptibly is interruptible. |
305 |
|
*/ |
306 |
|
public void testLockInterruptibly1() { |