diff options
Diffstat (limited to 'src/main/java/org/junit/experimental/theories/suppliers/TestedOn.java')
-rw-r--r-- | src/main/java/org/junit/experimental/theories/suppliers/TestedOn.java | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/src/main/java/org/junit/experimental/theories/suppliers/TestedOn.java b/src/main/java/org/junit/experimental/theories/suppliers/TestedOn.java index d6ede64..a19f20a 100644 --- a/src/main/java/org/junit/experimental/theories/suppliers/TestedOn.java +++ b/src/main/java/org/junit/experimental/theories/suppliers/TestedOn.java @@ -1,13 +1,31 @@ package org.junit.experimental.theories.suppliers; +import static java.lang.annotation.ElementType.PARAMETER; + import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; import org.junit.experimental.theories.ParametersSuppliedBy; - +/** + * Annotating a {@link org.junit.experimental.theories.Theory Theory} method int + * parameter with @TestedOn causes it to be supplied with values from the + * ints array given when run as a theory by the + * {@link org.junit.experimental.theories.Theories Theories} runner. For + * example, the below method would be called three times by the Theories runner, + * once with each of the int parameters specified. + * + * <pre> + * @Theory + * public void shouldPassForSomeInts(@TestedOn(ints={1, 2, 3}) int param) { + * ... + * } + * </pre> + */ @ParametersSuppliedBy(TestedOnSupplier.class) @Retention(RetentionPolicy.RUNTIME) +@Target(PARAMETER) public @interface TestedOn { - int[] ints(); + int[] ints(); } |