changeset 87:78069b93a3e4

Yak shaving: Runner.testName should be common.
author shade
date Thu, 13 Mar 2014 00:58:52 +0400
parents b830f2a55505
children 899fa0979e1d
files jcstress-core/src/main/java/org/openjdk/jcstress/infra/runners/Actor1_Runner.java jcstress-core/src/main/java/org/openjdk/jcstress/infra/runners/Actor2_Arbiter1_Runner.java jcstress-core/src/main/java/org/openjdk/jcstress/infra/runners/Actor2_Runner.java jcstress-core/src/main/java/org/openjdk/jcstress/infra/runners/Actor3_Runner.java jcstress-core/src/main/java/org/openjdk/jcstress/infra/runners/Actor4_Runner.java jcstress-core/src/main/java/org/openjdk/jcstress/infra/runners/Runner.java jcstress-core/src/main/java/org/openjdk/jcstress/infra/runners/TerminationRunner.java
diffstat 7 files changed, 6 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/jcstress-core/src/main/java/org/openjdk/jcstress/infra/runners/Actor1_Runner.java	Thu Mar 13 00:53:26 2014 +0400
+++ b/jcstress-core/src/main/java/org/openjdk/jcstress/infra/runners/Actor1_Runner.java	Thu Mar 13 00:58:52 2014 +0400
@@ -48,12 +48,10 @@
  */
 public class Actor1_Runner<S, R extends Result> extends Runner<R> {
     private final Actor1_Test<S, R> test;
-    private final String testName;
 
     public Actor1_Runner(Options opts, Actor1_Test<S, R> test, TestResultCollector collector, ExecutorService pool) throws FileNotFoundException, JAXBException {
         super(opts, collector, pool, test.getClass().getName());
         this.test = test;
-        this.testName = test.getClass().getName();
     }
 
     @Override
@@ -114,7 +112,7 @@
 
         control.isStopped = true;
 
-        waitFor(testName, tasks);
+        waitFor(tasks);
 
         return counter;
     }
--- a/jcstress-core/src/main/java/org/openjdk/jcstress/infra/runners/Actor2_Arbiter1_Runner.java	Thu Mar 13 00:53:26 2014 +0400
+++ b/jcstress-core/src/main/java/org/openjdk/jcstress/infra/runners/Actor2_Arbiter1_Runner.java	Thu Mar 13 00:58:52 2014 +0400
@@ -48,12 +48,10 @@
  */
 public class Actor2_Arbiter1_Runner<S, R extends Result> extends Runner<R> {
     private final Actor2_Arbiter1_Test<S, R> test;
-    private final String testName;
 
     public Actor2_Arbiter1_Runner(Options opts, Actor2_Arbiter1_Test<S, R> test, TestResultCollector collector, ExecutorService pool) throws FileNotFoundException, JAXBException {
         super(opts, collector, pool, test.getClass().getName());
         this.test = test;
-        this.testName = test.getClass().getName();
     }
 
     @Override
@@ -136,7 +134,7 @@
 
         control.isStopped = true;
 
-        waitFor(testName, tasks);
+        waitFor(tasks);
 
         return counter;
     }
--- a/jcstress-core/src/main/java/org/openjdk/jcstress/infra/runners/Actor2_Runner.java	Thu Mar 13 00:53:26 2014 +0400
+++ b/jcstress-core/src/main/java/org/openjdk/jcstress/infra/runners/Actor2_Runner.java	Thu Mar 13 00:58:52 2014 +0400
@@ -48,12 +48,10 @@
  */
 public class Actor2_Runner<S, R extends Result> extends Runner<R> {
     final Actor2_Test<S, R> test;
-    final String testName;
 
     public Actor2_Runner(Options opts, Actor2_Test<S, R> test, TestResultCollector collector, ExecutorService pool) throws FileNotFoundException, JAXBException {
         super(opts, collector, pool, test.getClass().getName());
         this.test = test;
-        this.testName = test.getClass().getName();
     }
 
     @Override
@@ -126,7 +124,7 @@
 
         control.isStopped = true;
 
-        waitFor(testName, tasks);
+        waitFor(tasks);
 
         return counter;
     }
--- a/jcstress-core/src/main/java/org/openjdk/jcstress/infra/runners/Actor3_Runner.java	Thu Mar 13 00:53:26 2014 +0400
+++ b/jcstress-core/src/main/java/org/openjdk/jcstress/infra/runners/Actor3_Runner.java	Thu Mar 13 00:58:52 2014 +0400
@@ -48,12 +48,10 @@
  */
 public class Actor3_Runner<S, R extends Result> extends Runner<R> {
     final Actor3_Test<S, R> test;
-    final String testName;
 
     public Actor3_Runner(Options opts, Actor3_Test<S, R> test, TestResultCollector collector, ExecutorService pool) throws FileNotFoundException, JAXBException {
         super(opts, collector, pool, test.getClass().getName());
         this.test = test;
-        this.testName = test.getClass().getName();
     }
 
     @Override
@@ -137,7 +135,7 @@
 
         control.isStopped = true;
 
-        waitFor(testName, tasks);
+        waitFor(tasks);
 
         return counter;
     }
--- a/jcstress-core/src/main/java/org/openjdk/jcstress/infra/runners/Actor4_Runner.java	Thu Mar 13 00:53:26 2014 +0400
+++ b/jcstress-core/src/main/java/org/openjdk/jcstress/infra/runners/Actor4_Runner.java	Thu Mar 13 00:58:52 2014 +0400
@@ -48,12 +48,10 @@
  */
 public class Actor4_Runner<S, R extends Result> extends Runner<R> {
     final Actor4_Test<S, R> test;
-    final String testName;
 
     public Actor4_Runner(Options opts, Actor4_Test<S, R> test, TestResultCollector collector, ExecutorService pool) throws FileNotFoundException, JAXBException {
         super(opts, collector, pool, test.getClass().getName());
         this.test = test;
-        this.testName = test.getClass().getName();
     }
 
     @Override
@@ -148,7 +146,7 @@
 
         control.isStopped = true;
 
-        waitFor(testName, tasks);
+        waitFor(tasks);
 
         return counter;
     }
--- a/jcstress-core/src/main/java/org/openjdk/jcstress/infra/runners/Runner.java	Thu Mar 13 00:53:26 2014 +0400
+++ b/jcstress-core/src/main/java/org/openjdk/jcstress/infra/runners/Runner.java	Thu Mar 13 00:58:52 2014 +0400
@@ -151,7 +151,7 @@
 
     public abstract int requiredThreads();
 
-    protected void waitFor(String testName, Collection<Future<?>> tasks) {
+    protected void waitFor(Collection<Future<?>> tasks) {
         long startTime = System.nanoTime();
         boolean allStopped = false;
         while (!allStopped) {
--- a/jcstress-core/src/main/java/org/openjdk/jcstress/infra/runners/TerminationRunner.java	Thu Mar 13 00:53:26 2014 +0400
+++ b/jcstress-core/src/main/java/org/openjdk/jcstress/infra/runners/TerminationRunner.java	Thu Mar 13 00:58:52 2014 +0400
@@ -42,12 +42,10 @@
  */
 public class TerminationRunner<S> extends Runner<TerminationRunner.OutcomeResult> {
     final TerminationTest<S> test;
-    final String testName;
 
     public TerminationRunner(Options opts,  TerminationTest<S> test, TestResultCollector collector, ExecutorService pool) throws FileNotFoundException, JAXBException {
         super(opts, collector, pool, test.getClass().getName());
         this.test = test;
-        this.testName = test.getClass().getName();
     }
 
     /**