--- jsr166/src/test/tck/AtomicReferenceFieldUpdaterTest.java 2003/08/31 19:24:53 1.1 +++ jsr166/src/test/tck/AtomicReferenceFieldUpdaterTest.java 2003/09/20 18:20:07 1.3 @@ -9,7 +9,7 @@ import java.util.concurrent.atomic.*; import junit.framework.*; import java.util.*; -public class AtomicReferenceFieldUpdaterTest extends TestCase{ +public class AtomicReferenceFieldUpdaterTest extends JSR166TestCase{ volatile Integer x = null; Object z; Integer w; @@ -23,49 +23,49 @@ public class AtomicReferenceFieldUpdater return new TestSuite(AtomicReferenceFieldUpdaterTest.class); } - static final Integer zero = new Integer(0); - static final Integer one = new Integer(1); - static final Integer two = new Integer(2); - static final Integer m3 = new Integer(-3); - static final Integer m4 = new Integer(-4); - static final Integer m5 = new Integer(-5); - static final Integer seven = new Integer(7); - static final Integer m10 = new Integer(-10); - + /** + * + */ public void testConstructor(){ try{ AtomicReferenceFieldUpdater a = AtomicReferenceFieldUpdater.newUpdater (getClass(), Integer.class, "y"); - fail("Exception not thrown"); + shouldThrow(); } - catch (RuntimeException rt) {} } + /** + * + */ public void testConstructor2(){ try{ AtomicReferenceFieldUpdater a = AtomicReferenceFieldUpdater.newUpdater (getClass(), Integer.class, "z"); - fail("Exception not thrown"); + shouldThrow(); } - catch (RuntimeException rt) {} } + /** + * + */ public void testConstructor3(){ try{ AtomicReferenceFieldUpdater a = AtomicReferenceFieldUpdater.newUpdater (getClass(), Integer.class, "w"); - fail("Exception not thrown"); + shouldThrow(); } - catch (RuntimeException rt) {} } + /** + * + */ public void testGetSet(){ AtomicReferenceFieldUpdatera = AtomicReferenceFieldUpdater.newUpdater(getClass(), Integer.class, "x"); x = one; @@ -76,6 +76,9 @@ public class AtomicReferenceFieldUpdater assertEquals(-3,a.get(this)); } + /** + * + */ public void testCompareAndSet(){ AtomicReferenceFieldUpdatera = AtomicReferenceFieldUpdater.newUpdater(getClass(), Integer.class, "x"); x = one; @@ -88,6 +91,9 @@ public class AtomicReferenceFieldUpdater assertEquals(seven,a.get(this)); } + /** + * + */ public void testWeakCompareAndSet(){ AtomicReferenceFieldUpdatera = AtomicReferenceFieldUpdater.newUpdater(getClass(), Integer.class, "x"); x = one; @@ -98,6 +104,9 @@ public class AtomicReferenceFieldUpdater assertEquals(seven,a.get(this)); } + /** + * + */ public void testGetAndSet(){ AtomicReferenceFieldUpdatera = AtomicReferenceFieldUpdater.newUpdater(getClass(), Integer.class, "x"); x = one;