AfterScenario.java

  1. package org.jbehave.core.annotations;

  2. import static org.jbehave.core.annotations.AfterScenario.Outcome.ANY;

  3. import java.lang.annotation.Documented;
  4. import java.lang.annotation.ElementType;
  5. import java.lang.annotation.Retention;
  6. import java.lang.annotation.RetentionPolicy;
  7. import java.lang.annotation.Target;

  8. @Retention(RetentionPolicy.RUNTIME)
  9. @Target(ElementType.METHOD)
  10. @Documented
  11. public @interface AfterScenario {

  12.     public enum Outcome {
  13.         ANY, SUCCESS, FAILURE
  14.     }
  15.    
  16.     /**
  17.      * Signals that the annotated method should be invoked only upon given outcome
  18.      *
  19.      * @return An Outcome upon which the method should be invoked
  20.      */
  21.     Outcome uponOutcome() default ANY;

  22.     /**
  23.      * Signals that the annotated method should be invoked only upon given type
  24.      *
  25.      * @return A ScenarioType upon which the method should be invoked
  26.      */
  27.     ScenarioType uponType() default ScenarioType.ANY;

  28.     /**
  29.      * Lifecycle hooks with the higher order will be executed last
  30.      *
  31.      * @return order value
  32.      */
  33.     int order() default 0;

  34. }