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

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

# Line 23 | Line 23 | public class AtomicLongFieldUpdaterTest
23          return new TestSuite(AtomicLongFieldUpdaterTest.class);
24      }
25  
26 +    /**
27 +     *
28 +     */
29      public void testConstructor(){
30          try{
31              AtomicLongFieldUpdater<AtomicLongFieldUpdaterTest>
32                  a = AtomicLongFieldUpdater.newUpdater
33                  (getClass(), "y");
34 <            fail("Exception not thrown");
34 >            shouldThrow();
35          }
33
36          catch (RuntimeException rt) {}
37      }
38  
39 +    /**
40 +     *
41 +     */
42      public void testConstructor2(){
43          try{
44              AtomicLongFieldUpdater<AtomicLongFieldUpdaterTest>
45                  a = AtomicLongFieldUpdater.newUpdater
46                  (getClass(), "z");
47 <            fail("Exception not thrown");
47 >            shouldThrow();
48          }
44
49          catch (RuntimeException rt) {}
50      }
51  
52 +    /**
53 +     *
54 +     */
55      public void testConstructor3(){
56          try{
57              AtomicLongFieldUpdater<AtomicLongFieldUpdaterTest>
58                  a = AtomicLongFieldUpdater.newUpdater
59                  (getClass(), "w");
60 <            fail("Exception not thrown");
60 >            shouldThrow();
61          }
62  
63          catch (RuntimeException rt) {}
64      }
65  
66 +    /**
67 +     *
68 +     */
69      public void testGetSet(){
70          AtomicLongFieldUpdater<AtomicLongFieldUpdaterTest> a = AtomicLongFieldUpdater.newUpdater(getClass(), "x");
71          x = 1;
# Line 66 | Line 76 | public class AtomicLongFieldUpdaterTest
76          assertEquals(-3,a.get(this));
77          
78      }
79 +    /**
80 +     *
81 +     */
82      public void testCompareAndSet(){
83          AtomicLongFieldUpdater<AtomicLongFieldUpdaterTest> a = AtomicLongFieldUpdater.newUpdater(getClass(), "x");
84          x = 1;
# Line 78 | Line 91 | public class AtomicLongFieldUpdaterTest
91          assertEquals(7,a.get(this));
92      }
93  
94 +    /**
95 +     *
96 +     */
97      public void testWeakCompareAndSet(){
98          AtomicLongFieldUpdater<AtomicLongFieldUpdaterTest> a = AtomicLongFieldUpdater.newUpdater(getClass(), "x");
99          x = 1;
# Line 88 | Line 104 | public class AtomicLongFieldUpdaterTest
104          assertEquals(7,a.get(this));
105      }
106  
107 +    /**
108 +     *
109 +     */
110      public void testGetAndSet(){
111          AtomicLongFieldUpdater<AtomicLongFieldUpdaterTest> a = AtomicLongFieldUpdater.newUpdater(getClass(), "x");
112          x = 1;
# Line 96 | Line 115 | public class AtomicLongFieldUpdaterTest
115          assertEquals(-10,a.getAndSet(this,1));
116      }
117  
118 +    /**
119 +     *
120 +     */
121      public void testGetAndAdd(){
122          AtomicLongFieldUpdater<AtomicLongFieldUpdaterTest> a = AtomicLongFieldUpdater.newUpdater(getClass(), "x");
123          x = 1;
# Line 105 | Line 127 | public class AtomicLongFieldUpdaterTest
127          assertEquals(-1,a.get(this));
128      }
129  
130 +    /**
131 +     *
132 +     */
133      public void testGetAndDecrement(){
134          AtomicLongFieldUpdater<AtomicLongFieldUpdaterTest> a = AtomicLongFieldUpdater.newUpdater(getClass(), "x");
135          x = 1;
# Line 113 | Line 138 | public class AtomicLongFieldUpdaterTest
138          assertEquals(-1,a.getAndDecrement(this));
139      }
140  
141 +    /**
142 +     *
143 +     */
144      public void testGetAndIncrement(){
145          AtomicLongFieldUpdater<AtomicLongFieldUpdaterTest> a = AtomicLongFieldUpdater.newUpdater(getClass(), "x");
146          x = 1;
# Line 125 | Line 153 | public class AtomicLongFieldUpdaterTest
153          assertEquals(1,a.get(this));
154      }
155  
156 +    /**
157 +     *
158 +     */
159      public void testAddAndGet(){
160          AtomicLongFieldUpdater<AtomicLongFieldUpdaterTest> a = AtomicLongFieldUpdater.newUpdater(getClass(), "x");
161          x = 1;
# Line 134 | Line 165 | public class AtomicLongFieldUpdaterTest
165          assertEquals(-1,a.get(this));
166      }
167  
168 +    /**
169 +     *
170 +     */
171      public void testDecrementAndGet(){
172          AtomicLongFieldUpdater<AtomicLongFieldUpdaterTest> a = AtomicLongFieldUpdater.newUpdater(getClass(), "x");
173          x = 1;
# Line 143 | Line 177 | public class AtomicLongFieldUpdaterTest
177          assertEquals(-2,a.get(this));
178      }
179  
180 +    /**
181 +     *
182 +     */
183      public void testIncrementAndGet(){
184          AtomicLongFieldUpdater<AtomicLongFieldUpdaterTest> a = AtomicLongFieldUpdater.newUpdater(getClass(), "x");
185          x = 1;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines