changeset 1040:c60c03ff0993

7901105: @Params in nested @States are not being initialized
author shade
date Mon, 17 Nov 2014 17:14:41 +0300
parents 13fd470bd6ed
children 9c2f09aec48d
files jmh-core-ct/src/test/java/org/openjdk/jmh/ct/states/dag/SelfBenchmarkTest.java jmh-core-ct/src/test/java/org/openjdk/jmh/ct/states/dag/SelfThreadTest.java jmh-core-it/src/test/java/org/openjdk/jmh/it/params/nested/NestedSetupDependencyTest.java jmh-core-it/src/test/java/org/openjdk/jmh/it/params/nested/NestedSubclassDependencyTest.java jmh-core-it/src/test/java/org/openjdk/jmh/it/params/nested/NestedSubclassImplicitDependencyTest.java jmh-core-it/src/test/java/org/openjdk/jmh/it/params/nested/NestedTearDownDependencyTest.java jmh-core/src/main/java/org/openjdk/jmh/generators/core/BenchmarkGeneratorUtils.java
diffstat 7 files changed, 545 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jmh-core-ct/src/test/java/org/openjdk/jmh/ct/states/dag/SelfBenchmarkTest.java	Mon Nov 17 17:14:41 2014 +0300
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jmh.ct.states.dag;
+
+import org.junit.Test;
+import org.openjdk.jmh.annotations.Benchmark;
+import org.openjdk.jmh.annotations.Scope;
+import org.openjdk.jmh.annotations.Setup;
+import org.openjdk.jmh.annotations.State;
+import org.openjdk.jmh.ct.CompileTest;
+
+public class SelfBenchmarkTest {
+
+    @State(Scope.Benchmark)
+    public static class B1 {
+        @Setup
+        public void setup(B1 b1) {
+
+        }
+    }
+
+    @Benchmark
+    public void test(B1 b1) {
+
+    }
+
+    @Test
+    public void compileTest() {
+        CompileTest.assertFail(this.getClass());
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jmh-core-ct/src/test/java/org/openjdk/jmh/ct/states/dag/SelfThreadTest.java	Mon Nov 17 17:14:41 2014 +0300
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jmh.ct.states.dag;
+
+import org.junit.Test;
+import org.openjdk.jmh.annotations.Benchmark;
+import org.openjdk.jmh.annotations.Param;
+import org.openjdk.jmh.annotations.Scope;
+import org.openjdk.jmh.annotations.Setup;
+import org.openjdk.jmh.annotations.State;
+import org.openjdk.jmh.ct.CompileTest;
+
+public class SelfThreadTest {
+
+    @State(Scope.Thread)
+    public static class B1 {
+        @Param
+        private int x;
+
+        @Setup
+        public void setup(B1 b1) {
+
+        }
+    }
+
+    @Benchmark
+    public void test(B1 b1) {
+
+    }
+
+    @Test
+    public void compileTest() {
+        CompileTest.assertFail(this.getClass());
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jmh-core-it/src/test/java/org/openjdk/jmh/it/params/nested/NestedSetupDependencyTest.java	Mon Nov 17 17:14:41 2014 +0300
@@ -0,0 +1,106 @@
+/*
+ * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jmh.it.params.nested;
+
+import org.junit.Test;
+import org.openjdk.jmh.annotations.Benchmark;
+import org.openjdk.jmh.annotations.Fork;
+import org.openjdk.jmh.annotations.Measurement;
+import org.openjdk.jmh.annotations.Param;
+import org.openjdk.jmh.annotations.Scope;
+import org.openjdk.jmh.annotations.Setup;
+import org.openjdk.jmh.annotations.State;
+import org.openjdk.jmh.annotations.Warmup;
+import org.openjdk.jmh.it.Fixtures;
+import org.openjdk.jmh.it.params.Shared;
+import org.openjdk.jmh.runner.Runner;
+import org.openjdk.jmh.runner.RunnerException;
+import org.openjdk.jmh.runner.options.Options;
+import org.openjdk.jmh.runner.options.OptionsBuilder;
+
+import java.util.concurrent.TimeUnit;
+
+@Measurement(iterations = 1, time = 100, timeUnit = TimeUnit.MICROSECONDS)
+@Warmup(iterations = 1, time = 100, timeUnit = TimeUnit.MICROSECONDS)
+@Fork(1)
+@State(Scope.Benchmark)
+public class NestedSetupDependencyTest {
+
+    @State(Scope.Benchmark)
+    public static class S1 {
+        @Param({"1", "2", "3"})
+        public int x;
+    }
+
+    @State(Scope.Thread)
+    public static class S2 {
+        @Param({"a", "b", "c"})
+        public String y;
+
+        @Setup
+        public void setup(S1 s) {
+
+        }
+    }
+
+    @Benchmark
+    public void bench(S2 s) {
+        Fixtures.work();
+    }
+
+    @Test
+    public void full() throws RunnerException {
+        Options opts = new OptionsBuilder()
+                .include(Fixtures.getTestMask(this.getClass()))
+                .shouldFailOnError(true)
+                .build();
+
+        Shared.compare(new Runner(opts).run(), new int[] {1, 2, 3}, new String[] { "a", "b", "c"});
+    }
+
+    @Test
+    public void constrainedX() throws RunnerException {
+        Options opts = new OptionsBuilder()
+                .include(Fixtures.getTestMask(this.getClass()))
+                .shouldFailOnError(true)
+                .param("x", "2", "3")
+                .build();
+
+        Shared.compare(new Runner(opts).run(), new int[]{2, 3}, new String[]{"a", "b", "c"});
+    }
+
+    @Test
+    public void constrainedY() throws RunnerException {
+        Options opts = new OptionsBuilder()
+                .include(Fixtures.getTestMask(this.getClass()))
+                .shouldFailOnError(true)
+                .param("y", "b", "c")
+                .build();
+
+        Shared.compare(new Runner(opts).run(), new int[] {1, 2, 3}, new String[] { "b", "c"});
+    }
+
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jmh-core-it/src/test/java/org/openjdk/jmh/it/params/nested/NestedSubclassDependencyTest.java	Mon Nov 17 17:14:41 2014 +0300
@@ -0,0 +1,101 @@
+/*
+ * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jmh.it.params.nested;
+
+import org.junit.Test;
+import org.openjdk.jmh.annotations.Benchmark;
+import org.openjdk.jmh.annotations.Fork;
+import org.openjdk.jmh.annotations.Measurement;
+import org.openjdk.jmh.annotations.Param;
+import org.openjdk.jmh.annotations.Scope;
+import org.openjdk.jmh.annotations.Setup;
+import org.openjdk.jmh.annotations.State;
+import org.openjdk.jmh.annotations.Warmup;
+import org.openjdk.jmh.it.Fixtures;
+import org.openjdk.jmh.it.params.Shared;
+import org.openjdk.jmh.runner.Runner;
+import org.openjdk.jmh.runner.RunnerException;
+import org.openjdk.jmh.runner.options.Options;
+import org.openjdk.jmh.runner.options.OptionsBuilder;
+
+import java.util.concurrent.TimeUnit;
+
+@Measurement(iterations = 1, time = 100, timeUnit = TimeUnit.MICROSECONDS)
+@Warmup(iterations = 1, time = 100, timeUnit = TimeUnit.MICROSECONDS)
+@Fork(1)
+@State(Scope.Benchmark)
+public class NestedSubclassDependencyTest {
+
+    @State(Scope.Benchmark)
+    public static class S1 {
+        @Param({"1", "2", "3"})
+        public int x;
+    }
+
+    @State(Scope.Thread)
+    public static class S2 extends S1 {
+        @Param({"a", "b", "c"})
+        public String y;
+    }
+
+    @Benchmark
+    public void bench(S2 s) {
+        Fixtures.work();
+    }
+
+    @Test
+    public void full() throws RunnerException {
+        Options opts = new OptionsBuilder()
+                .include(Fixtures.getTestMask(this.getClass()))
+                .shouldFailOnError(true)
+                .build();
+
+        Shared.compare(new Runner(opts).run(), new int[] {1, 2, 3}, new String[] { "a", "b", "c"});
+    }
+
+    @Test
+    public void constrainedX() throws RunnerException {
+        Options opts = new OptionsBuilder()
+                .include(Fixtures.getTestMask(this.getClass()))
+                .shouldFailOnError(true)
+                .param("x", "2", "3")
+                .build();
+
+        Shared.compare(new Runner(opts).run(), new int[]{2, 3}, new String[]{"a", "b", "c"});
+    }
+
+    @Test
+    public void constrainedY() throws RunnerException {
+        Options opts = new OptionsBuilder()
+                .include(Fixtures.getTestMask(this.getClass()))
+                .shouldFailOnError(true)
+                .param("y", "b", "c")
+                .build();
+
+        Shared.compare(new Runner(opts).run(), new int[] {1, 2, 3}, new String[] { "b", "c"});
+    }
+
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jmh-core-it/src/test/java/org/openjdk/jmh/it/params/nested/NestedSubclassImplicitDependencyTest.java	Mon Nov 17 17:14:41 2014 +0300
@@ -0,0 +1,97 @@
+/*
+ * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jmh.it.params.nested;
+
+import org.junit.Test;
+import org.openjdk.jmh.annotations.Benchmark;
+import org.openjdk.jmh.annotations.Fork;
+import org.openjdk.jmh.annotations.Measurement;
+import org.openjdk.jmh.annotations.Param;
+import org.openjdk.jmh.annotations.Scope;
+import org.openjdk.jmh.annotations.State;
+import org.openjdk.jmh.annotations.Warmup;
+import org.openjdk.jmh.it.Fixtures;
+import org.openjdk.jmh.it.params.Shared;
+import org.openjdk.jmh.runner.Runner;
+import org.openjdk.jmh.runner.RunnerException;
+import org.openjdk.jmh.runner.options.Options;
+import org.openjdk.jmh.runner.options.OptionsBuilder;
+
+import java.util.concurrent.TimeUnit;
+
+@Measurement(iterations = 1, time = 100, timeUnit = TimeUnit.MICROSECONDS)
+@Warmup(iterations = 1, time = 100, timeUnit = TimeUnit.MICROSECONDS)
+@Fork(1)
+@State(Scope.Benchmark)
+public class NestedSubclassImplicitDependencyTest {
+
+    @Param({"1", "2", "3"})
+    public int x;
+
+    @State(Scope.Thread)
+    public static class S2 extends NestedSubclassImplicitDependencyTest {
+        @Param({"a", "b", "c"})
+        public String y;
+    }
+
+    @Benchmark
+    public void bench(S2 s) {
+        Fixtures.work();
+    }
+
+    @Test
+    public void full() throws RunnerException {
+        Options opts = new OptionsBuilder()
+                .include(Fixtures.getTestMask(this.getClass()))
+                .shouldFailOnError(true)
+                .build();
+
+        Shared.compare(new Runner(opts).run(), new int[] {1, 2, 3}, new String[] { "a", "b", "c"});
+    }
+
+    @Test
+    public void constrainedX() throws RunnerException {
+        Options opts = new OptionsBuilder()
+                .include(Fixtures.getTestMask(this.getClass()))
+                .shouldFailOnError(true)
+                .param("x", "2", "3")
+                .build();
+
+        Shared.compare(new Runner(opts).run(), new int[]{2, 3}, new String[]{"a", "b", "c"});
+    }
+
+    @Test
+    public void constrainedY() throws RunnerException {
+        Options opts = new OptionsBuilder()
+                .include(Fixtures.getTestMask(this.getClass()))
+                .shouldFailOnError(true)
+                .param("y", "b", "c")
+                .build();
+
+        Shared.compare(new Runner(opts).run(), new int[] {1, 2, 3}, new String[] { "b", "c"});
+    }
+
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jmh-core-it/src/test/java/org/openjdk/jmh/it/params/nested/NestedTearDownDependencyTest.java	Mon Nov 17 17:14:41 2014 +0300
@@ -0,0 +1,107 @@
+/*
+ * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jmh.it.params.nested;
+
+import org.junit.Test;
+import org.openjdk.jmh.annotations.Benchmark;
+import org.openjdk.jmh.annotations.Fork;
+import org.openjdk.jmh.annotations.Measurement;
+import org.openjdk.jmh.annotations.Param;
+import org.openjdk.jmh.annotations.Scope;
+import org.openjdk.jmh.annotations.Setup;
+import org.openjdk.jmh.annotations.State;
+import org.openjdk.jmh.annotations.TearDown;
+import org.openjdk.jmh.annotations.Warmup;
+import org.openjdk.jmh.it.Fixtures;
+import org.openjdk.jmh.it.params.Shared;
+import org.openjdk.jmh.runner.Runner;
+import org.openjdk.jmh.runner.RunnerException;
+import org.openjdk.jmh.runner.options.Options;
+import org.openjdk.jmh.runner.options.OptionsBuilder;
+
+import java.util.concurrent.TimeUnit;
+
+@Measurement(iterations = 1, time = 100, timeUnit = TimeUnit.MICROSECONDS)
+@Warmup(iterations = 1, time = 100, timeUnit = TimeUnit.MICROSECONDS)
+@Fork(1)
+@State(Scope.Benchmark)
+public class NestedTearDownDependencyTest {
+
+    @State(Scope.Benchmark)
+    public static class S1 {
+        @Param({"1", "2", "3"})
+        public int x;
+    }
+
+    @State(Scope.Thread)
+    public static class S2 {
+        @Param({"a", "b", "c"})
+        public String y;
+
+        @TearDown
+        public void tearDown(S1 s) {
+
+        }
+    }
+
+    @Benchmark
+    public void bench(S2 s) {
+        Fixtures.work();
+    }
+
+    @Test
+    public void full() throws RunnerException {
+        Options opts = new OptionsBuilder()
+                .include(Fixtures.getTestMask(this.getClass()))
+                .shouldFailOnError(true)
+                .build();
+
+        Shared.compare(new Runner(opts).run(), new int[] {1, 2, 3}, new String[] { "a", "b", "c"});
+    }
+
+    @Test
+    public void constrainedX() throws RunnerException {
+        Options opts = new OptionsBuilder()
+                .include(Fixtures.getTestMask(this.getClass()))
+                .shouldFailOnError(true)
+                .param("x", "2", "3")
+                .build();
+
+        Shared.compare(new Runner(opts).run(), new int[]{2, 3}, new String[]{"a", "b", "c"});
+    }
+
+    @Test
+    public void constrainedY() throws RunnerException {
+        Options opts = new OptionsBuilder()
+                .include(Fixtures.getTestMask(this.getClass()))
+                .shouldFailOnError(true)
+                .param("y", "b", "c")
+                .build();
+
+        Shared.compare(new Runner(opts).run(), new int[] {1, 2, 3}, new String[] { "b", "c"});
+    }
+
+
+}
--- a/jmh-core/src/main/java/org/openjdk/jmh/generators/core/BenchmarkGeneratorUtils.java	Fri Nov 14 14:24:53 2014 +0300
+++ b/jmh-core/src/main/java/org/openjdk/jmh/generators/core/BenchmarkGeneratorUtils.java	Mon Nov 17 17:14:41 2014 +0300
@@ -130,6 +130,14 @@
         return ls;
     }
 
+    public static Collection<MethodInfo> getAllMethods(ClassInfo ci) {
+        List<MethodInfo> ls = new ArrayList<MethodInfo>();
+        do {
+            ls.addAll(ci.getMethods());
+        } while ((ci = ci.getSuperClass()) != null);
+        return ls;
+    }
+
     public static Collection<MethodInfo> getMethods(ClassInfo ci) {
         List<MethodInfo> ls = new ArrayList<MethodInfo>();
         do {
@@ -267,16 +275,27 @@
     /**
      * Compute the parameter space given by {@code @Param} annotations and add all them to the group.
      *
-     * @param parameterInfoType type of the state {@code @State} in which to find {@code @Param}s
+     * @param host type of the state {@code @State} in which to find {@code @Param}s
      * @param group method group
      */
-    static void addParameterValuesToGroup(ClassInfo parameterInfoType, MethodGroup group) {
-        for (FieldInfo fi : getAllFields(parameterInfoType)) {
+    static void addParameterValuesToGroup(ClassInfo host, MethodGroup group) {
+        // Add all inherited @Param fields
+        for (FieldInfo fi : getAllFields(host)) {
             if (fi.getAnnotation(Param.class) != null) {
                 String[] values = toParameterValues(fi);
                 group.addParamValues(fi.getName(), values);
             }
         }
+
+        // Add all @Param fields reachable through the dependencies.
+        // This recursive approach always converges because @State dependency graph is DAG.
+        for (MethodInfo mi : getAllMethods(host)) {
+            if (mi.getAnnotation(Setup.class) != null || mi.getAnnotation(TearDown.class) != null) {
+                for (ParameterInfo pi : mi.getParameters()) {
+                    addParameterValuesToGroup(pi.getType(), group);
+                }
+            }
+        }
     }
 
 }