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.31 by jsr166, Wed Dec 31 19:21:20 2014 UTC vs.
Revision 1.32 by jsr166, Wed Dec 31 21:50:25 2014 UTC

# Line 75 | Line 75 | public class AtomicReferenceFieldUpdater
75       * get returns the last value set or assigned
76       */
77      public void testGetSet() {
78 <        AtomicReferenceFieldUpdater<AtomicReferenceFieldUpdaterTest, Integer>a;
78 >        AtomicReferenceFieldUpdater<AtomicReferenceFieldUpdaterTest, Integer> a;
79          a = updaterFor("x");
80          x = one;
81          assertSame(one, a.get(this));
# Line 89 | Line 89 | public class AtomicReferenceFieldUpdater
89       * get returns the last value lazySet by same thread
90       */
91      public void testGetLazySet() {
92 <        AtomicReferenceFieldUpdater<AtomicReferenceFieldUpdaterTest, Integer>a;
92 >        AtomicReferenceFieldUpdater<AtomicReferenceFieldUpdaterTest, Integer> a;
93          a = updaterFor("x");
94          x = one;
95          assertSame(one, a.get(this));
# Line 103 | Line 103 | public class AtomicReferenceFieldUpdater
103       * compareAndSet succeeds in changing value if equal to expected else fails
104       */
105      public void testCompareAndSet() {
106 <        AtomicReferenceFieldUpdater<AtomicReferenceFieldUpdaterTest, Integer>a;
106 >        AtomicReferenceFieldUpdater<AtomicReferenceFieldUpdaterTest, Integer> a;
107          a = updaterFor("x");
108          x = one;
109          assertTrue(a.compareAndSet(this, one, two));
# Line 121 | Line 121 | public class AtomicReferenceFieldUpdater
121       */
122      public void testCompareAndSetInMultipleThreads() throws Exception {
123          x = one;
124 <        final AtomicReferenceFieldUpdater<AtomicReferenceFieldUpdaterTest, Integer>a;
124 >        final AtomicReferenceFieldUpdater<AtomicReferenceFieldUpdaterTest, Integer> a;
125          a = updaterFor("x");
126  
127          Thread t = new Thread(new CheckedRunnable() {
# Line 142 | Line 142 | public class AtomicReferenceFieldUpdater
142       * to expected
143       */
144      public void testWeakCompareAndSet() {
145 <        AtomicReferenceFieldUpdater<AtomicReferenceFieldUpdaterTest, Integer>a;
145 >        AtomicReferenceFieldUpdater<AtomicReferenceFieldUpdaterTest, Integer> a;
146          a = updaterFor("x");
147          x = one;
148          do {} while (!a.weakCompareAndSet(this, one, two));
# Line 156 | Line 156 | public class AtomicReferenceFieldUpdater
156       * getAndSet returns previous value and sets to given value
157       */
158      public void testGetAndSet() {
159 <        AtomicReferenceFieldUpdater<AtomicReferenceFieldUpdaterTest, Integer>a;
159 >        AtomicReferenceFieldUpdater<AtomicReferenceFieldUpdaterTest, Integer> a;
160          a = updaterFor("x");
161          x = one;
162          assertSame(one, a.getAndSet(this, zero));

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines