5 |
|
* http://creativecommons.org/publicdomain/zero/1.0/ |
6 |
|
*/ |
7 |
|
|
8 |
< |
import junit.framework.*; |
9 |
< |
import java.util.*; |
10 |
< |
import java.util.concurrent.*; |
11 |
< |
import java.util.concurrent.atomic.*; |
8 |
> |
import java.util.concurrent.atomic.AtomicInteger; |
9 |
> |
import java.util.concurrent.atomic.AtomicIntegerArray; |
10 |
> |
import java.util.concurrent.atomic.AtomicIntegerFieldUpdater; |
11 |
> |
import java.util.concurrent.atomic.AtomicLong; |
12 |
> |
import java.util.concurrent.atomic.AtomicLongArray; |
13 |
> |
import java.util.concurrent.atomic.AtomicLongFieldUpdater; |
14 |
> |
import java.util.concurrent.atomic.AtomicReference; |
15 |
> |
import java.util.concurrent.atomic.AtomicReferenceArray; |
16 |
> |
import java.util.concurrent.atomic.AtomicReferenceFieldUpdater; |
17 |
> |
|
18 |
> |
import junit.framework.Test; |
19 |
> |
import junit.framework.TestSuite; |
20 |
|
|
21 |
|
public class Atomic8Test extends JSR166TestCase { |
22 |
|
|
23 |
|
public static void main(String[] args) { |
24 |
< |
junit.textui.TestRunner.run(suite()); |
24 |
> |
main(suite(), args); |
25 |
|
} |
26 |
|
public static Test suite() { |
27 |
|
return new TestSuite(Atomic8Test.class); |
191 |
|
assertEquals(new Integer(10), a.get()); |
192 |
|
} |
193 |
|
|
186 |
– |
|
194 |
|
/** |
195 |
|
* AtomicLongArray getAndUpdate returns previous value and updates |
196 |
|
* result of supplied function |
436 |
|
assertEquals(10, anIntField); |
437 |
|
} |
438 |
|
|
432 |
– |
|
439 |
|
/** |
440 |
|
* AtomicReferenceFieldUpdater getAndUpdate returns previous value |
441 |
|
* and updates result of supplied function |