16 |
|
return new TestSuite(AtomicStampedReferenceTest.class); |
17 |
|
} |
18 |
|
|
19 |
< |
static final Integer zero = new Integer(0); |
20 |
< |
static final Integer one = new Integer(1); |
21 |
< |
static final Integer two = new Integer(2); |
22 |
< |
static final Integer m3 = new Integer(-3); |
23 |
< |
|
19 |
> |
/** |
20 |
> |
* |
21 |
> |
*/ |
22 |
|
public void testConstructor(){ |
23 |
|
AtomicStampedReference ai = new AtomicStampedReference(one, 0); |
24 |
|
assertEquals(one,ai.getReference()); |
29 |
|
|
30 |
|
} |
31 |
|
|
32 |
+ |
/** |
33 |
+ |
* |
34 |
+ |
*/ |
35 |
|
public void testGetSet(){ |
36 |
|
int[] mark = new int[1]; |
37 |
|
AtomicStampedReference ai = new AtomicStampedReference(one, 0); |
51 |
|
assertEquals(1,mark[0]); |
52 |
|
} |
53 |
|
|
54 |
+ |
/** |
55 |
+ |
* |
56 |
+ |
*/ |
57 |
|
public void testAttemptStamp(){ |
58 |
|
int[] mark = new int[1]; |
59 |
|
AtomicStampedReference ai = new AtomicStampedReference(one, 0); |
64 |
|
assertEquals(1, mark[0]); |
65 |
|
} |
66 |
|
|
67 |
+ |
/** |
68 |
+ |
* |
69 |
+ |
*/ |
70 |
|
public void testCompareAndSet(){ |
71 |
|
int[] mark = new int[1]; |
72 |
|
AtomicStampedReference ai = new AtomicStampedReference(one, 0); |
87 |
|
assertEquals(1, mark[0]); |
88 |
|
} |
89 |
|
|
90 |
+ |
/** |
91 |
+ |
* |
92 |
+ |
*/ |
93 |
|
public void testWeakCompareAndSet(){ |
94 |
|
int[] mark = new int[1]; |
95 |
|
AtomicStampedReference ai = new AtomicStampedReference(one, 0); |