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

Comparing jsr166/src/test/tck/AtomicLongArrayTest.java (file contents):
Revision 1.3 by dl, Sun Sep 14 20:42:40 2003 UTC vs.
Revision 1.4 by dl, Sat Sep 20 18:20:07 2003 UTC

# Line 17 | Line 17 | public class AtomicLongArrayTest extends
17          return new TestSuite(AtomicLongArrayTest.class);
18      }
19  
20 +    /**
21 +     *
22 +     */
23      public void testConstructor(){
24          AtomicLongArray ai = new AtomicLongArray(SIZE);
25          for (int i = 0; i < SIZE; ++i)
26              assertEquals(0,ai.get(i));
27      }
28  
29 +    /**
30 +     *
31 +     */
32      public void testGetSet(){
33          AtomicLongArray ai = new AtomicLongArray(SIZE);
34          for (int i = 0; i < SIZE; ++i) {
# Line 35 | Line 41 | public class AtomicLongArrayTest extends
41          }
42      }
43  
44 +    /**
45 +     *
46 +     */
47      public void testCompareAndSet(){
48          AtomicLongArray ai = new AtomicLongArray(SIZE);
49          for (int i = 0; i < SIZE; ++i) {
# Line 49 | Line 58 | public class AtomicLongArrayTest extends
58          }
59      }
60  
61 +    /**
62 +     *
63 +     */
64      public void testWeakCompareAndSet(){
65          AtomicLongArray ai = new AtomicLongArray(SIZE);
66          for (int i = 0; i < SIZE; ++i) {
# Line 61 | Line 73 | public class AtomicLongArrayTest extends
73          }
74      }
75  
76 +    /**
77 +     *
78 +     */
79      public void testGetAndSet(){
80          AtomicLongArray ai = new AtomicLongArray(SIZE);
81          for (int i = 0; i < SIZE; ++i) {
# Line 71 | Line 86 | public class AtomicLongArrayTest extends
86          }
87      }
88  
89 +    /**
90 +     *
91 +     */
92      public void testGetAndAdd(){
93          AtomicLongArray ai = new AtomicLongArray(SIZE);
94          for (int i = 0; i < SIZE; ++i) {
# Line 82 | Line 100 | public class AtomicLongArrayTest extends
100          }
101      }
102  
103 +    /**
104 +     *
105 +     */
106      public void testGetAndDecrement(){
107          AtomicLongArray ai = new AtomicLongArray(SIZE);
108          for (int i = 0; i < SIZE; ++i) {
# Line 92 | Line 113 | public class AtomicLongArrayTest extends
113          }
114      }
115  
116 +    /**
117 +     *
118 +     */
119      public void testGetAndIncrement(){
120          AtomicLongArray ai = new AtomicLongArray(SIZE);
121          for (int i = 0; i < SIZE; ++i) {
# Line 106 | Line 130 | public class AtomicLongArrayTest extends
130          }
131      }
132  
133 +    /**
134 +     *
135 +     */
136      public void testAddAndGet() {
137          AtomicLongArray ai = new AtomicLongArray(SIZE);
138          for (int i = 0; i < SIZE; ++i) {
# Line 117 | Line 144 | public class AtomicLongArrayTest extends
144          }
145      }
146  
147 +    /**
148 +     *
149 +     */
150      public void testDecrementAndGet(){
151          AtomicLongArray ai = new AtomicLongArray(SIZE);
152          for (int i = 0; i < SIZE; ++i) {
# Line 128 | Line 158 | public class AtomicLongArrayTest extends
158          }
159      }
160  
161 +    /**
162 +     *
163 +     */
164      public void testIncrementAndGet() {
165          AtomicLongArray ai = new AtomicLongArray(SIZE);
166          for (int i = 0; i < SIZE; ++i) {
# Line 166 | Line 199 | public class AtomicLongArrayTest extends
199          }
200      }
201  
202 +    /**
203 +     *
204 +     */
205      public void testCountingInMultipleThreads() {
206          try {
207              final AtomicLongArray ai = new AtomicLongArray(SIZE);
# Line 182 | Line 218 | public class AtomicLongArrayTest extends
218              assertEquals(c1.counts+c2.counts, SIZE * COUNTDOWN);
219          }
220          catch(InterruptedException ie) {
221 <            fail("unexpected exception");
221 >            unexpectedException();
222          }
223      }
224  
225 +    /**
226 +     *
227 +     */
228      public void testSerialization() {
229          AtomicLongArray l = new AtomicLongArray(SIZE);
230          for (int i = 0; i < SIZE; ++i)
# Line 204 | Line 243 | public class AtomicLongArrayTest extends
243                  assertEquals(l.get(i), r.get(i));
244              }
245          } catch(Exception e){
246 <            e.printStackTrace();
208 <            fail("unexpected exception");
246 >            unexpectedException();
247          }
248      }
249  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines