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

Comparing jsr166/src/test/tck/PhaserTest.java (file contents):
Revision 1.33 by jsr166, Wed Jun 22 07:46:57 2011 UTC vs.
Revision 1.35 by dl, Wed Sep 21 12:33:56 2011 UTC

# Line 165 | Line 165 | public class PhaserTest extends JSR166Te
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();
# Line 177 | Line 177 | public class PhaserTest extends JSR166Te
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);
# Line 189 | Line 189 | public class PhaserTest extends JSR166Te
189      }
190  
191      /**
192 +     * register on a subphaser that is currently empty succeeds, even
193 +     * in the presence of another non-empty subphaser
194 +     */
195 +    public void testRegisterEmptySubPhaser() {
196 +        Phaser root = new Phaser();
197 +        Phaser child1 = new Phaser(root, 1);
198 +        Phaser child2 = new Phaser(root, 0);
199 +        assertEquals(0, child2.register());
200 +        assertEquals(0, child2.arriveAndDeregister());
201 +        assertEquals(0, child2.register());
202 +        assertEquals(0, child2.arriveAndDeregister());
203 +        assertState(child2, 0, 0, 0);
204 +    }
205 +
206 +    /**
207       * Invoking bulkRegister with a negative parameter throws an
208       * IllegalArgumentException
209       */
# Line 200 | Line 215 | public class PhaserTest extends JSR166Te
215      }
216  
217      /**
218 <     * bulkRegister should correctly record the number of unarrived parties with
219 <     * the number of parties being registered
218 >     * bulkRegister should correctly record the number of unarrived
219 >     * parties with the number of parties being registered
220       */
221      public void testBulkRegister2() {
222          Phaser phaser = new Phaser();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines