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.26 by jsr166, Mon Apr 1 20:58:58 2013 UTC vs.
Revision 1.29 by jsr166, Thu May 30 03:28:55 2013 UTC

# Line 13 | Line 13 | public class AtomicReferenceFieldUpdater
13      volatile Integer x = null;
14      Object z;
15      Integer w;
16 +    volatile int i;
17  
18      public static void main(String[] args) {
19          junit.textui.TestRunner.run(suite());
# Line 33 | Line 34 | public class AtomicReferenceFieldUpdater
34          try {
35              updaterFor("y");
36              shouldThrow();
37 <        } catch (RuntimeException success) {}
37 >        } catch (RuntimeException success) {
38 >            assertNotNull(success.getCause());
39 >        }
40      }
41  
42      /**
43 <     * construction with field not of given type throws RuntimeException
43 >     * construction with field not of given type throws ClassCastException
44       */
45      public void testConstructor2() {
46          try {
47              updaterFor("z");
48              shouldThrow();
49 <        } catch (RuntimeException success) {}
49 >        } catch (ClassCastException success) {}
50      }
51  
52      /**
53 <     * Constructor with non-volatile field throws exception
53 >     * Constructor with non-volatile field throws IllegalArgumentException
54       */
55      public void testConstructor3() {
56          try {
57              updaterFor("w");
58              shouldThrow();
59 <        } catch (RuntimeException success) {}
59 >        } catch (IllegalArgumentException success) {}
60 >    }
61 >
62 >    /**
63 >     * Constructor with non-reference field throws ClassCastException
64 >     */
65 >    public void testConstructor4() {
66 >        try {
67 >            updaterFor("i");
68 >            shouldThrow();
69 >        } catch (ClassCastException success) {}
70      }
71  
72      /**

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines