Class AbstractTestRule<T extends Annotation>

java.lang.Object
net.sf.lightair.internal.junit.AbstractTestRule<T>
Type Parameters:
T - Type of annotation that configures the test rule
Direct Known Subclasses:
AwaitListTestRule, AwaitTestRule, SetupListTestRule, SetupTestRule, VerifyListTestRule, VerifyTestRule

public abstract class AbstractTestRule<T extends Annotation> extends Object
Abstract base class for test rules.
  • Constructor Details

    • AbstractTestRule

      public <A extends Annotation> AbstractTestRule(Method testMethod, Class<T> annotationType, Class<A> alternativeAnnotationType)
      Constructor.
      Type Parameters:
      A - Generic support param
      Parameters:
      testMethod - Java reflection method on which the test rule is being applied
      annotationType - Type of annotation that configures the test rule
      alternativeAnnotationType - Alternative annotation type
  • Method Details

    • before

      public void before()
      Executes before the test method.
    • after

      public void after()
      Executes after the test method.
    • getAnnotation

      public T getAnnotation()
      Return the configuring annotation.
      Returns:
      Configuring annotation
    • getTestMethod

      public Method getTestMethod()
      Return the test method on which the test rule is applied.
      Returns:
      Test method