spock.lang.PendingFeature 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.PendingFeatureExtension;
import org.spockframework.util.Beta;
import java.lang.annotation.*;
/**
* Indicates that the feature is not fully implemented yet and should not be reported as error.
*
* The use case is to annotate tests that can not yet run but should already be committed.
* The main difference to {@link Ignore} is that the test are executed, but test failures are ignored.
* If the test passes without an error, then it will be reported as failure since the {@link PendingFeature}
* annotation should be removed. This way the tests will become part of the normal tests
* instead of being ignored forever.
*
*
* Groovy has the {@link groovy.transform.NotYetImplemented} annotation which is similar but behaves a differently.
*
* - it will mark failing tests as passed
* - if at least one iteration of a data-driven test passes it will be reported as error
*
* {@link PendingFeature}:
*
* - it will mark failing tests as skipped
* - if at least one iteration of a data-driven test fails it will be reported as skipped
* - if every iteration of a data-driven test passes it will be reported as error
*
*
* @author Leonard Brünings
*/
@Beta
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.METHOD})
@ExtensionAnnotation(PendingFeatureExtension.class)
public @interface PendingFeature {
/**
* Configures which types of Exceptions are expected in the pending feature.
*
* Subclasses are included if their parent class is listed.
*
* @return array of Exception classes to ignore.
*/
Class extends Throwable>[] exceptions() default {Exception.class};
/**
* The reason why this feature is pending
*
* @return reason why this feature is pending
*/
String reason() default "";
}