All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.junit.experimental.theories.ParametersSuppliedBy Maven / Gradle / Ivy

There is a newer version: 2.12.15
Show newest version
package org.junit.experimental.theories;

import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
import static java.lang.annotation.ElementType.PARAMETER;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * Annotating a {@link org.junit.experimental.theories.Theory Theory} method
 * parameter with @ParametersSuppliedBy causes it to be supplied with
 * values from the named
 * {@link org.junit.experimental.theories.ParameterSupplier ParameterSupplier}
 * when run as a theory by the {@link org.junit.experimental.theories.Theories
 * Theories} runner.
 * 
 * In addition, annotations themselves can be annotated with
 * @ParametersSuppliedBy, and then used similarly. ParameterSuppliedBy
 * annotations on parameters are detected by searching up this heirarchy such
 * that these act as syntactic sugar, making:
 * 
 * 
 * @ParametersSuppliedBy(Supplier.class)
 * public @interface SpecialParameter { }
 * 
 * @Theory
 * public void theoryMethod(@SpecialParameter String param) {
 *   ...
 * }
 * 
* * equivalent to: * *
 * @Theory
 * public void theoryMethod(@ParametersSuppliedBy(Supplier.class) String param) {
 *   ...
 * }
 * 
*/ @Retention(RetentionPolicy.RUNTIME) @Target({ ANNOTATION_TYPE, PARAMETER }) public @interface ParametersSuppliedBy { Class value(); }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy