Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1810)

Unified Diff: base/test/android/javatests/src/org/chromium/base/test/params/ParameterAnnotations.java

Issue 2568633002: Create Next Gen Parameter Test Framework for JUnit4 (Closed)
Patch Set: rebase Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: base/test/android/javatests/src/org/chromium/base/test/params/ParameterAnnotations.java
diff --git a/base/test/android/javatests/src/org/chromium/base/test/params/ParameterAnnotations.java b/base/test/android/javatests/src/org/chromium/base/test/params/ParameterAnnotations.java
new file mode 100644
index 0000000000000000000000000000000000000000..b1daadd0e5f861feed1e1d78ccdecaced0dc620c
--- /dev/null
+++ b/base/test/android/javatests/src/org/chromium/base/test/params/ParameterAnnotations.java
@@ -0,0 +1,58 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.base.test.params;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Annotations for Parameterized Tests
+ */
+public class ParameterAnnotations {
+ /**
+ * Annotation for test methods to indicate associated List<ParameterSet>
+ */
+ @Retention(RetentionPolicy.RUNTIME)
+ @Target(ElementType.METHOD)
+ public @interface UseMethodParameter {
+ String value();
+ }
+
+ /**
+ * Annotation for static field of a `List<ParameterSet>` for entire test class
+ */
+ @Retention(RetentionPolicy.RUNTIME)
+ @Target(ElementType.FIELD)
+ public @interface ClassParameter {}
+
+ /**
+ * Annotation for static field of a `List<ParameterSet>` for certain test methods
+ */
+ @Retention(RetentionPolicy.RUNTIME)
+ @Target(ElementType.FIELD)
+ public @interface MethodParameter {
+ String value();
+ }
+
+ /**
+ * Annotation for static field of a `List<ParameterSet>` of TestRule
+ */
+ @Retention(RetentionPolicy.RUNTIME)
+ @Target(ElementType.FIELD)
+ public @interface RuleParameter {}
+
+ /**
+ * Annotation for test class, it specifies which ParameterizeRunnerDelegate to use.
+ *
+ * The default ParameterizedRunnerDelegate is BaseJUnit4RunnerDelegate.class
+ */
+ @Retention(RetentionPolicy.RUNTIME)
+ @Target(ElementType.TYPE)
+ public @interface UseRunnerDelegate {
+ Class<? extends ParameterizedRunnerDelegate> value();
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698