diff options
author | Paul Duffin <paulduffin@google.com> | 2016-07-12 11:23:47 +0100 |
---|---|---|
committer | Paul Duffin <paulduffin@google.com> | 2016-07-20 15:24:23 +0100 |
commit | fd1f9491413fcdbfae3cbd43651db31fdabce41a (patch) | |
tree | 58f3125a8ac5aae2139281886fca5b80f53cf853 /src/main/java/junitparams/converters/Param.java | |
parent | 896c3e9298b039ead2b21a6377a01a63df7f20f7 (diff) | |
download | platform_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.java | 29 |
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> + * @Retention(RetentionPolicy.RUNTIME) + * @Target(ElementType.PARAMETER) + * @Param(converter = FormattedDateConverter.class) + * public @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(); +} |