18 |
|
return new TestSuite(AtomicReferenceArrayTest.class); |
19 |
|
} |
20 |
|
|
21 |
+ |
/** |
22 |
+ |
* |
23 |
+ |
*/ |
24 |
|
public void testConstructor(){ |
25 |
|
AtomicReferenceArray<Integer> ai = new AtomicReferenceArray<Integer>(SIZE); |
26 |
|
for (int i = 0; i < SIZE; ++i) { |
28 |
|
} |
29 |
|
} |
30 |
|
|
31 |
+ |
/** |
32 |
+ |
* |
33 |
+ |
*/ |
34 |
|
public void testGetSet(){ |
35 |
|
AtomicReferenceArray ai = new AtomicReferenceArray(SIZE); |
36 |
|
for (int i = 0; i < SIZE; ++i) { |
43 |
|
} |
44 |
|
} |
45 |
|
|
46 |
+ |
/** |
47 |
+ |
* |
48 |
+ |
*/ |
49 |
|
public void testCompareAndSet(){ |
50 |
|
AtomicReferenceArray ai = new AtomicReferenceArray(SIZE); |
51 |
|
for (int i = 0; i < SIZE; ++i) { |
60 |
|
} |
61 |
|
} |
62 |
|
|
63 |
+ |
/** |
64 |
+ |
* |
65 |
+ |
*/ |
66 |
|
public void testWeakCompareAndSet(){ |
67 |
|
AtomicReferenceArray ai = new AtomicReferenceArray(SIZE); |
68 |
|
for (int i = 0; i < SIZE; ++i) { |
75 |
|
} |
76 |
|
} |
77 |
|
|
78 |
+ |
/** |
79 |
+ |
* |
80 |
+ |
*/ |
81 |
|
public void testGetAndSet(){ |
82 |
|
AtomicReferenceArray ai = new AtomicReferenceArray(SIZE); |
83 |
|
for (int i = 0; i < SIZE; ++i) { |
88 |
|
} |
89 |
|
} |
90 |
|
|
91 |
+ |
/** |
92 |
+ |
* |
93 |
+ |
*/ |
94 |
|
public void testSerialization() { |
95 |
|
AtomicReferenceArray l = new AtomicReferenceArray(SIZE); |
96 |
|
for (int i = 0; i < SIZE; ++i) { |
111 |
|
assertEquals(r.get(i), l.get(i)); |
112 |
|
} |
113 |
|
} catch(Exception e){ |
114 |
< |
e.printStackTrace(); |
97 |
< |
fail("unexpected exception"); |
114 |
> |
unexpectedException(); |
115 |
|
} |
116 |
|
} |
117 |
|
|