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

Comparing jsr166/src/test/tck/AtomicReferenceFieldUpdaterTest.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 AtomicReferenceFieldUpdater
23          return new TestSuite(AtomicReferenceFieldUpdaterTest.class);
24      }
25  
26 +    /**
27 +     *
28 +     */
29      public void testConstructor(){
30          try{
31              AtomicReferenceFieldUpdater<AtomicReferenceFieldUpdaterTest, Integer>
32                  a = AtomicReferenceFieldUpdater.newUpdater
33                  (getClass(), Integer.class, "y");
34 <            fail("Exception not thrown");
34 >            shouldThrow();
35          }
33
36          catch (RuntimeException rt) {}
37      }
38  
39  
40 +    /**
41 +     *
42 +     */
43      public void testConstructor2(){
44          try{
45              AtomicReferenceFieldUpdater<AtomicReferenceFieldUpdaterTest, Integer>
46                  a = AtomicReferenceFieldUpdater.newUpdater
47                  (getClass(), Integer.class, "z");
48 <            fail("Exception not thrown");
48 >            shouldThrow();
49          }
45
50          catch (RuntimeException rt) {}
51      }
52  
53 +    /**
54 +     *
55 +     */
56      public void testConstructor3(){
57          try{
58              AtomicReferenceFieldUpdater<AtomicReferenceFieldUpdaterTest, Integer>
59                  a = AtomicReferenceFieldUpdater.newUpdater
60                  (getClass(), Integer.class, "w");
61 <            fail("Exception not thrown");
61 >            shouldThrow();
62          }
56
63          catch (RuntimeException rt) {}
64      }
65  
66 +    /**
67 +     *
68 +     */
69      public void testGetSet(){
70          AtomicReferenceFieldUpdater<AtomicReferenceFieldUpdaterTest, Integer>a = AtomicReferenceFieldUpdater.newUpdater(getClass(), Integer.class, "x");
71          x = one;
# Line 67 | Line 76 | public class AtomicReferenceFieldUpdater
76          assertEquals(-3,a.get(this));
77          
78      }
79 +    /**
80 +     *
81 +     */
82      public void testCompareAndSet(){
83          AtomicReferenceFieldUpdater<AtomicReferenceFieldUpdaterTest, Integer>a = AtomicReferenceFieldUpdater.newUpdater(getClass(), Integer.class, "x");
84          x = one;
# Line 79 | Line 91 | public class AtomicReferenceFieldUpdater
91          assertEquals(seven,a.get(this));
92      }
93  
94 +    /**
95 +     *
96 +     */
97      public void testWeakCompareAndSet(){
98          AtomicReferenceFieldUpdater<AtomicReferenceFieldUpdaterTest, Integer>a = AtomicReferenceFieldUpdater.newUpdater(getClass(), Integer.class, "x");
99          x = one;
# Line 89 | Line 104 | public class AtomicReferenceFieldUpdater
104          assertEquals(seven,a.get(this));
105      }
106  
107 +    /**
108 +     *
109 +     */
110      public void testGetAndSet(){
111          AtomicReferenceFieldUpdater<AtomicReferenceFieldUpdaterTest, Integer>a = AtomicReferenceFieldUpdater.newUpdater(getClass(), Integer.class, "x");
112          x = one;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines