6 |
|
* Pat Fisher, Mike Judd. |
7 |
|
*/ |
8 |
|
|
9 |
– |
import junit.framework.*; |
9 |
|
import java.util.concurrent.atomic.AtomicMarkableReference; |
10 |
|
|
11 |
+ |
import junit.framework.Test; |
12 |
+ |
import junit.framework.TestSuite; |
13 |
+ |
|
14 |
|
public class AtomicMarkableReferenceTest extends JSR166TestCase { |
15 |
|
public static void main(String[] args) { |
16 |
|
junit.textui.TestRunner.run(suite()); |
106 |
|
assertTrue(ai.compareAndSet(one, two, false, false)); |
107 |
|
t.join(LONG_DELAY_MS); |
108 |
|
assertFalse(t.isAlive()); |
109 |
< |
assertSame(ai.getReference(), three); |
109 |
> |
assertSame(three, ai.getReference()); |
110 |
|
assertFalse(ai.isMarked()); |
111 |
|
} |
112 |
|
|
126 |
|
assertTrue(ai.compareAndSet(one, one, false, true)); |
127 |
|
t.join(LONG_DELAY_MS); |
128 |
|
assertFalse(t.isAlive()); |
129 |
< |
assertSame(ai.getReference(), one); |
129 |
> |
assertSame(one, ai.getReference()); |
130 |
|
assertFalse(ai.isMarked()); |
131 |
|
} |
132 |
|
|