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

Comparing jsr166/src/test/tck/AtomicIntegerFieldUpdaterTest.java (file contents):
Revision 1.25 by jsr166, Tue Apr 2 04:11:28 2013 UTC vs.
Revision 1.29 by jsr166, Sat Apr 25 04:55:30 2015 UTC

# Line 6 | Line 6
6   * Pat Fisher, Mike Judd.
7   */
8  
9 import junit.framework.*;
9   import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
10  
11 + import junit.framework.Test;
12 + import junit.framework.TestSuite;
13 +
14   public class AtomicIntegerFieldUpdaterTest extends JSR166TestCase {
15      volatile int x = 0;
16      int w;
17      long z;
18      public static void main(String[] args) {
19 <        junit.textui.TestRunner.run(suite());
19 >        main(suite(), args);
20      }
21      public static Test suite() {
22          return new TestSuite(AtomicIntegerFieldUpdaterTest.class);
# Line 33 | Line 35 | public class AtomicIntegerFieldUpdaterTe
35              updaterFor("y");
36              shouldThrow();
37          } catch (RuntimeException success) {
38 <            assertTrue(success.getCause() != null);
38 >            assertNotNull(success.getCause());
39          }
40      }
41  
# Line 131 | Line 133 | public class AtomicIntegerFieldUpdaterTe
133          AtomicIntegerFieldUpdater<AtomicIntegerFieldUpdaterTest> a;
134          a = updaterFor("x");
135          x = 1;
136 <        while (!a.weakCompareAndSet(this, 1, 2));
137 <        while (!a.weakCompareAndSet(this, 2, -4));
136 >        do {} while (!a.weakCompareAndSet(this, 1, 2));
137 >        do {} while (!a.weakCompareAndSet(this, 2, -4));
138          assertEquals(-4, a.get(this));
139 <        while (!a.weakCompareAndSet(this, -4, 7));
139 >        do {} while (!a.weakCompareAndSet(this, -4, 7));
140          assertEquals(7, a.get(this));
141      }
142  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines