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.36 by jsr166, Fri Nov 18 20:11:17 2011 UTC vs.
Revision 1.41 by jsr166, Fri May 15 18:21:19 2015 UTC

# Line 5 | Line 5
5   * Other contributors include John Vint
6   */
7  
8 < import junit.framework.*;
8 > import static java.util.concurrent.TimeUnit.MILLISECONDS;
9 >
10   import java.util.ArrayList;
11   import java.util.List;
11 import java.util.concurrent.Phaser;
12   import java.util.concurrent.CountDownLatch;
13 + import java.util.concurrent.Phaser;
14   import java.util.concurrent.TimeoutException;
14 import static java.util.concurrent.TimeUnit.MILLISECONDS;
15 import static java.util.concurrent.TimeUnit.NANOSECONDS;
16 import java.util.concurrent.atomic.AtomicBoolean;
15   import java.util.concurrent.atomic.AtomicInteger;
16  
17 + import junit.framework.Test;
18 + import junit.framework.TestSuite;
19 +
20   public class PhaserTest extends JSR166TestCase {
21  
22      public static void main(String[] args) {
23 <        junit.textui.TestRunner.run(suite());
23 >        main(suite(), args);
24      }
25  
26      public static Test suite() {
# Line 337 | Line 338 | public class PhaserTest extends JSR166Te
338       * registered or unarrived parties would become negative
339       */
340      public void testArriveAndDeregister1() {
341 +        Phaser phaser = new Phaser();
342          try {
341            Phaser phaser = new Phaser();
343              phaser.arriveAndDeregister();
344              shouldThrow();
345          } catch (IllegalStateException success) {}
# Line 628 | Line 629 | public class PhaserTest extends JSR166Te
629                          count.incrementAndGet();
630                          assertEquals(2*k+1, phaser.arrive());
631                          assertEquals(2*k+2, phaser.awaitAdvance(2*k+1));
632 <                        assertEquals(count.get(), 4*(k+1));
632 >                        assertEquals(4*(k+1), count.get());
633                      }}}));
634  
635          for (Thread thread : threads)
# Line 747 | Line 748 | public class PhaserTest extends JSR166Te
748       * unarrived parties
749       */
750      public void testArriveAndAwaitAdvance1() {
751 +        Phaser phaser = new Phaser();
752          try {
751            Phaser phaser = new Phaser();
753              phaser.arriveAndAwaitAdvance();
754              shouldThrow();
755          } catch (IllegalStateException success) {}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines