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.27 by jsr166, Tue Apr 2 04:11:28 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 34 | Line 35 | public class AtomicReferenceFieldUpdater
35              updaterFor("y");
36              shouldThrow();
37          } catch (RuntimeException success) {
38 <            assertTrue(success.getCause() != null);
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      /**
# Line 59 | Line 60 | public class AtomicReferenceFieldUpdater
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 +    /**
73       * get returns the last value set or assigned
74       */
75      public void testGetSet() {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines