1 |
import java.util.concurrent.atomic.AtomicInteger; |
2 |
import junit.framework.TestCase; |
3 |
|
4 |
/** |
5 |
* Tests the AtomicInteger implementation. |
6 |
*/ |
7 |
public class AtomicIntegerTest extends TestCase { |
8 |
|
9 |
public void testGetAndSet () { |
10 |
int initval = 37; |
11 |
AtomicInteger ai = new AtomicInteger(initval); |
12 |
int newval = 42; |
13 |
if (false /* remove once this is implemented */) { |
14 |
assertEquals("getAndSet should return initial value,", |
15 |
initval, ai.getAndSet(newval)); |
16 |
assertEquals("get should return new value,", |
17 |
newval, ai.get()); |
18 |
} |
19 |
} |
20 |
} |