changeset 56:a36185bcdf0d

Making more tests reliable.
author shade
date Fri, 31 May 2013 14:47:26 +0400
parents 69f352a75dcf
children b299e21b3ae3
files jmh-core-it/src/test/java/org/openjdk/jmh/it/intraorder/BenchmarkBenchSetupOrderTest.java jmh-core-it/src/test/java/org/openjdk/jmh/it/intraorder/BenchmarkBenchTearDownOrderTest.java jmh-core-it/src/test/java/org/openjdk/jmh/it/intraorder/BenchmarkStateSetupOrderTest.java jmh-core-it/src/test/java/org/openjdk/jmh/it/intraorder/BenchmarkStateTearDownOrderTest.java jmh-core-it/src/test/java/org/openjdk/jmh/it/intraorder/GroupBenchSetupOrderTest.java jmh-core-it/src/test/java/org/openjdk/jmh/it/intraorder/GroupBenchTearDownOrderTest.java jmh-core-it/src/test/java/org/openjdk/jmh/it/intraorder/GroupStateSetupOrderTest.java jmh-core-it/src/test/java/org/openjdk/jmh/it/intraorder/GroupStateTearDownOrderTest.java jmh-core-it/src/test/java/org/openjdk/jmh/it/intraorder/ThreadBenchSetupOrderTest.java jmh-core-it/src/test/java/org/openjdk/jmh/it/intraorder/ThreadBenchTearDownOrderTest.java jmh-core-it/src/test/java/org/openjdk/jmh/it/intraorder/ThreadStateSetupOrderTest.java jmh-core-it/src/test/java/org/openjdk/jmh/it/intraorder/ThreadStateTearDownOrderTest.java jmh-core-it/src/test/java/org/openjdk/jmh/it/races/RaceGroupStateIterationTest.java
diffstat 13 files changed, 14 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/jmh-core-it/src/test/java/org/openjdk/jmh/it/intraorder/BenchmarkBenchSetupOrderTest.java	Thu May 30 15:49:02 2013 +0400
+++ b/jmh-core-it/src/test/java/org/openjdk/jmh/it/intraorder/BenchmarkBenchSetupOrderTest.java	Fri May 31 14:47:26 2013 +0400
@@ -41,7 +41,7 @@
 @State(Scope.Benchmark)
 public class BenchmarkBenchSetupOrderTest {
 
-    private static final AtomicInteger seq = new AtomicInteger();
+    private final AtomicInteger seq = new AtomicInteger();
     private int run1, run2, run3, runD;
     private int iter1, iter2, iter3, iterD;
     private int invoc1, invoc2, invoc3, invocD;
--- a/jmh-core-it/src/test/java/org/openjdk/jmh/it/intraorder/BenchmarkBenchTearDownOrderTest.java	Thu May 30 15:49:02 2013 +0400
+++ b/jmh-core-it/src/test/java/org/openjdk/jmh/it/intraorder/BenchmarkBenchTearDownOrderTest.java	Fri May 31 14:47:26 2013 +0400
@@ -49,7 +49,7 @@
 @State(Scope.Benchmark)
 public class BenchmarkBenchTearDownOrderTest {
 
-    private static final AtomicInteger seq = new AtomicInteger();
+    private final AtomicInteger seq = new AtomicInteger();
     private int run1, run2, run3, runD;
     private int iter1, iter2, iter3, iterD;
     private int invoc1, invoc2, invoc3, invocD;
--- a/jmh-core-it/src/test/java/org/openjdk/jmh/it/intraorder/BenchmarkStateSetupOrderTest.java	Thu May 30 15:49:02 2013 +0400
+++ b/jmh-core-it/src/test/java/org/openjdk/jmh/it/intraorder/BenchmarkStateSetupOrderTest.java	Fri May 31 14:47:26 2013 +0400
@@ -51,7 +51,7 @@
     @State(Scope.Benchmark)
     public static class MyState {
 
-        private static final AtomicInteger seq = new AtomicInteger();
+        private final AtomicInteger seq = new AtomicInteger();
         private int run1, run2, run3, runD;
         private int iter1, iter2, iter3, iterD;
         private int invoc1, invoc2, invoc3, invocD;
--- a/jmh-core-it/src/test/java/org/openjdk/jmh/it/intraorder/BenchmarkStateTearDownOrderTest.java	Thu May 30 15:49:02 2013 +0400
+++ b/jmh-core-it/src/test/java/org/openjdk/jmh/it/intraorder/BenchmarkStateTearDownOrderTest.java	Fri May 31 14:47:26 2013 +0400
@@ -50,7 +50,7 @@
     @State(Scope.Benchmark)
     public static class MyState {
 
-        private static final AtomicInteger seq = new AtomicInteger();
+        private final AtomicInteger seq = new AtomicInteger();
         private int run1, run2, run3, runD;
         private int iter1, iter2, iter3, iterD;
         private int invoc1, invoc2, invoc3, invocD;
--- a/jmh-core-it/src/test/java/org/openjdk/jmh/it/intraorder/GroupBenchSetupOrderTest.java	Thu May 30 15:49:02 2013 +0400
+++ b/jmh-core-it/src/test/java/org/openjdk/jmh/it/intraorder/GroupBenchSetupOrderTest.java	Fri May 31 14:47:26 2013 +0400
@@ -41,7 +41,7 @@
 @State(Scope.Group)
 public class GroupBenchSetupOrderTest {
 
-    private static final AtomicInteger seq = new AtomicInteger();
+    private final AtomicInteger seq = new AtomicInteger();
     private int run1, run2, run3, runD;
     private int iter1, iter2, iter3, iterD;
     private int invoc1, invoc2, invoc3, invocD;
--- a/jmh-core-it/src/test/java/org/openjdk/jmh/it/intraorder/GroupBenchTearDownOrderTest.java	Thu May 30 15:49:02 2013 +0400
+++ b/jmh-core-it/src/test/java/org/openjdk/jmh/it/intraorder/GroupBenchTearDownOrderTest.java	Fri May 31 14:47:26 2013 +0400
@@ -49,7 +49,7 @@
 @State(Scope.Group)
 public class GroupBenchTearDownOrderTest {
 
-    private static final AtomicInteger seq = new AtomicInteger();
+    private final AtomicInteger seq = new AtomicInteger();
     private int run1, run2, run3, runD;
     private int iter1, iter2, iter3, iterD;
     private int invoc1, invoc2, invoc3, invocD;
--- a/jmh-core-it/src/test/java/org/openjdk/jmh/it/intraorder/GroupStateSetupOrderTest.java	Thu May 30 15:49:02 2013 +0400
+++ b/jmh-core-it/src/test/java/org/openjdk/jmh/it/intraorder/GroupStateSetupOrderTest.java	Fri May 31 14:47:26 2013 +0400
@@ -51,7 +51,7 @@
     @State(Scope.Group)
     public static class MyState {
 
-        private static final AtomicInteger seq = new AtomicInteger();
+        private final AtomicInteger seq = new AtomicInteger();
         private int run1, run2, run3, runD;
         private int iter1, iter2, iter3, iterD;
         private int invoc1, invoc2, invoc3, invocD;
--- a/jmh-core-it/src/test/java/org/openjdk/jmh/it/intraorder/GroupStateTearDownOrderTest.java	Thu May 30 15:49:02 2013 +0400
+++ b/jmh-core-it/src/test/java/org/openjdk/jmh/it/intraorder/GroupStateTearDownOrderTest.java	Fri May 31 14:47:26 2013 +0400
@@ -50,7 +50,7 @@
     @State(Scope.Group)
     public static class MyState {
 
-        private static final AtomicInteger seq = new AtomicInteger();
+        private final AtomicInteger seq = new AtomicInteger();
         private int run1, run2, run3, runD;
         private int iter1, iter2, iter3, iterD;
         private int invoc1, invoc2, invoc3, invocD;
--- a/jmh-core-it/src/test/java/org/openjdk/jmh/it/intraorder/ThreadBenchSetupOrderTest.java	Thu May 30 15:49:02 2013 +0400
+++ b/jmh-core-it/src/test/java/org/openjdk/jmh/it/intraorder/ThreadBenchSetupOrderTest.java	Fri May 31 14:47:26 2013 +0400
@@ -41,7 +41,7 @@
 @State(Scope.Thread)
 public class ThreadBenchSetupOrderTest {
 
-    private static final AtomicInteger seq = new AtomicInteger();
+    private final AtomicInteger seq = new AtomicInteger();
     private int run1, run2, run3, runD;
     private int iter1, iter2, iter3, iterD;
     private int invoc1, invoc2, invoc3, invocD;
--- a/jmh-core-it/src/test/java/org/openjdk/jmh/it/intraorder/ThreadBenchTearDownOrderTest.java	Thu May 30 15:49:02 2013 +0400
+++ b/jmh-core-it/src/test/java/org/openjdk/jmh/it/intraorder/ThreadBenchTearDownOrderTest.java	Fri May 31 14:47:26 2013 +0400
@@ -49,7 +49,7 @@
 @State(Scope.Thread)
 public class ThreadBenchTearDownOrderTest {
 
-    private static final AtomicInteger seq = new AtomicInteger();
+    private final AtomicInteger seq = new AtomicInteger();
     private int run1, run2, run3, runD;
     private int iter1, iter2, iter3, iterD;
     private int invoc1, invoc2, invoc3, invocD;
--- a/jmh-core-it/src/test/java/org/openjdk/jmh/it/intraorder/ThreadStateSetupOrderTest.java	Thu May 30 15:49:02 2013 +0400
+++ b/jmh-core-it/src/test/java/org/openjdk/jmh/it/intraorder/ThreadStateSetupOrderTest.java	Fri May 31 14:47:26 2013 +0400
@@ -51,7 +51,7 @@
     @State(Scope.Thread)
     public static class MyState {
 
-        private static final AtomicInteger seq = new AtomicInteger();
+        private final AtomicInteger seq = new AtomicInteger();
         private int run1, run2, run3, runD;
         private int iter1, iter2, iter3, iterD;
         private int invoc1, invoc2, invoc3, invocD;
--- a/jmh-core-it/src/test/java/org/openjdk/jmh/it/intraorder/ThreadStateTearDownOrderTest.java	Thu May 30 15:49:02 2013 +0400
+++ b/jmh-core-it/src/test/java/org/openjdk/jmh/it/intraorder/ThreadStateTearDownOrderTest.java	Fri May 31 14:47:26 2013 +0400
@@ -50,7 +50,7 @@
     @State(Scope.Thread)
     public static class MyState {
 
-        private static final AtomicInteger seq = new AtomicInteger();
+        private final AtomicInteger seq = new AtomicInteger();
         private int run1, run2, run3, runD;
         private int iter1, iter2, iter3, iterD;
         private int invoc1, invoc2, invoc3, invocD;
--- a/jmh-core-it/src/test/java/org/openjdk/jmh/it/races/RaceGroupStateIterationTest.java	Thu May 30 15:49:02 2013 +0400
+++ b/jmh-core-it/src/test/java/org/openjdk/jmh/it/races/RaceGroupStateIterationTest.java	Fri May 31 14:47:26 2013 +0400
@@ -42,12 +42,11 @@
 
     @State(Scope.Group)
     public static class MyState {
-        public int value = 0;
+        public int value = 2;
 
         @Setup(Level.Iteration)
         public void setup() {
-            System.err.println("Executing setup");
-            Assert.assertNotSame("Setup", 1, value);
+            Assert.assertEquals("Setup", 2, value);
             value = 1;
         }