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

Comparing jsr166/src/test/tck/AtomicStampedReferenceTest.java (file contents):
Revision 1.14 by jsr166, Tue Dec 1 09:56:28 2009 UTC vs.
Revision 1.18 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 junit.framework.*;
10 < import java.util.concurrent.atomic.*;
10 > import java.util.concurrent.atomic.AtomicStampedReference;
11  
12   public class AtomicStampedReferenceTest extends JSR166TestCase {
13 <    public static void main (String[] args) {
14 <        junit.textui.TestRunner.run (suite());
13 >    public static void main(String[] args) {
14 >        junit.textui.TestRunner.run(suite());
15      }
16      public static Test suite() {
17          return new TestSuite(AtomicStampedReferenceTest.class);
# Line 30 | Line 30 | public class AtomicStampedReferenceTest
30      }
31  
32      /**
33 <     *  get returns the last values of reference and stamp set
33 >     * get returns the last values of reference and stamp set
34       */
35      public void testGetSet() {
36          int[] mark = new int[1];
# Line 52 | Line 52 | public class AtomicStampedReferenceTest
52      }
53  
54      /**
55 <     *  attemptStamp succeeds in single thread
55 >     * attemptStamp succeeds in single thread
56       */
57      public void testAttemptStamp() {
58          int[] mark = new int[1];
# Line 136 | Line 136 | public class AtomicStampedReferenceTest
136          int[] mark = new int[1];
137          AtomicStampedReference ai = new AtomicStampedReference(one, 0);
138          assertSame(one, ai.get(mark));
139 <        assertEquals(0, ai.getStamp ());
139 >        assertEquals(0, ai.getStamp());
140          assertEquals(0, mark[0]);
141  
142          while (!ai.weakCompareAndSet(one, two, 0, 0));

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines