001package de.cuioss.test.generator.junit; 002 003import static java.lang.annotation.ElementType.TYPE; 004import static java.lang.annotation.RetentionPolicy.RUNTIME; 005 006import java.lang.annotation.Retention; 007import java.lang.annotation.Target; 008 009import org.junit.jupiter.api.extension.ExtendWith; 010 011/** 012 * <h2>Purpose and Usage</h2> 013 * This annotation is meant to be set on a junit 5 test-case. It controls the generator subsystem 014 * and, in case of test-failures, provides information, that can be used for repeating the failed 015 * tests with a fixed seed for the generators, see {@link GeneratorSeed} for details. This fixed 016 * seed results in the generators reproducing the exact same test-data. 017 * Sample output: 018 * 019 * <pre> 020GeneratorController seed was 4711L. 021Use a fixed seed by applying @GeneratorSeed(4711L) for the method/class, 022or by using the system property '-Dio.cui.test.generator.seed=4711' 023 * </pre> 024 * 025 * <h2>Implementation</h2> 026 * Shorthand for enabling {@link GeneratorControllerExtension} for a certain test-class. This type 027 * is equivalent to {@link ExtendWith} {@link GeneratorControllerExtension} 028 * 029 * @author Oliver Wolff 030 * 031 */ 032@Retention(RUNTIME) 033@Target(TYPE) 034@ExtendWith(GeneratorControllerExtension.class) 035public @interface EnableGeneratorController { 036 037}