changeset 96:10286c3a6e62

Migrate atomicity.primitives.* tests to new API.
author shade
date Thu, 13 Mar 2014 22:06:22 +0400
parents 46629e628c38
children 8c4495a44ffa
files tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/perbyte/ByteAtomicityTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/perbyte/CharAtomicityTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/perbyte/DoubleAtomicityTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/perbyte/FloatAtomicityTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/perbyte/IntAtomicityTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/perbyte/LongAtomicityTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/perbyte/ShortAtomicityTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/perbyte/VolatileByteAtomicityTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/perbyte/VolatileCharAtomicityTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/perbyte/VolatileDoubleAtomicityTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/perbyte/VolatileFloatAtomicityTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/perbyte/VolatileIntAtomicityTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/perbyte/VolatileLongAtomicityTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/perbyte/VolatileShortAtomicityTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/plain/ByteAtomicityTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/plain/CharAtomicityTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/plain/DoubleAtomicityTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/plain/FloatAtomicityTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/plain/IntAtomicityTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/plain/LongAtomicityTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/plain/ShortAtomicityTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/plain/VolatileByteAtomicityTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/plain/VolatileCharAtomicityTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/plain/VolatileDoubleAtomicityTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/plain/VolatileFloatAtomicityTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/plain/VolatileIntAtomicityTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/plain/VolatileLongAtomicityTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/plain/VolatileShortAtomicityTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/reflect/ByteAtomicityTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/reflect/CharAtomicityTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/reflect/DoubleAtomicityTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/reflect/FloatAtomicityTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/reflect/IntAtomicityTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/reflect/LongAtomicityTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/reflect/ShortAtomicityTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/reflect/VolatileByteAtomicityTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/reflect/VolatileCharAtomicityTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/reflect/VolatileDoubleAtomicityTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/reflect/VolatileFloatAtomicityTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/reflect/VolatileIntAtomicityTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/reflect/VolatileLongAtomicityTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/reflect/VolatileShortAtomicityTest.java
diffstat 42 files changed, 671 insertions(+), 966 deletions(-) [+]
line wrap: on
line diff
--- a/tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/perbyte/ByteAtomicityTest.java	Thu Mar 13 20:58:18 2014 +0400
+++ b/tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/perbyte/ByteAtomicityTest.java	Thu Mar 13 22:06:22 2014 +0400
@@ -24,6 +24,9 @@
  */
 package org.openjdk.jcstress.tests.atomicity.primitives.perbyte;
 
+import org.openjdk.jcstress.infra.annotations.Actor;
+import org.openjdk.jcstress.infra.annotations.ConcurrencyStressTest;
+import org.openjdk.jcstress.infra.annotations.State;
 import org.openjdk.jcstress.infra.results.ByteResult2;
 import org.openjdk.jcstress.tests.Actor2_Test;
 import org.openjdk.jcstress.tests.atomicity.primitives.Constants;
@@ -33,32 +36,22 @@
  *
  * @author Aleksey Shipilev (aleksey.shipilev@oracle.com)
  */
-public class ByteAtomicityTest implements Actor2_Test<ByteAtomicityTest.State, ByteResult2> {
+@ConcurrencyStressTest
+@State
+public class ByteAtomicityTest {
 
-    public static class State {
-        byte x;
+    byte x;
+
+    @Actor
+    public void actor1() {
+        x = Constants.BYTE_SAMPLE;
     }
 
-    @Override
-    public State newState() {
-        return new State();
-    }
-
-    @Override
-    public void actor1(State s, ByteResult2 r) {
-        s.x = Constants.BYTE_SAMPLE;
-    }
-
-    @Override
-    public void actor2(State s, ByteResult2 r) {
-        byte b = s.x;
+    @Actor
+    public void actor2(ByteResult2 r) {
+        byte b = x;
         r.r1 = (byte)((b >> 0) & 0xF);
         r.r2 = (byte)((b >> 4) & 0xF);
     }
 
-    @Override
-    public ByteResult2 newResult() {
-        return new ByteResult2();
-    }
-
 }
--- a/tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/perbyte/CharAtomicityTest.java	Thu Mar 13 20:58:18 2014 +0400
+++ b/tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/perbyte/CharAtomicityTest.java	Thu Mar 13 22:06:22 2014 +0400
@@ -24,6 +24,9 @@
  */
 package org.openjdk.jcstress.tests.atomicity.primitives.perbyte;
 
+import org.openjdk.jcstress.infra.annotations.Actor;
+import org.openjdk.jcstress.infra.annotations.ConcurrencyStressTest;
+import org.openjdk.jcstress.infra.annotations.State;
 import org.openjdk.jcstress.infra.results.ByteResult2;
 import org.openjdk.jcstress.tests.Actor2_Test;
 import org.openjdk.jcstress.tests.atomicity.primitives.Constants;
@@ -33,32 +36,21 @@
  *
  * @author Aleksey Shipilev (aleksey.shipilev@oracle.com)
  */
-public class CharAtomicityTest implements Actor2_Test<CharAtomicityTest.State, ByteResult2> {
+@ConcurrencyStressTest
+@State
+public class CharAtomicityTest {
+    char x;
 
-    public static class State {
-        char x;
+    @Actor
+    public void actor1() {
+        x = Constants.CHAR_SAMPLE;
     }
 
-    @Override
-    public State newState() {
-        return new State();
-    }
-
-    @Override
-    public void actor1(State s, ByteResult2 r) {
-        s.x = Constants.CHAR_SAMPLE;
-    }
-
-    @Override
-    public void actor2(State s, ByteResult2 r) {
-        char t = s.x;
+    @Actor
+    public void actor2(ByteResult2 r) {
+        char t = x;
         r.r1 = (byte) t;
         r.r2 = (byte) ((t << 16) >> 16); // this is known to exhibit bugs
     }
 
-    @Override
-    public ByteResult2 newResult() {
-        return new ByteResult2();
-    }
-
 }
--- a/tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/perbyte/DoubleAtomicityTest.java	Thu Mar 13 20:58:18 2014 +0400
+++ b/tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/perbyte/DoubleAtomicityTest.java	Thu Mar 13 22:06:22 2014 +0400
@@ -24,6 +24,9 @@
  */
 package org.openjdk.jcstress.tests.atomicity.primitives.perbyte;
 
+import org.openjdk.jcstress.infra.annotations.Actor;
+import org.openjdk.jcstress.infra.annotations.ConcurrencyStressTest;
+import org.openjdk.jcstress.infra.annotations.State;
 import org.openjdk.jcstress.infra.results.ByteResult8;
 import org.openjdk.jcstress.tests.Actor2_Test;
 import org.openjdk.jcstress.tests.atomicity.primitives.Constants;
@@ -33,25 +36,20 @@
  *
  * @author Aleksey Shipilev (aleksey.shipilev@oracle.com)
  */
-public class DoubleAtomicityTest implements Actor2_Test<DoubleAtomicityTest.State, ByteResult8> {
+@ConcurrencyStressTest
+@State
+public class DoubleAtomicityTest {
 
-    public static class State {
-        double x;
+    double x;
+
+    @Actor
+    public void actor1() {
+        x = Constants.DOUBLE_SAMPLE;
     }
 
-    @Override
-    public State newState() {
-        return new State();
-    }
-
-    @Override
-    public void actor1(State s, ByteResult8 r) {
-        s.x = Constants.DOUBLE_SAMPLE;
-    }
-
-    @Override
-    public void actor2(State s, ByteResult8 r) {
-        long t = Double.doubleToRawLongBits(s.x);
+    @Actor
+    public void actor2(ByteResult8 r) {
+        long t = Double.doubleToRawLongBits(x);
         r.r1 = (byte) ((t >> 0) & 0xFF);
         r.r2 = (byte) ((t >> 8) & 0xFF);
         r.r3 = (byte) ((t >> 16) & 0xFF);
@@ -62,9 +60,4 @@
         r.r8 = (byte) ((t >> 56) & 0xFF);
     }
 
-    @Override
-    public ByteResult8 newResult() {
-        return new ByteResult8();
-    }
-
 }
--- a/tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/perbyte/FloatAtomicityTest.java	Thu Mar 13 20:58:18 2014 +0400
+++ b/tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/perbyte/FloatAtomicityTest.java	Thu Mar 13 22:06:22 2014 +0400
@@ -24,6 +24,9 @@
  */
 package org.openjdk.jcstress.tests.atomicity.primitives.perbyte;
 
+import org.openjdk.jcstress.infra.annotations.Actor;
+import org.openjdk.jcstress.infra.annotations.ConcurrencyStressTest;
+import org.openjdk.jcstress.infra.annotations.State;
 import org.openjdk.jcstress.infra.results.ByteResult4;
 import org.openjdk.jcstress.tests.Actor2_Test;
 import org.openjdk.jcstress.tests.atomicity.primitives.Constants;
@@ -33,34 +36,24 @@
  *
  * @author Aleksey Shipilev (aleksey.shipilev@oracle.com)
  */
-public class FloatAtomicityTest implements Actor2_Test<FloatAtomicityTest.State, ByteResult4> {
+@ConcurrencyStressTest
+@State
+public class FloatAtomicityTest {
 
-    public static class State {
-        float x;
+    float x;
+
+    @Actor
+    public void actor1() {
+        x = Constants.FLOAT_SAMPLE;
     }
 
-    @Override
-    public State newState() {
-        return new State();
-    }
-
-    @Override
-    public void actor1(State s, ByteResult4 r) {
-        s.x = Constants.FLOAT_SAMPLE;
-    }
-
-    @Override
-    public void actor2(State s, ByteResult4 r) {
-        int t = Float.floatToRawIntBits(s.x);
+    @Actor
+    public void actor2(ByteResult4 r) {
+        int t = Float.floatToRawIntBits(x);
         r.r1 = (byte) ((t >> 0) & 0xFF);
         r.r2 = (byte) ((t >> 8) & 0xFF);
         r.r3 = (byte) ((t >> 16) & 0xFF);
         r.r4 = (byte) ((t >> 24) & 0xFF);
     }
 
-    @Override
-    public ByteResult4 newResult() {
-        return new ByteResult4();
-    }
-
 }
--- a/tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/perbyte/IntAtomicityTest.java	Thu Mar 13 20:58:18 2014 +0400
+++ b/tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/perbyte/IntAtomicityTest.java	Thu Mar 13 22:06:22 2014 +0400
@@ -24,6 +24,9 @@
  */
 package org.openjdk.jcstress.tests.atomicity.primitives.perbyte;
 
+import org.openjdk.jcstress.infra.annotations.Actor;
+import org.openjdk.jcstress.infra.annotations.ConcurrencyStressTest;
+import org.openjdk.jcstress.infra.annotations.State;
 import org.openjdk.jcstress.infra.results.ByteResult4;
 import org.openjdk.jcstress.tests.Actor2_Test;
 import org.openjdk.jcstress.tests.atomicity.primitives.Constants;
@@ -33,34 +36,24 @@
  *
  * @author Aleksey Shipilev (aleksey.shipilev@oracle.com)
  */
-public class IntAtomicityTest implements Actor2_Test<IntAtomicityTest.State, ByteResult4> {
+@ConcurrencyStressTest
+@State
+public class IntAtomicityTest {
 
-    public static class State {
-        int x;
+    int x;
+
+    @Actor
+    public void actor1() {
+        x = Constants.INT_SAMPLE;
     }
 
-    @Override
-    public State newState() {
-        return new State();
-    }
-
-    @Override
-    public void actor1(State s, ByteResult4 r) {
-        s.x = Constants.INT_SAMPLE;
-    }
-
-    @Override
-    public void actor2(State s, ByteResult4 r) {
-        int t = s.x;
+    @Actor
+    public void actor2( ByteResult4 r) {
+        int t = x;
         r.r1 = (byte) ((t >> 0) & 0xFF);
         r.r2 = (byte) ((t >> 8) & 0xFF);
         r.r3 = (byte) ((t >> 16) & 0xFF);
         r.r4 = (byte) ((t >> 24) & 0xFF);
     }
 
-    @Override
-    public ByteResult4 newResult() {
-        return new ByteResult4();
-    }
-
 }
--- a/tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/perbyte/LongAtomicityTest.java	Thu Mar 13 20:58:18 2014 +0400
+++ b/tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/perbyte/LongAtomicityTest.java	Thu Mar 13 22:06:22 2014 +0400
@@ -24,6 +24,9 @@
  */
 package org.openjdk.jcstress.tests.atomicity.primitives.perbyte;
 
+import org.openjdk.jcstress.infra.annotations.Actor;
+import org.openjdk.jcstress.infra.annotations.ConcurrencyStressTest;
+import org.openjdk.jcstress.infra.annotations.State;
 import org.openjdk.jcstress.infra.results.ByteResult8;
 import org.openjdk.jcstress.tests.Actor2_Test;
 import org.openjdk.jcstress.tests.atomicity.primitives.Constants;
@@ -33,25 +36,20 @@
  *
  * @author Aleksey Shipilev (aleksey.shipilev@oracle.com)
  */
-public class LongAtomicityTest implements Actor2_Test<LongAtomicityTest.State, ByteResult8> {
+@ConcurrencyStressTest
+@State
+public class LongAtomicityTest {
 
-    public static class State {
-        long x;
+    long x;
+
+    @Actor
+    public void actor1() {
+        x = Constants.LONG_SAMPLE;
     }
 
-    @Override
-    public State newState() {
-        return new State();
-    }
-
-    @Override
-    public void actor1(State s, ByteResult8 r) {
-        s.x = Constants.LONG_SAMPLE;
-    }
-
-    @Override
-    public void actor2(State s, ByteResult8 r) {
-        long t = s.x;
+    @Actor
+    public void actor2( ByteResult8 r) {
+        long t = x;
         r.r1 = (byte) ((t >> 0) & 0xFF);
         r.r2 = (byte) ((t >> 8) & 0xFF);
         r.r3 = (byte) ((t >> 16) & 0xFF);
@@ -62,9 +60,4 @@
         r.r8 = (byte) ((t >> 56) & 0xFF);
     }
 
-    @Override
-    public ByteResult8 newResult() {
-        return new ByteResult8();
-    }
-
 }
--- a/tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/perbyte/ShortAtomicityTest.java	Thu Mar 13 20:58:18 2014 +0400
+++ b/tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/perbyte/ShortAtomicityTest.java	Thu Mar 13 22:06:22 2014 +0400
@@ -24,6 +24,9 @@
  */
 package org.openjdk.jcstress.tests.atomicity.primitives.perbyte;
 
+import org.openjdk.jcstress.infra.annotations.Actor;
+import org.openjdk.jcstress.infra.annotations.ConcurrencyStressTest;
+import org.openjdk.jcstress.infra.annotations.State;
 import org.openjdk.jcstress.infra.results.ByteResult2;
 import org.openjdk.jcstress.tests.Actor2_Test;
 import org.openjdk.jcstress.tests.atomicity.primitives.Constants;
@@ -33,32 +36,22 @@
  *
  * @author Aleksey Shipilev (aleksey.shipilev@oracle.com)
  */
-public class ShortAtomicityTest implements Actor2_Test<ShortAtomicityTest.State, ByteResult2> {
+@ConcurrencyStressTest
+@State
+public class ShortAtomicityTest {
 
-    public static class State {
-        short x;
+    short x;
+
+    @Actor
+    public void actor1() {
+        x = Constants.SHORT_SAMPLE;
     }
 
-    @Override
-    public State newState() {
-        return new State();
-    }
-
-    @Override
-    public void actor1(State s, ByteResult2 r) {
-        s.x = Constants.SHORT_SAMPLE;
-    }
-
-    @Override
-    public void actor2(State s, ByteResult2 r) {
-        short t = s.x;
+    @Actor
+    public void actor2(ByteResult2 r) {
+        short t = x;
         r.r1 = (byte) ((t >> 0) & 0xFF);
         r.r2 = (byte) ((t >> 8) & 0xFF);
     }
 
-    @Override
-    public ByteResult2 newResult() {
-        return new ByteResult2();
-    }
-
 }
--- a/tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/perbyte/VolatileByteAtomicityTest.java	Thu Mar 13 20:58:18 2014 +0400
+++ b/tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/perbyte/VolatileByteAtomicityTest.java	Thu Mar 13 22:06:22 2014 +0400
@@ -24,6 +24,9 @@
  */
 package org.openjdk.jcstress.tests.atomicity.primitives.perbyte;
 
+import org.openjdk.jcstress.infra.annotations.Actor;
+import org.openjdk.jcstress.infra.annotations.ConcurrencyStressTest;
+import org.openjdk.jcstress.infra.annotations.State;
 import org.openjdk.jcstress.infra.results.ByteResult2;
 import org.openjdk.jcstress.tests.Actor2_Test;
 import org.openjdk.jcstress.tests.atomicity.primitives.Constants;
@@ -33,32 +36,22 @@
  *
  * @author Aleksey Shipilev (aleksey.shipilev@oracle.com)
  */
-public class VolatileByteAtomicityTest implements Actor2_Test<VolatileByteAtomicityTest.State, ByteResult2> {
+@ConcurrencyStressTest
+@State
+public class VolatileByteAtomicityTest {
 
-    public static class State {
-        volatile byte x;
+    volatile byte x;
+
+    @Actor
+    public void actor1() {
+        x = Constants.BYTE_SAMPLE;
     }
 
-    @Override
-    public State newState() {
-        return new State();
-    }
-
-    @Override
-    public void actor1(State s, ByteResult2 r) {
-        s.x = Constants.BYTE_SAMPLE;
-    }
-
-    @Override
-    public void actor2(State s, ByteResult2 r) {
-        byte b = s.x;
+    @Actor
+    public void actor2(ByteResult2 r) {
+        byte b = x;
         r.r1 = (byte)((b >> 0) & 0xF);
         r.r2 = (byte)((b >> 4) & 0xF);
     }
 
-    @Override
-    public ByteResult2 newResult() {
-        return new ByteResult2();
-    }
-
 }
--- a/tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/perbyte/VolatileCharAtomicityTest.java	Thu Mar 13 20:58:18 2014 +0400
+++ b/tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/perbyte/VolatileCharAtomicityTest.java	Thu Mar 13 22:06:22 2014 +0400
@@ -24,6 +24,9 @@
  */
 package org.openjdk.jcstress.tests.atomicity.primitives.perbyte;
 
+import org.openjdk.jcstress.infra.annotations.Actor;
+import org.openjdk.jcstress.infra.annotations.ConcurrencyStressTest;
+import org.openjdk.jcstress.infra.annotations.State;
 import org.openjdk.jcstress.infra.results.ByteResult2;
 import org.openjdk.jcstress.tests.Actor2_Test;
 import org.openjdk.jcstress.tests.atomicity.primitives.Constants;
@@ -33,32 +36,22 @@
  *
  * @author Aleksey Shipilev (aleksey.shipilev@oracle.com)
  */
-public class VolatileCharAtomicityTest implements Actor2_Test<VolatileCharAtomicityTest.State, ByteResult2> {
+@ConcurrencyStressTest
+@State
+public class VolatileCharAtomicityTest {
 
-    public static class State {
-        volatile char x;
+    volatile char x;
+
+    @Actor
+    public void actor1() {
+        x = Constants.CHAR_SAMPLE;
     }
 
-    @Override
-    public State newState() {
-        return new State();
-    }
-
-    @Override
-    public void actor1(State s, ByteResult2 r) {
-        s.x = Constants.CHAR_SAMPLE;
-    }
-
-    @Override
-    public void actor2(State s, ByteResult2 r) {
-        char t = s.x;
+    @Actor
+    public void actor2(ByteResult2 r) {
+        char t = x;
         r.r1 = (byte) t;
         r.r2 = (byte) ((t << 16) >> 16); // this is known to exhibit bugs
     }
 
-    @Override
-    public ByteResult2 newResult() {
-        return new ByteResult2();
-    }
-
 }
--- a/tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/perbyte/VolatileDoubleAtomicityTest.java	Thu Mar 13 20:58:18 2014 +0400
+++ b/tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/perbyte/VolatileDoubleAtomicityTest.java	Thu Mar 13 22:06:22 2014 +0400
@@ -24,6 +24,9 @@
  */
 package org.openjdk.jcstress.tests.atomicity.primitives.perbyte;
 
+import org.openjdk.jcstress.infra.annotations.Actor;
+import org.openjdk.jcstress.infra.annotations.ConcurrencyStressTest;
+import org.openjdk.jcstress.infra.annotations.State;
 import org.openjdk.jcstress.infra.results.ByteResult8;
 import org.openjdk.jcstress.tests.Actor2_Test;
 import org.openjdk.jcstress.tests.atomicity.primitives.Constants;
@@ -33,25 +36,20 @@
  *
  * @author Aleksey Shipilev (aleksey.shipilev@oracle.com)
  */
-public class VolatileDoubleAtomicityTest implements Actor2_Test<VolatileDoubleAtomicityTest.State, ByteResult8> {
+@ConcurrencyStressTest
+@State
+public class VolatileDoubleAtomicityTest {
 
-    public static class State {
-        volatile double x;
+    volatile double x;
+
+    @Actor
+    public void actor1() {
+        x = Constants.DOUBLE_SAMPLE;
     }
 
-    @Override
-    public State newState() {
-        return new State();
-    }
-
-    @Override
-    public void actor1(State s, ByteResult8 r) {
-        s.x = Constants.DOUBLE_SAMPLE;
-    }
-
-    @Override
-    public void actor2(State s, ByteResult8 r) {
-        long t = Double.doubleToRawLongBits(s.x);
+    @Actor
+    public void actor2(ByteResult8 r) {
+        long t = Double.doubleToRawLongBits(x);
         r.r1 = (byte) ((t >> 0) & 0xFF);
         r.r2 = (byte) ((t >> 8) & 0xFF);
         r.r3 = (byte) ((t >> 16) & 0xFF);
@@ -62,9 +60,4 @@
         r.r8 = (byte) ((t >> 56) & 0xFF);
     }
 
-    @Override
-    public ByteResult8 newResult() {
-        return new ByteResult8();
-    }
-
 }
--- a/tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/perbyte/VolatileFloatAtomicityTest.java	Thu Mar 13 20:58:18 2014 +0400
+++ b/tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/perbyte/VolatileFloatAtomicityTest.java	Thu Mar 13 22:06:22 2014 +0400
@@ -24,6 +24,9 @@
  */
 package org.openjdk.jcstress.tests.atomicity.primitives.perbyte;
 
+import org.openjdk.jcstress.infra.annotations.Actor;
+import org.openjdk.jcstress.infra.annotations.ConcurrencyStressTest;
+import org.openjdk.jcstress.infra.annotations.State;
 import org.openjdk.jcstress.infra.results.ByteResult4;
 import org.openjdk.jcstress.tests.Actor2_Test;
 import org.openjdk.jcstress.tests.atomicity.primitives.Constants;
@@ -33,34 +36,24 @@
  *
  * @author Aleksey Shipilev (aleksey.shipilev@oracle.com)
  */
-public class VolatileFloatAtomicityTest implements Actor2_Test<VolatileFloatAtomicityTest.State, ByteResult4> {
+@ConcurrencyStressTest
+@State
+public class VolatileFloatAtomicityTest {
 
-    public static class State {
-        volatile float x;
+    volatile float x;
+
+    @Actor
+    public void actor1() {
+        x = Constants.FLOAT_SAMPLE;
     }
 
-    @Override
-    public State newState() {
-        return new State();
-    }
-
-    @Override
-    public void actor1(State s, ByteResult4 r) {
-        s.x = Constants.FLOAT_SAMPLE;
-    }
-
-    @Override
-    public void actor2(State s, ByteResult4 r) {
-        int t = Float.floatToRawIntBits(s.x);
+    @Actor
+    public void actor2(ByteResult4 r) {
+        int t = Float.floatToRawIntBits(x);
         r.r1 = (byte) ((t >> 0) & 0xFF);
         r.r2 = (byte) ((t >> 8) & 0xFF);
         r.r3 = (byte) ((t >> 16) & 0xFF);
         r.r4 = (byte) ((t >> 24) & 0xFF);
     }
 
-    @Override
-    public ByteResult4 newResult() {
-        return new ByteResult4();
-    }
-
 }
--- a/tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/perbyte/VolatileIntAtomicityTest.java	Thu Mar 13 20:58:18 2014 +0400
+++ b/tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/perbyte/VolatileIntAtomicityTest.java	Thu Mar 13 22:06:22 2014 +0400
@@ -24,6 +24,9 @@
  */
 package org.openjdk.jcstress.tests.atomicity.primitives.perbyte;
 
+import org.openjdk.jcstress.infra.annotations.Actor;
+import org.openjdk.jcstress.infra.annotations.ConcurrencyStressTest;
+import org.openjdk.jcstress.infra.annotations.State;
 import org.openjdk.jcstress.infra.results.ByteResult4;
 import org.openjdk.jcstress.tests.Actor2_Test;
 import org.openjdk.jcstress.tests.atomicity.primitives.Constants;
@@ -33,34 +36,24 @@
  *
  * @author Aleksey Shipilev (aleksey.shipilev@oracle.com)
  */
-public class VolatileIntAtomicityTest implements Actor2_Test<VolatileIntAtomicityTest.State, ByteResult4> {
+@ConcurrencyStressTest
+@State
+public class VolatileIntAtomicityTest {
 
-    public static class State {
-        volatile int x;
+    volatile int x;
+
+    @Actor
+    public void actor1() {
+        x = Constants.INT_SAMPLE;
     }
 
-    @Override
-    public State newState() {
-        return new State();
-    }
-
-    @Override
-    public void actor1(State s, ByteResult4 r) {
-        s.x = Constants.INT_SAMPLE;
-    }
-
-    @Override
-    public void actor2(State s, ByteResult4 r) {
-        int t = s.x;
+    @Actor
+    public void actor2(ByteResult4 r) {
+        int t = x;
         r.r1 = (byte) ((t >> 0) & 0xFF);
         r.r2 = (byte) ((t >> 8) & 0xFF);
         r.r3 = (byte) ((t >> 16) & 0xFF);
         r.r4 = (byte) ((t >> 24) & 0xFF);
     }
 
-    @Override
-    public ByteResult4 newResult() {
-        return new ByteResult4();
-    }
-
 }
--- a/tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/perbyte/VolatileLongAtomicityTest.java	Thu Mar 13 20:58:18 2014 +0400
+++ b/tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/perbyte/VolatileLongAtomicityTest.java	Thu Mar 13 22:06:22 2014 +0400
@@ -24,6 +24,9 @@
  */
 package org.openjdk.jcstress.tests.atomicity.primitives.perbyte;
 
+import org.openjdk.jcstress.infra.annotations.Actor;
+import org.openjdk.jcstress.infra.annotations.ConcurrencyStressTest;
+import org.openjdk.jcstress.infra.annotations.State;
 import org.openjdk.jcstress.infra.results.ByteResult8;
 import org.openjdk.jcstress.tests.Actor2_Test;
 import org.openjdk.jcstress.tests.atomicity.primitives.Constants;
@@ -33,25 +36,20 @@
  *
  * @author Aleksey Shipilev (aleksey.shipilev@oracle.com)
  */
-public class VolatileLongAtomicityTest implements Actor2_Test<VolatileLongAtomicityTest.State, ByteResult8> {
+@ConcurrencyStressTest
+@State
+public class VolatileLongAtomicityTest {
 
-    public static class State {
-        volatile long x;
+    volatile long x;
+
+    @Actor
+    public void actor1() {
+        x = Constants.LONG_SAMPLE;
     }
 
-    @Override
-    public State newState() {
-        return new State();
-    }
-
-    @Override
-    public void actor1(State s, ByteResult8 r) {
-        s.x = Constants.LONG_SAMPLE;
-    }
-
-    @Override
-    public void actor2(State s, ByteResult8 r) {
-        long t = s.x;
+    @Actor
+    public void actor2(ByteResult8 r) {
+        long t = x;
         r.r1 = (byte) ((t >> 0) & 0xFF);
         r.r2 = (byte) ((t >> 8) & 0xFF);
         r.r3 = (byte) ((t >> 16) & 0xFF);
@@ -62,9 +60,4 @@
         r.r8 = (byte) ((t >> 56) & 0xFF);
     }
 
-    @Override
-    public ByteResult8 newResult() {
-        return new ByteResult8();
-    }
-
 }
--- a/tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/perbyte/VolatileShortAtomicityTest.java	Thu Mar 13 20:58:18 2014 +0400
+++ b/tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/perbyte/VolatileShortAtomicityTest.java	Thu Mar 13 22:06:22 2014 +0400
@@ -24,6 +24,9 @@
  */
 package org.openjdk.jcstress.tests.atomicity.primitives.perbyte;
 
+import org.openjdk.jcstress.infra.annotations.Actor;
+import org.openjdk.jcstress.infra.annotations.ConcurrencyStressTest;
+import org.openjdk.jcstress.infra.annotations.State;
 import org.openjdk.jcstress.infra.results.ByteResult2;
 import org.openjdk.jcstress.tests.Actor2_Test;
 import org.openjdk.jcstress.tests.atomicity.primitives.Constants;
@@ -33,32 +36,22 @@
  *
  * @author Aleksey Shipilev (aleksey.shipilev@oracle.com)
  */
-public class VolatileShortAtomicityTest implements Actor2_Test<VolatileShortAtomicityTest.State, ByteResult2> {
+@ConcurrencyStressTest
+@State
+public class VolatileShortAtomicityTest {
 
-    public static class State {
-        volatile short x;
+    volatile short x;
+
+    @Actor
+    public void actor1() {
+        x = Constants.SHORT_SAMPLE;
     }
 
-    @Override
-    public State newState() {
-        return new State();
-    }
-
-    @Override
-    public void actor1(State s, ByteResult2 r) {
-        s.x = Constants.SHORT_SAMPLE;
-    }
-
-    @Override
-    public void actor2(State s, ByteResult2 r) {
-        short t = s.x;
+    @Actor
+    public void actor2(ByteResult2 r) {
+        short t = x;
         r.r1 = (byte) ((t >> 0) & 0xFF);
         r.r2 = (byte) ((t >> 8) & 0xFF);
     }
 
-    @Override
-    public ByteResult2 newResult() {
-        return new ByteResult2();
-    }
-
 }
--- a/tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/plain/ByteAtomicityTest.java	Thu Mar 13 20:58:18 2014 +0400
+++ b/tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/plain/ByteAtomicityTest.java	Thu Mar 13 22:06:22 2014 +0400
@@ -24,6 +24,9 @@
  */
 package org.openjdk.jcstress.tests.atomicity.primitives.plain;
 
+import org.openjdk.jcstress.infra.annotations.Actor;
+import org.openjdk.jcstress.infra.annotations.ConcurrencyStressTest;
+import org.openjdk.jcstress.infra.annotations.State;
 import org.openjdk.jcstress.infra.results.ByteResult1;
 import org.openjdk.jcstress.tests.Actor2_Test;
 import org.openjdk.jcstress.tests.atomicity.primitives.Constants;
@@ -33,30 +36,20 @@
  *
  * @author Aleksey Shipilev (aleksey.shipilev@oracle.com)
  */
-public class ByteAtomicityTest implements Actor2_Test<ByteAtomicityTest.State, ByteResult1> {
+@ConcurrencyStressTest
+@State
+public class ByteAtomicityTest {
 
-    public static class State {
-        byte x;
+    byte x;
+
+    @Actor
+    public void actor1() {
+        x = Constants.BYTE_SAMPLE;
     }
 
-    @Override
-    public State newState() {
-        return new State();
-    }
-
-    @Override
-    public void actor1(State s, ByteResult1 r) {
-        s.x = Constants.BYTE_SAMPLE;
-    }
-
-    @Override
-    public void actor2(State s, ByteResult1 r) {
-        r.r1 = s.x;
-    }
-
-    @Override
-    public ByteResult1 newResult() {
-        return new ByteResult1();
+    @Actor
+    public void actor2(ByteResult1 r) {
+        r.r1 = x;
     }
 
 }
--- a/tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/plain/CharAtomicityTest.java	Thu Mar 13 20:58:18 2014 +0400
+++ b/tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/plain/CharAtomicityTest.java	Thu Mar 13 22:06:22 2014 +0400
@@ -24,6 +24,9 @@
  */
 package org.openjdk.jcstress.tests.atomicity.primitives.plain;
 
+import org.openjdk.jcstress.infra.annotations.Actor;
+import org.openjdk.jcstress.infra.annotations.ConcurrencyStressTest;
+import org.openjdk.jcstress.infra.annotations.State;
 import org.openjdk.jcstress.infra.results.CharResult1;
 import org.openjdk.jcstress.tests.Actor2_Test;
 
@@ -32,30 +35,20 @@
  *
  * @author Aleksey Shipilev (aleksey.shipilev@oracle.com)
  */
-public class CharAtomicityTest implements Actor2_Test<CharAtomicityTest.State, CharResult1> {
+@ConcurrencyStressTest
+@State
+public class CharAtomicityTest {
 
-    public static class State {
-        char x;
+    char x;
+
+    @Actor
+    public void actor1() {
+        x = 'A';
     }
 
-    @Override
-    public State newState() {
-        return new State();
-    }
-
-    @Override
-    public void actor1(State s, CharResult1 r) {
-        s.x = 'A';
-    }
-
-    @Override
-    public void actor2(State s, CharResult1 r) {
-        r.r1 = (s.x == 0) ? 'N' : 'A';
-    }
-
-    @Override
-    public CharResult1 newResult() {
-        return new CharResult1();
+    @Actor
+    public void actor2(CharResult1 r) {
+        r.r1 = (x == 0) ? 'N' : 'A';
     }
 
 }
--- a/tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/plain/DoubleAtomicityTest.java	Thu Mar 13 20:58:18 2014 +0400
+++ b/tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/plain/DoubleAtomicityTest.java	Thu Mar 13 22:06:22 2014 +0400
@@ -24,6 +24,9 @@
  */
 package org.openjdk.jcstress.tests.atomicity.primitives.plain;
 
+import org.openjdk.jcstress.infra.annotations.Actor;
+import org.openjdk.jcstress.infra.annotations.ConcurrencyStressTest;
+import org.openjdk.jcstress.infra.annotations.State;
 import org.openjdk.jcstress.infra.results.DoubleResult1;
 import org.openjdk.jcstress.tests.Actor2_Test;
 import org.openjdk.jcstress.tests.atomicity.primitives.Constants;
@@ -33,30 +36,20 @@
  *
  * @author Aleksey Shipilev (aleksey.shipilev@oracle.com)
  */
-public class DoubleAtomicityTest implements Actor2_Test<DoubleAtomicityTest.State, DoubleResult1> {
+@ConcurrencyStressTest
+@State
+public class DoubleAtomicityTest {
 
-    public static class State {
-        double x;
+    double x;
+
+    @Actor
+    public void actor1() {
+        x = Constants.DOUBLE_SAMPLE;
     }
 
-    @Override
-    public State newState() {
-        return new State();
-    }
-
-    @Override
-    public void actor1(State s, DoubleResult1 r) {
-        s.x = Constants.DOUBLE_SAMPLE;
-    }
-
-    @Override
-    public void actor2(State s, DoubleResult1 r) {
-        r.r1 = s.x;
-    }
-
-    @Override
-    public DoubleResult1 newResult() {
-        return new DoubleResult1();
+    @Actor
+    public void actor2(DoubleResult1 r) {
+        r.r1 = x;
     }
 
 }
--- a/tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/plain/FloatAtomicityTest.java	Thu Mar 13 20:58:18 2014 +0400
+++ b/tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/plain/FloatAtomicityTest.java	Thu Mar 13 22:06:22 2014 +0400
@@ -24,6 +24,9 @@
  */
 package org.openjdk.jcstress.tests.atomicity.primitives.plain;
 
+import org.openjdk.jcstress.infra.annotations.Actor;
+import org.openjdk.jcstress.infra.annotations.ConcurrencyStressTest;
+import org.openjdk.jcstress.infra.annotations.State;
 import org.openjdk.jcstress.infra.results.FloatResult1;
 import org.openjdk.jcstress.tests.Actor2_Test;
 import org.openjdk.jcstress.tests.atomicity.primitives.Constants;
@@ -33,30 +36,20 @@
  *
  * @author Aleksey Shipilev (aleksey.shipilev@oracle.com)
  */
-public class FloatAtomicityTest implements Actor2_Test<FloatAtomicityTest.State, FloatResult1> {
+@ConcurrencyStressTest
+@State
+public class FloatAtomicityTest {
 
-    public static class State {
-        float x;
+    float x;
+
+    @Actor
+    public void actor1() {
+        x = Constants.FLOAT_SAMPLE;
     }
 
-    @Override
-    public State newState() {
-        return new State();
-    }
-
-    @Override
-    public void actor1(State s, FloatResult1 r) {
-        s.x = Constants.FLOAT_SAMPLE;
-    }
-
-    @Override
-    public void actor2(State s, FloatResult1 r) {
-        r.r1 = s.x;
-    }
-
-    @Override
-    public FloatResult1 newResult() {
-        return new FloatResult1();
+    @Actor
+    public void actor2(FloatResult1 r) {
+        r.r1 = x;
     }
 
 }
--- a/tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/plain/IntAtomicityTest.java	Thu Mar 13 20:58:18 2014 +0400
+++ b/tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/plain/IntAtomicityTest.java	Thu Mar 13 22:06:22 2014 +0400
@@ -24,6 +24,9 @@
  */
 package org.openjdk.jcstress.tests.atomicity.primitives.plain;
 
+import org.openjdk.jcstress.infra.annotations.Actor;
+import org.openjdk.jcstress.infra.annotations.ConcurrencyStressTest;
+import org.openjdk.jcstress.infra.annotations.State;
 import org.openjdk.jcstress.infra.results.IntResult1;
 import org.openjdk.jcstress.tests.Actor2_Test;
 import org.openjdk.jcstress.tests.atomicity.primitives.Constants;
@@ -33,30 +36,20 @@
  *
  * @author Aleksey Shipilev (aleksey.shipilev@oracle.com)
  */
-public class IntAtomicityTest implements Actor2_Test<IntAtomicityTest.State, IntResult1> {
+@ConcurrencyStressTest
+@State
+public class IntAtomicityTest {
 
-    public static class State {
-        int x;
+    int x;
+
+    @Actor
+    public void actor1() {
+        x = Constants.INT_SAMPLE;
     }
 
-    @Override
-    public State newState() {
-        return new State();
-    }
-
-    @Override
-    public void actor1(State s, IntResult1 r) {
-        s.x = Constants.INT_SAMPLE;
-    }
-
-    @Override
-    public void actor2(State s, IntResult1 r) {
-        r.r1 = s.x;
-    }
-
-    @Override
-    public IntResult1 newResult() {
-        return new IntResult1();
+    @Actor
+    public void actor2(IntResult1 r) {
+        r.r1 = x;
     }
 
 }
--- a/tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/plain/LongAtomicityTest.java	Thu Mar 13 20:58:18 2014 +0400
+++ b/tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/plain/LongAtomicityTest.java	Thu Mar 13 22:06:22 2014 +0400
@@ -24,6 +24,9 @@
  */
 package org.openjdk.jcstress.tests.atomicity.primitives.plain;
 
+import org.openjdk.jcstress.infra.annotations.Actor;
+import org.openjdk.jcstress.infra.annotations.ConcurrencyStressTest;
+import org.openjdk.jcstress.infra.annotations.State;
 import org.openjdk.jcstress.infra.results.LongResult1;
 import org.openjdk.jcstress.tests.Actor2_Test;
 import org.openjdk.jcstress.tests.atomicity.primitives.Constants;
@@ -33,30 +36,20 @@
  *
  * @author Aleksey Shipilev (aleksey.shipilev@oracle.com)
  */
-public class LongAtomicityTest implements Actor2_Test<LongAtomicityTest.State, LongResult1> {
+@ConcurrencyStressTest
+@State
+public class LongAtomicityTest {
 
-    public static class State {
-        long x;
+    long x;
+
+    @Actor
+    public void actor1() {
+        x = Constants.LONG_SAMPLE;
     }
 
-    @Override
-    public State newState() {
-        return new State();
-    }
-
-    @Override
-    public void actor1(State s, LongResult1 r) {
-        s.x = Constants.LONG_SAMPLE;
-    }
-
-    @Override
-    public void actor2(State s, LongResult1 r) {
-        r.r1 = s.x;
-    }
-
-    @Override
-    public LongResult1 newResult() {
-        return new LongResult1();
+    @Actor
+    public void actor2(LongResult1 r) {
+        r.r1 = x;
     }
 
 }
--- a/tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/plain/ShortAtomicityTest.java	Thu Mar 13 20:58:18 2014 +0400
+++ b/tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/plain/ShortAtomicityTest.java	Thu Mar 13 22:06:22 2014 +0400
@@ -24,6 +24,9 @@
  */
 package org.openjdk.jcstress.tests.atomicity.primitives.plain;
 
+import org.openjdk.jcstress.infra.annotations.Actor;
+import org.openjdk.jcstress.infra.annotations.ConcurrencyStressTest;
+import org.openjdk.jcstress.infra.annotations.State;
 import org.openjdk.jcstress.infra.results.ShortResult1;
 import org.openjdk.jcstress.tests.Actor2_Test;
 import org.openjdk.jcstress.tests.atomicity.primitives.Constants;
@@ -33,30 +36,20 @@
  *
  * @author Aleksey Shipilev (aleksey.shipilev@oracle.com)
  */
-public class ShortAtomicityTest implements Actor2_Test<ShortAtomicityTest.State, ShortResult1> {
+@ConcurrencyStressTest
+@State
+public class ShortAtomicityTest {
 
-    public static class State {
-        short x;
+    short x;
+
+    @Actor
+    public void actor1() {
+        x = Constants.SHORT_SAMPLE;
     }
 
-    @Override
-    public State newState() {
-        return new State();
-    }
-
-    @Override
-    public void actor1(State s, ShortResult1 r) {
-        s.x = Constants.SHORT_SAMPLE;
-    }
-
-    @Override
-    public void actor2(State s, ShortResult1 r) {
-        r.r1 = s.x;
-    }
-
-    @Override
-    public ShortResult1 newResult() {
-        return new ShortResult1();
+    @Actor
+    public void actor2(ShortResult1 r) {
+        r.r1 = x;
     }
 
 }
--- a/tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/plain/VolatileByteAtomicityTest.java	Thu Mar 13 20:58:18 2014 +0400
+++ b/tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/plain/VolatileByteAtomicityTest.java	Thu Mar 13 22:06:22 2014 +0400
@@ -24,6 +24,9 @@
  */
 package org.openjdk.jcstress.tests.atomicity.primitives.plain;
 
+import org.openjdk.jcstress.infra.annotations.Actor;
+import org.openjdk.jcstress.infra.annotations.ConcurrencyStressTest;
+import org.openjdk.jcstress.infra.annotations.State;
 import org.openjdk.jcstress.infra.results.ByteResult1;
 import org.openjdk.jcstress.tests.Actor2_Test;
 import org.openjdk.jcstress.tests.atomicity.primitives.Constants;
@@ -33,30 +36,20 @@
  *
  * @author Aleksey Shipilev (aleksey.shipilev@oracle.com)
  */
-public class VolatileByteAtomicityTest implements Actor2_Test<VolatileByteAtomicityTest.State, ByteResult1> {
+@ConcurrencyStressTest
+@State
+public class VolatileByteAtomicityTest {
 
-    public static class State {
-        volatile byte x;
+    volatile byte x;
+
+    @Actor
+    public void actor1() {
+        x = Constants.BYTE_SAMPLE;
     }
 
-    @Override
-    public State newState() {
-        return new State();
-    }
-
-    @Override
-    public void actor1(State s, ByteResult1 r) {
-        s.x = Constants.BYTE_SAMPLE;
-    }
-
-    @Override
-    public void actor2(State s, ByteResult1 r) {
-        r.r1 = s.x;
-    }
-
-    @Override
-    public ByteResult1 newResult() {
-        return new ByteResult1();
+    @Actor
+    public void actor2(ByteResult1 r) {
+        r.r1 = x;
     }
 
 }
--- a/tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/plain/VolatileCharAtomicityTest.java	Thu Mar 13 20:58:18 2014 +0400
+++ b/tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/plain/VolatileCharAtomicityTest.java	Thu Mar 13 22:06:22 2014 +0400
@@ -24,6 +24,9 @@
  */
 package org.openjdk.jcstress.tests.atomicity.primitives.plain;
 
+import org.openjdk.jcstress.infra.annotations.Actor;
+import org.openjdk.jcstress.infra.annotations.ConcurrencyStressTest;
+import org.openjdk.jcstress.infra.annotations.State;
 import org.openjdk.jcstress.infra.results.CharResult1;
 import org.openjdk.jcstress.tests.Actor2_Test;
 
@@ -32,30 +35,20 @@
  *
  * @author Aleksey Shipilev (aleksey.shipilev@oracle.com)
  */
-public class VolatileCharAtomicityTest implements Actor2_Test<VolatileCharAtomicityTest.State, CharResult1> {
+@ConcurrencyStressTest
+@State
+public class VolatileCharAtomicityTest {
 
-    public static class State {
-        volatile char x;
+    volatile char x;
+
+    @Actor
+    public void actor1() {
+        x = 'A';
     }
 
-    @Override
-    public State newState() {
-        return new State();
-    }
-
-    @Override
-    public void actor1(State s, CharResult1 r) {
-        s.x = 'A';
-    }
-
-    @Override
-    public void actor2(State s, CharResult1 r) {
-        r.r1 = (s.x == 0) ? 'N' : 'A';
-    }
-
-    @Override
-    public CharResult1 newResult() {
-        return new CharResult1();
+    @Actor
+    public void actor2(CharResult1 r) {
+        r.r1 = (x == 0) ? 'N' : 'A';
     }
 
 }
--- a/tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/plain/VolatileDoubleAtomicityTest.java	Thu Mar 13 20:58:18 2014 +0400
+++ b/tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/plain/VolatileDoubleAtomicityTest.java	Thu Mar 13 22:06:22 2014 +0400
@@ -24,6 +24,9 @@
  */
 package org.openjdk.jcstress.tests.atomicity.primitives.plain;
 
+import org.openjdk.jcstress.infra.annotations.Actor;
+import org.openjdk.jcstress.infra.annotations.ConcurrencyStressTest;
+import org.openjdk.jcstress.infra.annotations.State;
 import org.openjdk.jcstress.infra.results.DoubleResult1;
 import org.openjdk.jcstress.tests.Actor2_Test;
 import org.openjdk.jcstress.tests.atomicity.primitives.Constants;
@@ -33,30 +36,20 @@
  *
  * @author Aleksey Shipilev (aleksey.shipilev@oracle.com)
  */
-public class VolatileDoubleAtomicityTest implements Actor2_Test<VolatileDoubleAtomicityTest.State, DoubleResult1> {
+@ConcurrencyStressTest
+@State
+public class VolatileDoubleAtomicityTest {
 
-    public static class State {
-        volatile double x;
+    volatile double x;
+
+    @Actor
+    public void actor1() {
+        x = Constants.DOUBLE_SAMPLE;
     }
 
-    @Override
-    public State newState() {
-        return new State();
-    }
-
-    @Override
-    public void actor1(State s, DoubleResult1 r) {
-        s.x = Constants.DOUBLE_SAMPLE;
-    }
-
-    @Override
-    public void actor2(State s, DoubleResult1 r) {
-        r.r1 = s.x;
-    }
-
-    @Override
-    public DoubleResult1 newResult() {
-        return new DoubleResult1();
+    @Actor
+    public void actor2(DoubleResult1 r) {
+        r.r1 = x;
     }
 
 }
--- a/tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/plain/VolatileFloatAtomicityTest.java	Thu Mar 13 20:58:18 2014 +0400
+++ b/tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/plain/VolatileFloatAtomicityTest.java	Thu Mar 13 22:06:22 2014 +0400
@@ -24,6 +24,9 @@
  */
 package org.openjdk.jcstress.tests.atomicity.primitives.plain;
 
+import org.openjdk.jcstress.infra.annotations.Actor;
+import org.openjdk.jcstress.infra.annotations.ConcurrencyStressTest;
+import org.openjdk.jcstress.infra.annotations.State;
 import org.openjdk.jcstress.infra.results.FloatResult1;
 import org.openjdk.jcstress.tests.Actor2_Test;
 import org.openjdk.jcstress.tests.atomicity.primitives.Constants;
@@ -33,30 +36,20 @@
  *
  * @author Aleksey Shipilev (aleksey.shipilev@oracle.com)
  */
-public class VolatileFloatAtomicityTest implements Actor2_Test<VolatileFloatAtomicityTest.State, FloatResult1> {
+@ConcurrencyStressTest
+@State
+public class VolatileFloatAtomicityTest {
 
-    public static class State {
-        volatile float x;
+    volatile float x;
+
+    @Actor
+    public void actor1() {
+        x = Constants.FLOAT_SAMPLE;
     }
 
-    @Override
-    public State newState() {
-        return new State();
-    }
-
-    @Override
-    public void actor1(State s, FloatResult1 r) {
-        s.x = Constants.FLOAT_SAMPLE;
-    }
-
-    @Override
-    public void actor2(State s, FloatResult1 r) {
-        r.r1 = s.x;
-    }
-
-    @Override
-    public FloatResult1 newResult() {
-        return new FloatResult1();
+    @Actor
+    public void actor2(FloatResult1 r) {
+        r.r1 = x;
     }
 
 }
--- a/tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/plain/VolatileIntAtomicityTest.java	Thu Mar 13 20:58:18 2014 +0400
+++ b/tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/plain/VolatileIntAtomicityTest.java	Thu Mar 13 22:06:22 2014 +0400
@@ -24,6 +24,9 @@
  */
 package org.openjdk.jcstress.tests.atomicity.primitives.plain;
 
+import org.openjdk.jcstress.infra.annotations.Actor;
+import org.openjdk.jcstress.infra.annotations.ConcurrencyStressTest;
+import org.openjdk.jcstress.infra.annotations.State;
 import org.openjdk.jcstress.infra.results.IntResult1;
 import org.openjdk.jcstress.tests.Actor2_Test;
 import org.openjdk.jcstress.tests.atomicity.primitives.Constants;
@@ -33,30 +36,20 @@
  *
  * @author Aleksey Shipilev (aleksey.shipilev@oracle.com)
  */
-public class VolatileIntAtomicityTest implements Actor2_Test<VolatileIntAtomicityTest.State, IntResult1> {
+@ConcurrencyStressTest
+@State
+public class VolatileIntAtomicityTest {
 
-    public static class State {
-        volatile int x;
+    volatile int x;
+
+    @Actor
+    public void actor1() {
+        x = Constants.INT_SAMPLE;
     }
 
-    @Override
-    public State newState() {
-        return new State();
-    }
-
-    @Override
-    public void actor1(State s, IntResult1 r) {
-        s.x = Constants.INT_SAMPLE;
-    }
-
-    @Override
-    public void actor2(State s, IntResult1 r) {
-        r.r1 = s.x;
-    }
-
-    @Override
-    public IntResult1 newResult() {
-        return new IntResult1();
+    @Actor
+    public void actor2(IntResult1 r) {
+        r.r1 = x;
     }
 
 }
--- a/tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/plain/VolatileLongAtomicityTest.java	Thu Mar 13 20:58:18 2014 +0400
+++ b/tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/plain/VolatileLongAtomicityTest.java	Thu Mar 13 22:06:22 2014 +0400
@@ -24,6 +24,9 @@
  */
 package org.openjdk.jcstress.tests.atomicity.primitives.plain;
 
+import org.openjdk.jcstress.infra.annotations.Actor;
+import org.openjdk.jcstress.infra.annotations.ConcurrencyStressTest;
+import org.openjdk.jcstress.infra.annotations.State;
 import org.openjdk.jcstress.infra.results.LongResult1;
 import org.openjdk.jcstress.tests.Actor2_Test;
 import org.openjdk.jcstress.tests.atomicity.primitives.Constants;
@@ -33,30 +36,20 @@
  *
  * @author Aleksey Shipilev (aleksey.shipilev@oracle.com)
  */
-public class VolatileLongAtomicityTest implements Actor2_Test<VolatileLongAtomicityTest.State, LongResult1> {
+@ConcurrencyStressTest
+@State
+public class VolatileLongAtomicityTest {
 
-    public static class State {
-        volatile long x;
+    volatile long x;
+
+    @Actor
+    public void actor1() {
+        x = Constants.LONG_SAMPLE;
     }
 
-    @Override
-    public State newState() {
-        return new State();
-    }
-
-    @Override
-    public void actor1(State s, LongResult1 r) {
-        s.x = Constants.LONG_SAMPLE;
-    }
-
-    @Override
-    public void actor2(State s, LongResult1 r) {
-        r.r1 = s.x;
-    }
-
-    @Override
-    public LongResult1 newResult() {
-        return new LongResult1();
+    @Actor
+    public void actor2(LongResult1 r) {
+        r.r1 = x;
     }
 
 }
--- a/tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/plain/VolatileShortAtomicityTest.java	Thu Mar 13 20:58:18 2014 +0400
+++ b/tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/plain/VolatileShortAtomicityTest.java	Thu Mar 13 22:06:22 2014 +0400
@@ -24,6 +24,9 @@
  */
 package org.openjdk.jcstress.tests.atomicity.primitives.plain;
 
+import org.openjdk.jcstress.infra.annotations.Actor;
+import org.openjdk.jcstress.infra.annotations.ConcurrencyStressTest;
+import org.openjdk.jcstress.infra.annotations.State;
 import org.openjdk.jcstress.infra.results.ShortResult1;
 import org.openjdk.jcstress.tests.Actor2_Test;
 import org.openjdk.jcstress.tests.atomicity.primitives.Constants;
@@ -33,30 +36,20 @@
  *
  * @author Aleksey Shipilev (aleksey.shipilev@oracle.com)
  */
-public class VolatileShortAtomicityTest implements Actor2_Test<VolatileShortAtomicityTest.State, ShortResult1> {
+@ConcurrencyStressTest
+@State
+public class VolatileShortAtomicityTest {
 
-    public static class State {
-        volatile short x;
+    volatile short x;
+
+    @Actor
+    public void actor1() {
+        x = Constants.SHORT_SAMPLE;
     }
 
-    @Override
-    public State newState() {
-        return new State();
-    }
-
-    @Override
-    public void actor1(State s, ShortResult1 r) {
-        s.x = Constants.SHORT_SAMPLE;
-    }
-
-    @Override
-    public void actor2(State s, ShortResult1 r) {
-        r.r1 = s.x;
-    }
-
-    @Override
-    public ShortResult1 newResult() {
-        return new ShortResult1();
+    @Actor
+    public void actor2(ShortResult1 r) {
+        r.r1 = x;
     }
 
 }
--- a/tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/reflect/ByteAtomicityTest.java	Thu Mar 13 20:58:18 2014 +0400
+++ b/tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/reflect/ByteAtomicityTest.java	Thu Mar 13 22:06:22 2014 +0400
@@ -24,6 +24,9 @@
  */
 package org.openjdk.jcstress.tests.atomicity.primitives.reflect;
 
+import org.openjdk.jcstress.infra.annotations.Actor;
+import org.openjdk.jcstress.infra.annotations.ConcurrencyStressTest;
+import org.openjdk.jcstress.infra.annotations.State;
 import org.openjdk.jcstress.infra.results.ByteResult1;
 import org.openjdk.jcstress.tests.Actor2_Test;
 import org.openjdk.jcstress.tests.atomicity.primitives.Constants;
@@ -35,50 +38,40 @@
  *
  * @author Aleksey Shipilev (aleksey.shipilev@oracle.com)
  */
-public class ByteAtomicityTest implements Actor2_Test<ByteAtomicityTest.State, ByteResult1> {
+@ConcurrencyStressTest
+@State
+public class ByteAtomicityTest  {
 
-    public static class State {
-        private static Field FIELD;
+    private static Field FIELD;
 
-        static {
-            try {
-                FIELD = State.class.getDeclaredField("x");
-                FIELD.setAccessible(true);
-            } catch (NoSuchFieldException e) {
-                throw new IllegalStateException(e);
-            }
-
+    static {
+        try {
+            FIELD = ByteAtomicityTest.class.getDeclaredField("x");
+            FIELD.setAccessible(true);
+        } catch (NoSuchFieldException e) {
+            throw new IllegalStateException(e);
         }
 
-        byte x;
     }
 
-    @Override
-    public State newState() {
-        return new State();
-    }
+    byte x;
 
-    @Override
-    public void actor1(State s, ByteResult1 r) {
+    @Actor
+    public void actor1() {
         try {
-            State.FIELD.setByte(s, Constants.BYTE_SAMPLE);
+            FIELD.setByte(this, Constants.BYTE_SAMPLE);
         } catch (IllegalAccessException e) {
             throw new IllegalStateException(e);
         }
     }
 
-    @Override
-    public void actor2(State s, ByteResult1 r) {
+    @Actor
+    public void actor2(ByteResult1 r) {
         try {
-            r.r1 = State.FIELD.getByte(s);
+            r.r1 = FIELD.getByte(this);
         } catch (IllegalAccessException e) {
             throw new IllegalStateException(e);
         }
     }
 
-    @Override
-    public ByteResult1 newResult() {
-        return new ByteResult1();
-    }
-
 }
--- a/tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/reflect/CharAtomicityTest.java	Thu Mar 13 20:58:18 2014 +0400
+++ b/tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/reflect/CharAtomicityTest.java	Thu Mar 13 22:06:22 2014 +0400
@@ -24,6 +24,9 @@
  */
 package org.openjdk.jcstress.tests.atomicity.primitives.reflect;
 
+import org.openjdk.jcstress.infra.annotations.Actor;
+import org.openjdk.jcstress.infra.annotations.ConcurrencyStressTest;
+import org.openjdk.jcstress.infra.annotations.State;
 import org.openjdk.jcstress.infra.results.CharResult1;
 import org.openjdk.jcstress.tests.Actor2_Test;
 import org.openjdk.jcstress.tests.atomicity.primitives.Constants;
@@ -35,50 +38,40 @@
  *
  * @author Aleksey Shipilev (aleksey.shipilev@oracle.com)
  */
-public class CharAtomicityTest implements Actor2_Test<CharAtomicityTest.State, CharResult1> {
+@ConcurrencyStressTest
+@State
+public class CharAtomicityTest {
 
-    public static class State {
-        private static Field FIELD;
+    private static Field FIELD;
 
-        static {
-            try {
-                FIELD = State.class.getDeclaredField("x");
-                FIELD.setAccessible(true);
-            } catch (NoSuchFieldException e) {
-                throw new IllegalStateException(e);
-            }
-
+    static {
+        try {
+            FIELD = CharAtomicityTest.class.getDeclaredField("x");
+            FIELD.setAccessible(true);
+        } catch (NoSuchFieldException e) {
+            throw new IllegalStateException(e);
         }
 
-        char x;
     }
 
-    @Override
-    public State newState() {
-        return new State();
-    }
+    char x;
 
-    @Override
-    public void actor1(State s, CharResult1 r) {
+    @Actor
+    public void actor1() {
         try {
-            State.FIELD.setChar(s, Constants.CHAR_SAMPLE);
+            FIELD.setChar(this, Constants.CHAR_SAMPLE);
         } catch (IllegalAccessException e) {
             throw new IllegalStateException(e);
         }
     }
 
-    @Override
-    public void actor2(State s, CharResult1 r) {
+    @Actor
+    public void actor2(CharResult1 r) {
         try {
-            r.r1 = State.FIELD.getChar(s) == 0 ? 'N' : 'A';
+            r.r1 = FIELD.getChar(this) == 0 ? 'N' : 'A';
         } catch (IllegalAccessException e) {
             throw new IllegalStateException(e);
         }
     }
 
-    @Override
-    public CharResult1 newResult() {
-        return new CharResult1();
-    }
-
 }
--- a/tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/reflect/DoubleAtomicityTest.java	Thu Mar 13 20:58:18 2014 +0400
+++ b/tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/reflect/DoubleAtomicityTest.java	Thu Mar 13 22:06:22 2014 +0400
@@ -24,6 +24,9 @@
  */
 package org.openjdk.jcstress.tests.atomicity.primitives.reflect;
 
+import org.openjdk.jcstress.infra.annotations.Actor;
+import org.openjdk.jcstress.infra.annotations.ConcurrencyStressTest;
+import org.openjdk.jcstress.infra.annotations.State;
 import org.openjdk.jcstress.infra.results.DoubleResult1;
 import org.openjdk.jcstress.tests.Actor2_Test;
 import org.openjdk.jcstress.tests.atomicity.primitives.Constants;
@@ -35,50 +38,40 @@
  *
  * @author Aleksey Shipilev (aleksey.shipilev@oracle.com)
  */
-public class DoubleAtomicityTest implements Actor2_Test<DoubleAtomicityTest.State, DoubleResult1> {
+@ConcurrencyStressTest
+@State
+public class DoubleAtomicityTest {
 
-    public static class State {
-        private static Field FIELD;
+    private static Field FIELD;
 
-        static {
-            try {
-                FIELD = State.class.getDeclaredField("x");
-                FIELD.setAccessible(true);
-            } catch (NoSuchFieldException e) {
-                throw new IllegalStateException(e);
-            }
-
+    static {
+        try {
+            FIELD = DoubleAtomicityTest.class.getDeclaredField("x");
+            FIELD.setAccessible(true);
+        } catch (NoSuchFieldException e) {
+            throw new IllegalStateException(e);
         }
 
-        double x;
     }
 
-    @Override
-    public State newState() {
-        return new State();
-    }
+    double x;
 
-    @Override
-    public void actor1(State s, DoubleResult1 r) {
+    @Actor
+    public void actor1() {
         try {
-            State.FIELD.setDouble(s, Constants.DOUBLE_SAMPLE);
+            FIELD.setDouble(this, Constants.DOUBLE_SAMPLE);
         } catch (IllegalAccessException e) {
             throw new IllegalStateException(e);
         }
     }
 
-    @Override
-    public void actor2(State s, DoubleResult1 r) {
+    @Actor
+    public void actor2(DoubleResult1 r) {
         try {
-            r.r1 = State.FIELD.getDouble(s);
+            r.r1 = FIELD.getDouble(this);
         } catch (IllegalAccessException e) {
             throw new IllegalStateException(e);
         }
     }
 
-    @Override
-    public DoubleResult1 newResult() {
-        return new DoubleResult1();
-    }
-
 }
--- a/tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/reflect/FloatAtomicityTest.java	Thu Mar 13 20:58:18 2014 +0400
+++ b/tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/reflect/FloatAtomicityTest.java	Thu Mar 13 22:06:22 2014 +0400
@@ -24,6 +24,9 @@
  */
 package org.openjdk.jcstress.tests.atomicity.primitives.reflect;
 
+import org.openjdk.jcstress.infra.annotations.Actor;
+import org.openjdk.jcstress.infra.annotations.ConcurrencyStressTest;
+import org.openjdk.jcstress.infra.annotations.State;
 import org.openjdk.jcstress.infra.results.FloatResult1;
 import org.openjdk.jcstress.tests.Actor2_Test;
 import org.openjdk.jcstress.tests.atomicity.primitives.Constants;
@@ -33,50 +36,40 @@
 /**
  * @author Aleksey Shipilev (aleksey.shipilev@oracle.com)
  */
-public class FloatAtomicityTest implements Actor2_Test<FloatAtomicityTest.State, FloatResult1> {
+@ConcurrencyStressTest
+@State
+public class FloatAtomicityTest {
 
-    public static class State {
-        private static Field FIELD;
+    private static Field FIELD;
 
-        static {
-            try {
-                FIELD = State.class.getDeclaredField("x");
-                FIELD.setAccessible(true);
-            } catch (NoSuchFieldException e) {
-                throw new IllegalStateException(e);
-            }
-
+    static {
+        try {
+            FIELD = FloatAtomicityTest.class.getDeclaredField("x");
+            FIELD.setAccessible(true);
+        } catch (NoSuchFieldException e) {
+            throw new IllegalStateException(e);
         }
 
-        float x;
     }
 
-    @Override
-    public State newState() {
-        return new State();
-    }
+    float x;
 
-    @Override
-    public void actor1(State s, FloatResult1 r) {
+    @Actor
+    public void actor1() {
         try {
-            State.FIELD.setFloat(s, Constants.FLOAT_SAMPLE);
+            FIELD.setFloat(this, Constants.FLOAT_SAMPLE);
         } catch (IllegalAccessException e) {
             throw new IllegalStateException(e);
         }
     }
 
-    @Override
-    public void actor2(State s, FloatResult1 r) {
+    @Actor
+    public void actor2(FloatResult1 r) {
         try {
-            r.r1 = State.FIELD.getFloat(s);
+            r.r1 = FIELD.getFloat(this);
         } catch (IllegalAccessException e) {
             throw new IllegalStateException(e);
         }
     }
 
-    @Override
-    public FloatResult1 newResult() {
-        return new FloatResult1();
-    }
-
 }
--- a/tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/reflect/IntAtomicityTest.java	Thu Mar 13 20:58:18 2014 +0400
+++ b/tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/reflect/IntAtomicityTest.java	Thu Mar 13 22:06:22 2014 +0400
@@ -24,6 +24,9 @@
  */
 package org.openjdk.jcstress.tests.atomicity.primitives.reflect;
 
+import org.openjdk.jcstress.infra.annotations.Actor;
+import org.openjdk.jcstress.infra.annotations.ConcurrencyStressTest;
+import org.openjdk.jcstress.infra.annotations.State;
 import org.openjdk.jcstress.infra.results.IntResult1;
 import org.openjdk.jcstress.tests.Actor2_Test;
 import org.openjdk.jcstress.tests.atomicity.primitives.Constants;
@@ -35,50 +38,40 @@
  *
  * @author Aleksey Shipilev (aleksey.shipilev@oracle.com)
  */
-public class IntAtomicityTest implements Actor2_Test<IntAtomicityTest.State, IntResult1> {
+@ConcurrencyStressTest
+@State
+public class IntAtomicityTest {
 
-    public static class State {
-        private static Field FIELD;
+    private static Field FIELD;
 
-        static {
-            try {
-                FIELD = State.class.getDeclaredField("x");
-                FIELD.setAccessible(true);
-            } catch (NoSuchFieldException e) {
-                throw new IllegalStateException(e);
-            }
-
+    static {
+        try {
+            FIELD = IntAtomicityTest.class.getDeclaredField("x");
+            FIELD.setAccessible(true);
+        } catch (NoSuchFieldException e) {
+            throw new IllegalStateException(e);
         }
 
-        int x;
     }
 
-    @Override
-    public State newState() {
-        return new State();
-    }
+    int x;
 
-    @Override
-    public void actor1(State s, IntResult1 r) {
+    @Actor
+    public void actor1() {
         try {
-            State.FIELD.setInt(s, Constants.INT_SAMPLE);
+            FIELD.setInt(this, Constants.INT_SAMPLE);
         } catch (IllegalAccessException e) {
             throw new IllegalStateException(e);
         }
     }
 
-    @Override
-    public void actor2(State s, IntResult1 r) {
+    @Actor
+    public void actor2(IntResult1 r) {
         try {
-            r.r1 = State.FIELD.getInt(s);
+            r.r1 = FIELD.getInt(this);
         } catch (IllegalAccessException e) {
             throw new IllegalStateException(e);
         }
     }
 
-    @Override
-    public IntResult1 newResult() {
-        return new IntResult1();
-    }
-
 }
--- a/tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/reflect/LongAtomicityTest.java	Thu Mar 13 20:58:18 2014 +0400
+++ b/tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/reflect/LongAtomicityTest.java	Thu Mar 13 22:06:22 2014 +0400
@@ -24,6 +24,9 @@
  */
 package org.openjdk.jcstress.tests.atomicity.primitives.reflect;
 
+import org.openjdk.jcstress.infra.annotations.Actor;
+import org.openjdk.jcstress.infra.annotations.ConcurrencyStressTest;
+import org.openjdk.jcstress.infra.annotations.State;
 import org.openjdk.jcstress.infra.results.LongResult1;
 import org.openjdk.jcstress.tests.Actor2_Test;
 import org.openjdk.jcstress.tests.atomicity.primitives.Constants;
@@ -35,50 +38,40 @@
  *
  * @author Aleksey Shipilev (aleksey.shipilev@oracle.com)
  */
-public class LongAtomicityTest implements Actor2_Test<LongAtomicityTest.State, LongResult1> {
+@ConcurrencyStressTest
+@State
+public class LongAtomicityTest {
 
-    public static class State {
-        private static Field FIELD;
+    private static Field FIELD;
 
-        static {
-            try {
-                FIELD = State.class.getDeclaredField("x");
-                FIELD.setAccessible(true);
-            } catch (NoSuchFieldException e) {
-                throw new IllegalStateException(e);
-            }
-
+    static {
+        try {
+            FIELD = LongAtomicityTest.class.getDeclaredField("x");
+            FIELD.setAccessible(true);
+        } catch (NoSuchFieldException e) {
+            throw new IllegalStateException(e);
         }
 
-        long x;
     }
 
-    @Override
-    public State newState() {
-        return new State();
-    }
+    long x;
 
-    @Override
-    public void actor1(State s, LongResult1 r) {
+    @Actor
+    public void actor1() {
         try {
-            State.FIELD.setLong(s, Constants.LONG_SAMPLE);
+            FIELD.setLong(this, Constants.LONG_SAMPLE);
         } catch (IllegalAccessException e) {
             throw new IllegalStateException(e);
         }
     }
 
-    @Override
-    public void actor2(State s, LongResult1 r) {
+    @Actor
+    public void actor2(LongResult1 r) {
         try {
-            r.r1 = State.FIELD.getLong(s);
+            r.r1 = FIELD.getLong(this);
         } catch (IllegalAccessException e) {
             throw new IllegalStateException(e);
         }
     }
 
-    @Override
-    public LongResult1 newResult() {
-        return new LongResult1();
-    }
-
 }
--- a/tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/reflect/ShortAtomicityTest.java	Thu Mar 13 20:58:18 2014 +0400
+++ b/tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/reflect/ShortAtomicityTest.java	Thu Mar 13 22:06:22 2014 +0400
@@ -24,6 +24,9 @@
  */
 package org.openjdk.jcstress.tests.atomicity.primitives.reflect;
 
+import org.openjdk.jcstress.infra.annotations.Actor;
+import org.openjdk.jcstress.infra.annotations.ConcurrencyStressTest;
+import org.openjdk.jcstress.infra.annotations.State;
 import org.openjdk.jcstress.infra.results.ShortResult1;
 import org.openjdk.jcstress.tests.Actor2_Test;
 import org.openjdk.jcstress.tests.atomicity.primitives.Constants;
@@ -35,50 +38,40 @@
  *
  * @author Aleksey Shipilev (aleksey.shipilev@oracle.com)
  */
-public class ShortAtomicityTest implements Actor2_Test<ShortAtomicityTest.State, ShortResult1> {
+@ConcurrencyStressTest
+@State
+public class ShortAtomicityTest {
 
-    public static class State {
-        private static Field FIELD;
+    private static Field FIELD;
 
-        static {
-            try {
-                FIELD = State.class.getDeclaredField("x");
-                FIELD.setAccessible(true);
-            } catch (NoSuchFieldException e) {
-                throw new IllegalStateException(e);
-            }
-
+    static {
+        try {
+            FIELD = ShortAtomicityTest.class.getDeclaredField("x");
+            FIELD.setAccessible(true);
+        } catch (NoSuchFieldException e) {
+            throw new IllegalStateException(e);
         }
 
-        short x;
     }
 
-    @Override
-    public State newState() {
-        return new State();
-    }
+    short x;
 
-    @Override
-    public void actor1(State s, ShortResult1 r) {
+    @Actor
+    public void actor1() {
         try {
-            State.FIELD.setShort(s, Constants.SHORT_SAMPLE);
+            FIELD.setShort(this, Constants.SHORT_SAMPLE);
         } catch (IllegalAccessException e) {
             throw new IllegalStateException(e);
         }
     }
 
-    @Override
-    public void actor2(State s, ShortResult1 r) {
+    @Actor
+    public void actor2(ShortResult1 r) {
         try {
-            r.r1 = State.FIELD.getShort(s);
+            r.r1 = FIELD.getShort(this);
         } catch (IllegalAccessException e) {
             throw new IllegalStateException(e);
         }
     }
 
-    @Override
-    public ShortResult1 newResult() {
-        return new ShortResult1();
-    }
-
 }
--- a/tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/reflect/VolatileByteAtomicityTest.java	Thu Mar 13 20:58:18 2014 +0400
+++ b/tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/reflect/VolatileByteAtomicityTest.java	Thu Mar 13 22:06:22 2014 +0400
@@ -24,6 +24,9 @@
  */
 package org.openjdk.jcstress.tests.atomicity.primitives.reflect;
 
+import org.openjdk.jcstress.infra.annotations.Actor;
+import org.openjdk.jcstress.infra.annotations.ConcurrencyStressTest;
+import org.openjdk.jcstress.infra.annotations.State;
 import org.openjdk.jcstress.infra.results.ByteResult1;
 import org.openjdk.jcstress.tests.Actor2_Test;
 import org.openjdk.jcstress.tests.atomicity.primitives.Constants;
@@ -35,50 +38,40 @@
  *
  * @author Aleksey Shipilev (aleksey.shipilev@oracle.com)
  */
-public class VolatileByteAtomicityTest implements Actor2_Test<VolatileByteAtomicityTest.State, ByteResult1> {
+@ConcurrencyStressTest
+@State
+public class VolatileByteAtomicityTest {
 
-    public static class State {
-        private static Field FIELD;
+    private static Field FIELD;
 
-        static {
-            try {
-                FIELD = State.class.getDeclaredField("x");
-                FIELD.setAccessible(true);
-            } catch (NoSuchFieldException e) {
-                throw new IllegalStateException(e);
-            }
-
+    static {
+        try {
+            FIELD = VolatileByteAtomicityTest.class.getDeclaredField("x");
+            FIELD.setAccessible(true);
+        } catch (NoSuchFieldException e) {
+            throw new IllegalStateException(e);
         }
 
-        volatile byte x;
     }
 
-    @Override
-    public State newState() {
-        return new State();
-    }
+    volatile byte x;
 
-    @Override
-    public void actor1(State s, ByteResult1 r) {
+    @Actor
+    public void actor1() {
         try {
-            State.FIELD.setByte(s, Constants.BYTE_SAMPLE);
+            FIELD.setByte(this, Constants.BYTE_SAMPLE);
         } catch (IllegalAccessException e) {
             throw new IllegalStateException(e);
         }
     }
 
-    @Override
-    public void actor2(State s, ByteResult1 r) {
+    @Actor
+    public void actor2(ByteResult1 r) {
         try {
-            r.r1 = State.FIELD.getByte(s);
+            r.r1 = FIELD.getByte(this);
         } catch (IllegalAccessException e) {
             throw new IllegalStateException(e);
         }
     }
 
-    @Override
-    public ByteResult1 newResult() {
-        return new ByteResult1();
-    }
-
 }
--- a/tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/reflect/VolatileCharAtomicityTest.java	Thu Mar 13 20:58:18 2014 +0400
+++ b/tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/reflect/VolatileCharAtomicityTest.java	Thu Mar 13 22:06:22 2014 +0400
@@ -24,6 +24,9 @@
  */
 package org.openjdk.jcstress.tests.atomicity.primitives.reflect;
 
+import org.openjdk.jcstress.infra.annotations.Actor;
+import org.openjdk.jcstress.infra.annotations.ConcurrencyStressTest;
+import org.openjdk.jcstress.infra.annotations.State;
 import org.openjdk.jcstress.infra.results.CharResult1;
 import org.openjdk.jcstress.tests.Actor2_Test;
 import org.openjdk.jcstress.tests.atomicity.primitives.Constants;
@@ -35,50 +38,40 @@
  *
  * @author Aleksey Shipilev (aleksey.shipilev@oracle.com)
  */
-public class VolatileCharAtomicityTest implements Actor2_Test<VolatileCharAtomicityTest.State, CharResult1> {
+@ConcurrencyStressTest
+@State
+public class VolatileCharAtomicityTest {
 
-    public static class State {
-        private static Field FIELD;
+    private static Field FIELD;
 
-        static {
-            try {
-                FIELD = State.class.getDeclaredField("x");
-                FIELD.setAccessible(true);
-            } catch (NoSuchFieldException e) {
-                throw new IllegalStateException(e);
-            }
-
+    static {
+        try {
+            FIELD = VolatileCharAtomicityTest.class.getDeclaredField("x");
+            FIELD.setAccessible(true);
+        } catch (NoSuchFieldException e) {
+            throw new IllegalStateException(e);
         }
 
-        volatile char x;
     }
 
-    @Override
-    public State newState() {
-        return new State();
-    }
+    volatile char x;
 
-    @Override
-    public void actor1(State s, CharResult1 r) {
+    @Actor
+    public void actor1() {
         try {
-            State.FIELD.setChar(s, Constants.CHAR_SAMPLE);
+            FIELD.setChar(this, Constants.CHAR_SAMPLE);
         } catch (IllegalAccessException e) {
             throw new IllegalStateException(e);
         }
     }
 
-    @Override
-    public void actor2(State s, CharResult1 r) {
+    @Actor
+    public void actor2(CharResult1 r) {
         try {
-            r.r1 = State.FIELD.getChar(s) == 0 ? 'N' : 'A';
+            r.r1 = FIELD.getChar(this) == 0 ? 'N' : 'A';
         } catch (IllegalAccessException e) {
             throw new IllegalStateException(e);
         }
     }
 
-    @Override
-    public CharResult1 newResult() {
-        return new CharResult1();
-    }
-
 }
--- a/tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/reflect/VolatileDoubleAtomicityTest.java	Thu Mar 13 20:58:18 2014 +0400
+++ b/tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/reflect/VolatileDoubleAtomicityTest.java	Thu Mar 13 22:06:22 2014 +0400
@@ -24,6 +24,9 @@
  */
 package org.openjdk.jcstress.tests.atomicity.primitives.reflect;
 
+import org.openjdk.jcstress.infra.annotations.Actor;
+import org.openjdk.jcstress.infra.annotations.ConcurrencyStressTest;
+import org.openjdk.jcstress.infra.annotations.State;
 import org.openjdk.jcstress.infra.results.DoubleResult1;
 import org.openjdk.jcstress.tests.Actor2_Test;
 import org.openjdk.jcstress.tests.atomicity.primitives.Constants;
@@ -35,50 +38,40 @@
  *
  * @author Aleksey Shipilev (aleksey.shipilev@oracle.com)
  */
-public class VolatileDoubleAtomicityTest implements Actor2_Test<VolatileDoubleAtomicityTest.State, DoubleResult1> {
+@ConcurrencyStressTest
+@State
+public class VolatileDoubleAtomicityTest {
 
-    public static class State {
-        private static Field FIELD;
+    private static Field FIELD;
 
-        static {
-            try {
-                FIELD = State.class.getDeclaredField("x");
-                FIELD.setAccessible(true);
-            } catch (NoSuchFieldException e) {
-                throw new IllegalStateException(e);
-            }
-
+    static {
+        try {
+            FIELD = VolatileDoubleAtomicityTest.class.getDeclaredField("x");
+            FIELD.setAccessible(true);
+        } catch (NoSuchFieldException e) {
+            throw new IllegalStateException(e);
         }
 
-        volatile double x;
     }
 
-    @Override
-    public State newState() {
-        return new State();
-    }
+    volatile double x;
 
-    @Override
-    public void actor1(State s, DoubleResult1 r) {
+    @Actor
+    public void actor1() {
         try {
-            State.FIELD.setDouble(s, Constants.DOUBLE_SAMPLE);
+            FIELD.setDouble(this, Constants.DOUBLE_SAMPLE);
         } catch (IllegalAccessException e) {
             throw new IllegalStateException(e);
         }
     }
 
-    @Override
-    public void actor2(State s, DoubleResult1 r) {
+    @Actor
+    public void actor2(DoubleResult1 r) {
         try {
-            r.r1 = State.FIELD.getDouble(s);
+            r.r1 = FIELD.getDouble(this);
         } catch (IllegalAccessException e) {
             throw new IllegalStateException(e);
         }
     }
 
-    @Override
-    public DoubleResult1 newResult() {
-        return new DoubleResult1();
-    }
-
 }
--- a/tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/reflect/VolatileFloatAtomicityTest.java	Thu Mar 13 20:58:18 2014 +0400
+++ b/tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/reflect/VolatileFloatAtomicityTest.java	Thu Mar 13 22:06:22 2014 +0400
@@ -24,6 +24,9 @@
  */
 package org.openjdk.jcstress.tests.atomicity.primitives.reflect;
 
+import org.openjdk.jcstress.infra.annotations.Actor;
+import org.openjdk.jcstress.infra.annotations.ConcurrencyStressTest;
+import org.openjdk.jcstress.infra.annotations.State;
 import org.openjdk.jcstress.infra.results.FloatResult1;
 import org.openjdk.jcstress.tests.Actor2_Test;
 import org.openjdk.jcstress.tests.atomicity.primitives.Constants;
@@ -33,50 +36,40 @@
 /**
  * @author Aleksey Shipilev (aleksey.shipilev@oracle.com)
  */
-public class VolatileFloatAtomicityTest implements Actor2_Test<VolatileFloatAtomicityTest.State, FloatResult1> {
+@ConcurrencyStressTest
+@State
+public class VolatileFloatAtomicityTest {
 
-    public static class State {
-        private static Field FIELD;
+    private static Field FIELD;
 
-        static {
-            try {
-                FIELD = State.class.getDeclaredField("x");
-                FIELD.setAccessible(true);
-            } catch (NoSuchFieldException e) {
-                throw new IllegalStateException(e);
-            }
-
+    static {
+        try {
+            FIELD = VolatileFloatAtomicityTest.class.getDeclaredField("x");
+            FIELD.setAccessible(true);
+        } catch (NoSuchFieldException e) {
+            throw new IllegalStateException(e);
         }
 
-        volatile float x;
     }
 
-    @Override
-    public State newState() {
-        return new State();
-    }
+    volatile float x;
 
-    @Override
-    public void actor1(State s, FloatResult1 r) {
+    @Actor
+    public void actor1() {
         try {
-            State.FIELD.setFloat(s, Constants.FLOAT_SAMPLE);
+            FIELD.setFloat(this, Constants.FLOAT_SAMPLE);
         } catch (IllegalAccessException e) {
             throw new IllegalStateException(e);
         }
     }
 
-    @Override
-    public void actor2(State s, FloatResult1 r) {
+    @Actor
+    public void actor2(FloatResult1 r) {
         try {
-            r.r1 = State.FIELD.getFloat(s);
+            r.r1 = FIELD.getFloat(this);
         } catch (IllegalAccessException e) {
             throw new IllegalStateException(e);
         }
     }
 
-    @Override
-    public FloatResult1 newResult() {
-        return new FloatResult1();
-    }
-
 }
--- a/tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/reflect/VolatileIntAtomicityTest.java	Thu Mar 13 20:58:18 2014 +0400
+++ b/tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/reflect/VolatileIntAtomicityTest.java	Thu Mar 13 22:06:22 2014 +0400
@@ -24,6 +24,9 @@
  */
 package org.openjdk.jcstress.tests.atomicity.primitives.reflect;
 
+import org.openjdk.jcstress.infra.annotations.Actor;
+import org.openjdk.jcstress.infra.annotations.ConcurrencyStressTest;
+import org.openjdk.jcstress.infra.annotations.State;
 import org.openjdk.jcstress.infra.results.IntResult1;
 import org.openjdk.jcstress.tests.Actor2_Test;
 import org.openjdk.jcstress.tests.atomicity.primitives.Constants;
@@ -35,50 +38,40 @@
  *
  * @author Aleksey Shipilev (aleksey.shipilev@oracle.com)
  */
-public class VolatileIntAtomicityTest implements Actor2_Test<VolatileIntAtomicityTest.State, IntResult1> {
+@ConcurrencyStressTest
+@State
+public class VolatileIntAtomicityTest {
 
-    public static class State {
-        private static Field FIELD;
+    private static Field FIELD;
 
-        static {
-            try {
-                FIELD = State.class.getDeclaredField("x");
-                FIELD.setAccessible(true);
-            } catch (NoSuchFieldException e) {
-                throw new IllegalStateException(e);
-            }
-
+    static {
+        try {
+            FIELD = VolatileIntAtomicityTest.class.getDeclaredField("x");
+            FIELD.setAccessible(true);
+        } catch (NoSuchFieldException e) {
+            throw new IllegalStateException(e);
         }
 
-        volatile int x;
     }
 
-    @Override
-    public State newState() {
-        return new State();
-    }
+    volatile int x;
 
-    @Override
-    public void actor1(State s, IntResult1 r) {
+    @Actor
+    public void actor1() {
         try {
-            State.FIELD.setInt(s, Constants.INT_SAMPLE);
+            FIELD.setInt(this, Constants.INT_SAMPLE);
         } catch (IllegalAccessException e) {
             throw new IllegalStateException(e);
         }
     }
 
-    @Override
-    public void actor2(State s, IntResult1 r) {
+    @Actor
+    public void actor2(IntResult1 r) {
         try {
-            r.r1 = State.FIELD.getInt(s);
+            r.r1 = FIELD.getInt(this);
         } catch (IllegalAccessException e) {
             throw new IllegalStateException(e);
         }
     }
 
-    @Override
-    public IntResult1 newResult() {
-        return new IntResult1();
-    }
-
 }
--- a/tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/reflect/VolatileLongAtomicityTest.java	Thu Mar 13 20:58:18 2014 +0400
+++ b/tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/reflect/VolatileLongAtomicityTest.java	Thu Mar 13 22:06:22 2014 +0400
@@ -24,6 +24,9 @@
  */
 package org.openjdk.jcstress.tests.atomicity.primitives.reflect;
 
+import org.openjdk.jcstress.infra.annotations.Actor;
+import org.openjdk.jcstress.infra.annotations.ConcurrencyStressTest;
+import org.openjdk.jcstress.infra.annotations.State;
 import org.openjdk.jcstress.infra.results.LongResult1;
 import org.openjdk.jcstress.tests.Actor2_Test;
 import org.openjdk.jcstress.tests.atomicity.primitives.Constants;
@@ -35,50 +38,40 @@
  *
  * @author Aleksey Shipilev (aleksey.shipilev@oracle.com)
  */
-public class VolatileLongAtomicityTest implements Actor2_Test<VolatileLongAtomicityTest.State, LongResult1> {
+@ConcurrencyStressTest
+@State
+public class VolatileLongAtomicityTest {
 
-    public static class State {
-        private static Field FIELD;
+    private static Field FIELD;
 
-        static {
-            try {
-                FIELD = State.class.getDeclaredField("x");
-                FIELD.setAccessible(true);
-            } catch (NoSuchFieldException e) {
-                throw new IllegalStateException(e);
-            }
-
+    static {
+        try {
+            FIELD = VolatileLongAtomicityTest.class.getDeclaredField("x");
+            FIELD.setAccessible(true);
+        } catch (NoSuchFieldException e) {
+            throw new IllegalStateException(e);
         }
 
-        volatile long x;
     }
 
-    @Override
-    public State newState() {
-        return new State();
-    }
+    volatile long x;
 
-    @Override
-    public void actor1(State s, LongResult1 r) {
+    @Actor
+    public void actor1() {
         try {
-            State.FIELD.setLong(s, Constants.LONG_SAMPLE);
+            FIELD.setLong(this, Constants.LONG_SAMPLE);
         } catch (IllegalAccessException e) {
             throw new IllegalStateException(e);
         }
     }
 
-    @Override
-    public void actor2(State s, LongResult1 r) {
+    @Actor
+    public void actor2(LongResult1 r) {
         try {
-            r.r1 = State.FIELD.getLong(s);
+            r.r1 = FIELD.getLong(this);
         } catch (IllegalAccessException e) {
             throw new IllegalStateException(e);
         }
     }
 
-    @Override
-    public LongResult1 newResult() {
-        return new LongResult1();
-    }
-
 }
--- a/tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/reflect/VolatileShortAtomicityTest.java	Thu Mar 13 20:58:18 2014 +0400
+++ b/tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/reflect/VolatileShortAtomicityTest.java	Thu Mar 13 22:06:22 2014 +0400
@@ -24,6 +24,9 @@
  */
 package org.openjdk.jcstress.tests.atomicity.primitives.reflect;
 
+import org.openjdk.jcstress.infra.annotations.Actor;
+import org.openjdk.jcstress.infra.annotations.ConcurrencyStressTest;
+import org.openjdk.jcstress.infra.annotations.State;
 import org.openjdk.jcstress.infra.results.ShortResult1;
 import org.openjdk.jcstress.tests.Actor2_Test;
 import org.openjdk.jcstress.tests.atomicity.primitives.Constants;
@@ -35,50 +38,40 @@
  *
  * @author Aleksey Shipilev (aleksey.shipilev@oracle.com)
  */
-public class VolatileShortAtomicityTest implements Actor2_Test<VolatileShortAtomicityTest.State, ShortResult1> {
+@ConcurrencyStressTest
+@State
+public class VolatileShortAtomicityTest {
 
-    public static class State {
-        private static Field FIELD;
+    private static Field FIELD;
 
-        static {
-            try {
-                FIELD = State.class.getDeclaredField("x");
-                FIELD.setAccessible(true);
-            } catch (NoSuchFieldException e) {
-                throw new IllegalStateException(e);
-            }
-
+    static {
+        try {
+            FIELD = VolatileShortAtomicityTest.class.getDeclaredField("x");
+            FIELD.setAccessible(true);
+        } catch (NoSuchFieldException e) {
+            throw new IllegalStateException(e);
         }
 
-        volatile short x;
     }
 
-    @Override
-    public State newState() {
-        return new State();
-    }
+    volatile short x;
 
-    @Override
-    public void actor1(State s, ShortResult1 r) {
+    @Actor
+    public void actor1() {
         try {
-            State.FIELD.setShort(s, Constants.SHORT_SAMPLE);
+            FIELD.setShort(this, Constants.SHORT_SAMPLE);
         } catch (IllegalAccessException e) {
             throw new IllegalStateException(e);
         }
     }
 
-    @Override
-    public void actor2(State s, ShortResult1 r) {
+    @Actor
+    public void actor2(ShortResult1 r) {
         try {
-            r.r1 = State.FIELD.getShort(s);
+            r.r1 = FIELD.getShort(this);
         } catch (IllegalAccessException e) {
             throw new IllegalStateException(e);
         }
     }
 
-    @Override
-    public ShortResult1 newResult() {
-        return new ShortResult1();
-    }
-
 }