165 |
|
} |
166 |
|
|
167 |
|
/** |
168 |
< |
* register() correctly returns the current barrier phase number when |
169 |
< |
* invoked |
168 |
> |
* register() correctly returns the current barrier phase number |
169 |
> |
* when invoked |
170 |
|
*/ |
171 |
|
public void testRegister3() { |
172 |
|
Phaser phaser = new Phaser(); |
177 |
|
} |
178 |
|
|
179 |
|
/** |
180 |
< |
* register causes the next arrive to not increment the phase rather retain |
181 |
< |
* the phase number |
180 |
> |
* register causes the next arrive to not increment the phase |
181 |
> |
* rather retain the phase number |
182 |
|
*/ |
183 |
|
public void testRegister4() { |
184 |
|
Phaser phaser = new Phaser(1); |
189 |
|
} |
190 |
|
|
191 |
|
/** |
192 |
+ |
* register on a subphaser that is currently empty succeeds, even |
193 |
+ |
* in the presence of another non-empty subphaser |
194 |
+ |
* XXXX broken (hangs) as of 2011-06-26 |
195 |
+ |
*/ |
196 |
+ |
public void XXXXtestRegisterEmptySubPhaser() { |
197 |
+ |
Phaser root = new Phaser(); |
198 |
+ |
Phaser child1 = new Phaser(root, 1); |
199 |
+ |
Phaser child2 = new Phaser(root, 0); |
200 |
+ |
assertEquals(0, child2.register()); |
201 |
+ |
assertEquals(0, child2.arriveAndDeregister()); |
202 |
+ |
assertEquals(0, child2.register()); |
203 |
+ |
assertEquals(0, child2.arriveAndDeregister()); |
204 |
+ |
assertState(child2, 0, 0, 0); |
205 |
+ |
} |
206 |
+ |
|
207 |
+ |
/** |
208 |
|
* Invoking bulkRegister with a negative parameter throws an |
209 |
|
* IllegalArgumentException |
210 |
|
*/ |
216 |
|
} |
217 |
|
|
218 |
|
/** |
219 |
< |
* bulkRegister should correctly record the number of unarrived parties with |
220 |
< |
* the number of parties being registered |
219 |
> |
* bulkRegister should correctly record the number of unarrived |
220 |
> |
* parties with the number of parties being registered |
221 |
|
*/ |
222 |
|
public void testBulkRegister2() { |
223 |
|
Phaser phaser = new Phaser(); |