6 |
|
* Pat Fisher, Mike Judd. |
7 |
|
*/ |
8 |
|
|
9 |
– |
import junit.framework.*; |
9 |
|
import java.util.concurrent.atomic.AtomicLong; |
10 |
|
|
11 |
+ |
import junit.framework.Test; |
12 |
+ |
import junit.framework.TestSuite; |
13 |
+ |
|
14 |
|
public class AtomicLongTest extends JSR166TestCase { |
15 |
|
public static void main(String[] args) { |
16 |
|
junit.textui.TestRunner.run(suite()); |
198 |
|
public void testSerialization() throws Exception { |
199 |
|
AtomicLong x = new AtomicLong(); |
200 |
|
AtomicLong y = serialClone(x); |
201 |
< |
assertTrue(x != y); |
201 |
> |
assertNotSame(x, y); |
202 |
|
x.set(-22); |
203 |
|
AtomicLong z = serialClone(x); |
204 |
+ |
assertNotSame(y, z); |
205 |
|
assertEquals(-22, x.get()); |
206 |
|
assertEquals(0, y.get()); |
207 |
|
assertEquals(-22, z.get()); |