spock.lang.RepeatUntilFailure Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spock-core Show documentation
Show all versions of spock-core Show documentation
Spock is a testing and specification framework for Java and Groovy applications.
What makes it stand out from the crowd is its beautiful and highly expressive specification language.
Thanks to its JUnit runner, Spock is compatible with most IDEs, build tools, and continuous integration servers.
Spock is inspired from JUnit, jMock, RSpec, Groovy, Scala, Vulcans, and other fascinating life forms.
package spock.lang;
import org.spockframework.runtime.extension.ExtensionAnnotation;
import org.spockframework.runtime.extension.builtin.RepeatUntilFailureExtension;
import org.spockframework.util.Beta;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* Repeats a feature until it fails or the maximum number of repetitions is reached.
*
* For parameterized features, all parameter sets are repeated.
*
* This extension is only intended to aid in manual testing and debugging.
* @author Leonard Brünings
* @since 2.3
*/
@Beta
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@ExtensionAnnotation(RepeatUntilFailureExtension.class)
public @interface RepeatUntilFailure {
/**
* The maximum number of repetitions.
*/
int maxAttempts() default Integer.MAX_VALUE;
/**
* Behaves like {@link IgnoreRest} is applied, skipping all other features.
*/
boolean ignoreRest() default true;
}