--- jsr166/src/test/tck/AtomicLongFieldUpdaterTest.java 2003/09/14 20:42:40 1.2 +++ jsr166/src/test/tck/AtomicLongFieldUpdaterTest.java 2003/09/20 18:20:07 1.3 @@ -23,39 +23,49 @@ public class AtomicLongFieldUpdaterTest return new TestSuite(AtomicLongFieldUpdaterTest.class); } + /** + * + */ public void testConstructor(){ try{ AtomicLongFieldUpdater a = AtomicLongFieldUpdater.newUpdater (getClass(), "y"); - fail("Exception not thrown"); + shouldThrow(); } - catch (RuntimeException rt) {} } + /** + * + */ public void testConstructor2(){ try{ AtomicLongFieldUpdater a = AtomicLongFieldUpdater.newUpdater (getClass(), "z"); - fail("Exception not thrown"); + shouldThrow(); } - catch (RuntimeException rt) {} } + /** + * + */ public void testConstructor3(){ try{ AtomicLongFieldUpdater a = AtomicLongFieldUpdater.newUpdater (getClass(), "w"); - fail("Exception not thrown"); + shouldThrow(); } catch (RuntimeException rt) {} } + /** + * + */ public void testGetSet(){ AtomicLongFieldUpdater a = AtomicLongFieldUpdater.newUpdater(getClass(), "x"); x = 1; @@ -66,6 +76,9 @@ public class AtomicLongFieldUpdaterTest assertEquals(-3,a.get(this)); } + /** + * + */ public void testCompareAndSet(){ AtomicLongFieldUpdater a = AtomicLongFieldUpdater.newUpdater(getClass(), "x"); x = 1; @@ -78,6 +91,9 @@ public class AtomicLongFieldUpdaterTest assertEquals(7,a.get(this)); } + /** + * + */ public void testWeakCompareAndSet(){ AtomicLongFieldUpdater a = AtomicLongFieldUpdater.newUpdater(getClass(), "x"); x = 1; @@ -88,6 +104,9 @@ public class AtomicLongFieldUpdaterTest assertEquals(7,a.get(this)); } + /** + * + */ public void testGetAndSet(){ AtomicLongFieldUpdater a = AtomicLongFieldUpdater.newUpdater(getClass(), "x"); x = 1; @@ -96,6 +115,9 @@ public class AtomicLongFieldUpdaterTest assertEquals(-10,a.getAndSet(this,1)); } + /** + * + */ public void testGetAndAdd(){ AtomicLongFieldUpdater a = AtomicLongFieldUpdater.newUpdater(getClass(), "x"); x = 1; @@ -105,6 +127,9 @@ public class AtomicLongFieldUpdaterTest assertEquals(-1,a.get(this)); } + /** + * + */ public void testGetAndDecrement(){ AtomicLongFieldUpdater a = AtomicLongFieldUpdater.newUpdater(getClass(), "x"); x = 1; @@ -113,6 +138,9 @@ public class AtomicLongFieldUpdaterTest assertEquals(-1,a.getAndDecrement(this)); } + /** + * + */ public void testGetAndIncrement(){ AtomicLongFieldUpdater a = AtomicLongFieldUpdater.newUpdater(getClass(), "x"); x = 1; @@ -125,6 +153,9 @@ public class AtomicLongFieldUpdaterTest assertEquals(1,a.get(this)); } + /** + * + */ public void testAddAndGet(){ AtomicLongFieldUpdater a = AtomicLongFieldUpdater.newUpdater(getClass(), "x"); x = 1; @@ -134,6 +165,9 @@ public class AtomicLongFieldUpdaterTest assertEquals(-1,a.get(this)); } + /** + * + */ public void testDecrementAndGet(){ AtomicLongFieldUpdater a = AtomicLongFieldUpdater.newUpdater(getClass(), "x"); x = 1; @@ -143,6 +177,9 @@ public class AtomicLongFieldUpdaterTest assertEquals(-2,a.get(this)); } + /** + * + */ public void testIncrementAndGet(){ AtomicLongFieldUpdater a = AtomicLongFieldUpdater.newUpdater(getClass(), "x"); x = 1;