001 package org.junit.experimental.theories.suppliers; 002 003 import static java.lang.annotation.ElementType.PARAMETER; 004 005 import java.lang.annotation.Retention; 006 import java.lang.annotation.RetentionPolicy; 007 import java.lang.annotation.Target; 008 009 import org.junit.experimental.theories.ParametersSuppliedBy; 010 011 /** 012 * Annotating a {@link org.junit.experimental.theories.Theory Theory} method int 013 * parameter with @TestedOn causes it to be supplied with values from the 014 * ints array given when run as a theory by the 015 * {@link org.junit.experimental.theories.Theories Theories} runner. For 016 * example, the below method would be called three times by the Theories runner, 017 * once with each of the int parameters specified. 018 * 019 * <pre> 020 * @Theory 021 * public void shouldPassForSomeInts(@TestedOn(ints={1, 2, 3}) int param) { 022 * ... 023 * } 024 * </pre> 025 */ 026 @ParametersSuppliedBy(TestedOnSupplier.class) 027 @Retention(RetentionPolicy.RUNTIME) 028 @Target(PARAMETER) 029 public @interface TestedOn { 030 int[] ints(); 031 }