Class DryRunAspect
- java.lang.Object
-
- dev.aherscu.qa.jgiven.commons.utils.DryRunAspect
-
public class DryRunAspect extends Object
Monitors execution of JGiven step methods. Ifdryrun
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 Summary
Fields Modifier and Type Field Description static boolean
dryRun
-
Constructor Summary
Constructors Constructor Description DryRunAspect()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
afterClass()
Matches the execution of methods annotated withAfterClass
.void
afterMethod()
Matches the execution of methods annotated withAfterMethod
.void
afterScenario()
Matches the execution of methods annotated withAfterScenario
.void
afterStage()
Matches the execution of methods annotated withAfterStage
.Object
aroundBeforeOrAfterMethod(org.aspectj.lang.ProceedingJoinPoint thisJoinPoint)
Prevents execution if indryrun
mode.Object
aroundStepMethod(org.aspectj.lang.ProceedingJoinPoint thisJoinPoint)
Prevents execution if indryrun
mode.void
beforeClass()
Matches the execution of methods annotated withBeforeClass
.void
beforeMethod()
Matches the execution of methods annotated withBeforeMethod
.void
beforeOrAfterMethod()
Matches the execution of before or after methods.void
beforeScenario()
Matches the execution of methods annotated withBeforeScenario
.void
beforeStage()
Matches the execution of methods annotated withBeforeStage
.void
notConfigurableScenarioTestMethod()
Matches the execution of any method not withinConfigurableScenarioTest
.void
stageMethod()
Matches the execution of any method within a sub-type ofStageBase
.void
stepMethod()
Matches the execution of any method returning SELF (a subclass ofStageBase
.
-
-
-
Method Detail
-
afterClass
public void afterClass()
Matches the execution of methods annotated withAfterClass
.
-
afterMethod
public void afterMethod()
Matches the execution of methods annotated withAfterMethod
.
-
afterScenario
public void afterScenario()
Matches the execution of methods annotated withAfterScenario
.
-
afterStage
public void afterStage()
Matches the execution of methods annotated withAfterStage
.
-
aroundBeforeOrAfterMethod
public Object aroundBeforeOrAfterMethod(org.aspectj.lang.ProceedingJoinPoint thisJoinPoint) throws Throwable
Prevents execution if indryrun
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 indryrun
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 withBeforeClass
.
-
beforeMethod
public void beforeMethod()
Matches the execution of methods annotated withBeforeMethod
.
-
beforeOrAfterMethod
public void beforeOrAfterMethod()
Matches the execution of before or after methods.
-
beforeScenario
public void beforeScenario()
Matches the execution of methods annotated withBeforeScenario
.
-
beforeStage
public void beforeStage()
Matches the execution of methods annotated withBeforeStage
.
-
notConfigurableScenarioTestMethod
public void notConfigurableScenarioTestMethod()
Matches the execution of any method not withinConfigurableScenarioTest
.
-
stageMethod
public void stageMethod()
Matches the execution of any method within a sub-type ofStageBase
.
-
stepMethod
public void stepMethod()
Matches the execution of any method returning SELF (a subclass ofStageBase
.
-
-