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