Annotation Type RuleAnnotation


  • @Retention(RUNTIME)
    @Target(ANNOTATION_TYPE)
    @Documented
    public @interface RuleAnnotation
    Meta-annotation for annotations that introduces a TestRule for test.

    This allows annotations on test class/method to add additional setup/shutdown behaviours.

    Author:
    Kohsuke Kawaguchi
    • Required Element Summary

      Required Elements 
      Modifier and Type Required Element Description
      Class<? extends org.junit.rules.TestRule> value
      The rule class that defines the setup/shutdown behaviour.
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      int priority
      Optional ordering among rules.
    • Element Detail

      • value

        Class<? extends org.junit.rules.TestRule> value
        The rule class that defines the setup/shutdown behaviour.

        The instance is obtained through Guice.

      • priority

        int priority
        Optional ordering among rules.

        Annotation with priority >= 0 are guaranteed to be run after Jenkins is up. Negative priorities are run before startup on best effort basis. (It might not happen before for ExistingJenkinsController, PooledJenkinsController and possibly others).

        Annotations that skips execution are encouraged to run before Jenkins is booted up to save time. Note, that these implementations can not inject Jenkins for obvious reasons.

        Default:
        0