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

com.tngtech.jgiven.annotation.Pending Maven / Gradle / Ivy

There is a newer version: 1.3.1
Show newest version
package com.tngtech.jgiven.annotation;

import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

import java.lang.annotation.Documented;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

/**
 * Marks methods of step definitions as not implemented yet.
 * Such steps will not be executed, but will appear in
 * the report as pending.
 * 

* This is useful if one already wants to define the scenario without * already implementing all steps, for example, to verify that * all acceptance criteria of a story are covered by the scenario. *

* Annotating a stage class indicates * that no step is implemented yet. *

* A test method can be annotated to indicate that the whole * test is not implemented yet. The test will then be ignored by the testing-framework. * (In fact an AssumptionException is thrown. It depends on the test runner how this * is interpreted). Annotating the test class treats all methods of that test class as pending. * Currently only works for JUnit * *

Example

*
 * {@literal @}Pending
 * public void my_cool_new_feature() {
 *
 * }
 * 
* * @since 0.8.0 */ @Documented @Inherited @Retention( RUNTIME ) @Target( { METHOD, TYPE } ) public @interface Pending { /** * Optional description to describe when the implementation will be done. */ String value() default ""; /** * Instead of only reporting pending steps, * the steps are actually executed. * This is useful to see whether some steps fail, for example. * Failing steps, however, have no influence on the overall test result. */ boolean executeSteps() default false; /** * If no step fails during the execution of the test, * the test will fail. *

* This makes sense if one ensures that a not implemented feature * always leads to failing tests in the spirit of test-driven development. * The test is completely implemented if no test is failing anymore, which means * that the @Pending annotation can be removed. *

* If this is true, the executeSteps attribute is implicitly true. */ boolean failIfPass() default false; }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy