Class DryRunAspect


  • public class DryRunAspect
    extends Object
    Monitors execution of JGiven step methods. If dryrun system property is not blank then it shortcuts the actual method execution.

    Other approach for dry running is available via JGiven 0.18.2 library see #418

    Update: planned for 1.0.0; see https://github.com/TNG/JGiven/pull/435

    • Field Detail

      • dryRun

        public static final boolean dryRun
    • Constructor Detail

      • DryRunAspect

        public DryRunAspect()
    • Method Detail

      • afterClass

        public void afterClass()
        Matches the execution of methods annotated with AfterClass.
      • afterMethod

        public void afterMethod()
        Matches the execution of methods annotated with AfterMethod.
      • afterScenario

        public void afterScenario()
        Matches the execution of methods annotated with AfterScenario.
      • afterStage

        public void afterStage()
        Matches the execution of methods annotated with AfterStage.
      • aroundBeforeOrAfterMethod

        public Object aroundBeforeOrAfterMethod​(org.aspectj.lang.ProceedingJoinPoint thisJoinPoint)
                                         throws Throwable
        Prevents execution if in dryrun mode.
        Parameters:
        thisJoinPoint - advised join point
        Returns:
        forwarded from advised method
        Throws:
        Throwable - re-thrown as received advised method
        See Also:
        stageMethod(), stepMethod()
      • aroundStepMethod

        public Object aroundStepMethod​(org.aspectj.lang.ProceedingJoinPoint thisJoinPoint)
                                throws Throwable
        Prevents execution if in dryrun mode.
        Parameters:
        thisJoinPoint - advised join point
        Returns:
        forwarded from advised method
        Throws:
        Throwable - re-thrown as received advised method
        See Also:
        stageMethod(), stepMethod()
      • beforeClass

        public void beforeClass()
        Matches the execution of methods annotated with BeforeClass.
      • beforeMethod

        public void beforeMethod()
        Matches the execution of methods annotated with BeforeMethod.
      • beforeOrAfterMethod

        public void beforeOrAfterMethod()
        Matches the execution of before or after methods.
      • beforeScenario

        public void beforeScenario()
        Matches the execution of methods annotated with BeforeScenario.
      • beforeStage

        public void beforeStage()
        Matches the execution of methods annotated with BeforeStage.
      • notConfigurableScenarioTestMethod

        public void notConfigurableScenarioTestMethod()
        Matches the execution of any method not within ConfigurableScenarioTest.
      • stageMethod

        public void stageMethod()
        Matches the execution of any method within a sub-type of StageBase.
      • stepMethod

        public void stepMethod()
        Matches the execution of any method returning SELF (a subclass of StageBase.