aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/junitparams/converters/Param.java
diff options
context:
space:
mode:
authorPaul Duffin <paulduffin@google.com>2016-07-12 11:23:47 +0100
committerPaul Duffin <paulduffin@google.com>2016-07-20 15:24:23 +0100
commitfd1f9491413fcdbfae3cbd43651db31fdabce41a (patch)
tree58f3125a8ac5aae2139281886fca5b80f53cf853 /src/main/java/junitparams/converters/Param.java
parent896c3e9298b039ead2b21a6377a01a63df7f20f7 (diff)
downloadplatform_external_junit-params-fd1f9491413fcdbfae3cbd43651db31fdabce41a.tar.gz
platform_external_junit-params-fd1f9491413fcdbfae3cbd43651db31fdabce41a.tar.bz2
platform_external_junit-params-fd1f9491413fcdbfae3cbd43651db31fdabce41a.zip
Initial checkin of JUnitParams-1.0.5
Adds README.version, README.google, MODULE_LICENSE_APACHE2 files as required by the process (see b/30087411). The code does not yet compile; it requires patching to work with Android API and JUnit 4.10. Those patches will be added in separate commits to make it easy to identify the Android specific changes. All the changes will be submitted together. Bug: 30244565 Change-Id: Icf556377478c3afdd644c5e4db0ff18898f496ae Test: Once it compiles the tests will be run.
Diffstat (limited to 'src/main/java/junitparams/converters/Param.java')
-rw-r--r--src/main/java/junitparams/converters/Param.java29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/main/java/junitparams/converters/Param.java b/src/main/java/junitparams/converters/Param.java
new file mode 100644
index 0000000..e8ab65d
--- /dev/null
+++ b/src/main/java/junitparams/converters/Param.java
@@ -0,0 +1,29 @@
+package junitparams.converters;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Annotates parametrized test parameter with information about {@link Converter} that should be used for parameter conversion.
+ * <p>
+ * Can also be used to create custom annotations.<br>
+ * example:
+ * <pre>
+ * &#064;Retention(RetentionPolicy.RUNTIME)
+ * &#064;Target(ElementType.PARAMETER)
+ * &#064;Param(converter = FormattedDateConverter.class)
+ * public &#064;interface DateParam {
+ *
+ * String format() default "dd.MM.yyyy";
+ * }
+ * </pre>
+ * </p>
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target({ElementType.ANNOTATION_TYPE, ElementType.PARAMETER})
+public @interface Param {
+
+ Class<? extends Converter> converter();
+}