87 |
|
assertTrue(ai.compareAndSet(one, two)); |
88 |
|
t.join(LONG_DELAY_MS); |
89 |
|
assertFalse(t.isAlive()); |
90 |
< |
assertSame(ai.get(), three); |
90 |
> |
assertSame(three, ai.get()); |
91 |
|
} |
92 |
|
|
93 |
|
/** |
119 |
|
public void testSerialization() throws Exception { |
120 |
|
AtomicReference x = new AtomicReference(); |
121 |
|
AtomicReference y = serialClone(x); |
122 |
< |
assertTrue(x != y); |
122 |
> |
assertNotSame(x, y); |
123 |
|
x.set(one); |
124 |
|
AtomicReference z = serialClone(x); |
125 |
+ |
assertNotSame(y, z); |
126 |
|
assertEquals(one, x.get()); |
127 |
|
assertEquals(null, y.get()); |
128 |
|
assertEquals(one, z.get()); |
133 |
|
*/ |
134 |
|
public void testToString() { |
135 |
|
AtomicReference<Integer> ai = new AtomicReference<Integer>(one); |
136 |
< |
assertEquals(ai.toString(), one.toString()); |
136 |
> |
assertEquals(one.toString(), ai.toString()); |
137 |
|
ai.set(two); |
138 |
< |
assertEquals(ai.toString(), two.toString()); |
138 |
> |
assertEquals(two.toString(), ai.toString()); |
139 |
|
} |
140 |
|
|
141 |
|
} |