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

Comparing jsr166/src/test/tck/AtomicReferenceTest.java (file contents):
Revision 1.19 by jsr166, Fri Jun 10 20:01:21 2011 UTC vs.
Revision 1.22 by jsr166, Wed Dec 31 19:05:42 2014 UTC

# Line 6 | Line 6
6   * Pat Fisher, Mike Judd.
7   */
8  
9 import junit.framework.*;
9   import java.util.concurrent.atomic.AtomicReference;
10  
11 + import junit.framework.Test;
12 + import junit.framework.TestSuite;
13 +
14   public class AtomicReferenceTest extends JSR166TestCase {
15      public static void main(String[] args) {
16          junit.textui.TestRunner.run(suite());
# Line 87 | Line 89 | public class AtomicReferenceTest extends
89          assertTrue(ai.compareAndSet(one, two));
90          t.join(LONG_DELAY_MS);
91          assertFalse(t.isAlive());
92 <        assertSame(ai.get(), three);
92 >        assertSame(three, ai.get());
93      }
94  
95      /**
# Line 119 | Line 121 | public class AtomicReferenceTest extends
121      public void testSerialization() throws Exception {
122          AtomicReference x = new AtomicReference();
123          AtomicReference y = serialClone(x);
124 <        assertTrue(x != y);
124 >        assertNotSame(x, y);
125          x.set(one);
126          AtomicReference z = serialClone(x);
127 +        assertNotSame(y, z);
128          assertEquals(one, x.get());
129          assertEquals(null, y.get());
130          assertEquals(one, z.get());
# Line 132 | Line 135 | public class AtomicReferenceTest extends
135       */
136      public void testToString() {
137          AtomicReference<Integer> ai = new AtomicReference<Integer>(one);
138 <        assertEquals(ai.toString(), one.toString());
138 >        assertEquals(one.toString(), ai.toString());
139          ai.set(two);
140 <        assertEquals(ai.toString(), two.toString());
140 >        assertEquals(two.toString(), ai.toString());
141      }
142  
143   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines