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.18 by jsr166, Tue Dec 1 09:56:28 2009 UTC vs.
Revision 1.23 by jsr166, Tue May 31 16:16:23 2011 UTC

# Line 1 | Line 1
1   /*
2   * Written by Doug Lea with assistance from members of JCP JSR-166
3   * Expert Group and released to the public domain, as explained at
4 < * http://creativecommons.org/licenses/publicdomain
4 > * http://creativecommons.org/publicdomain/zero/1.0/
5   * Other contributors include Andrew Wright, Jeffrey Hayes,
6   * Pat Fisher, Mike Judd.
7   */
8  
9 import java.util.concurrent.atomic.*;
9   import junit.framework.*;
10 < import java.util.*;
10 > import java.util.concurrent.atomic.AtomicReferenceFieldUpdater;
11  
12   public class AtomicReferenceFieldUpdaterTest extends JSR166TestCase {
13      volatile Integer x = null;
# Line 34 | Line 33 | public class AtomicReferenceFieldUpdater
33          } catch (RuntimeException success) {}
34      }
35  
37
36      /**
37       * construction with field not of given type throws RuntimeException
38       */
# Line 60 | Line 58 | public class AtomicReferenceFieldUpdater
58      }
59  
60      /**
61 <     *  get returns the last value set or assigned
61 >     * get returns the last value set or assigned
62       */
63      public void testGetSet() {
64          AtomicReferenceFieldUpdater<AtomicReferenceFieldUpdaterTest, Integer>a;
# Line 78 | Line 76 | public class AtomicReferenceFieldUpdater
76      }
77  
78      /**
79 <     *  get returns the last value lazySet by same thread
79 >     * get returns the last value lazySet by same thread
80       */
81      public void testGetLazySet() {
82          AtomicReferenceFieldUpdater<AtomicReferenceFieldUpdaterTest, Integer>a;
# Line 106 | Line 104 | public class AtomicReferenceFieldUpdater
104              return;
105          }
106          x = one;
107 <        assertTrue(a.compareAndSet(this,one,two));
108 <        assertTrue(a.compareAndSet(this,two,m4));
109 <        assertSame(m4,a.get(this));
110 <        assertFalse(a.compareAndSet(this,m5,seven));
107 >        assertTrue(a.compareAndSet(this, one, two));
108 >        assertTrue(a.compareAndSet(this, two, m4));
109 >        assertSame(m4, a.get(this));
110 >        assertFalse(a.compareAndSet(this, m5, seven));
111          assertFalse(seven == a.get(this));
112 <        assertTrue(a.compareAndSet(this,m4,seven));
112 >        assertTrue(a.compareAndSet(this, m4, seven));
113          assertSame(seven,a.get(this));
114      }
115  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines