Class EntityRemoveRule
java.lang.Object
org.junit.rules.TestWatcher
org.operaton.bpm.engine.test.util.EntityRemoveRule
- All Implemented Interfaces:
org.junit.rules.TestRule
public class EntityRemoveRule
extends org.junit.rules.TestWatcher
JUnit 4 Rule that performs resource cleanup for methods that require post-method execution cleanup.
Currently, the rule supports only clean up of
Tasks but the rule can be extended for other resources that
might pollute sequential execution of other test methods.-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionorg.junit.runners.model.Statementapply(org.junit.runners.model.Statement base, org.junit.runner.Description description) protected voidexecutePostEvaluate(RemoveAfter removeAfterAnnotation, boolean methodHasRemoveAfterAnnotation) protected voidHook method to suppprotected voidexecuteRemoval(RemoveAfter removeAfterAnnotation) Hook method for executing removal.static EntityRemoveRuleof(ProcessEngineTestRule rule) static EntityRemoveRuleofLazyRule(Supplier<ProcessEngineTestRule> ruleSupplier) Methods inherited from class org.junit.rules.TestWatcher
failed, finished, skipped, skipped, starting, succeeded
-
Field Details
-
removable
-
-
Method Details
-
of
-
ofLazyRule
-
apply
public org.junit.runners.model.Statement apply(org.junit.runners.model.Statement base, org.junit.runner.Description description) - Specified by:
applyin interfaceorg.junit.rules.TestRule- Overrides:
applyin classorg.junit.rules.TestWatcher
-
executePostEvaluate
protected void executePostEvaluate(RemoveAfter removeAfterAnnotation, boolean methodHasRemoveAfterAnnotation) -
executePreRemoval
protected void executePreRemoval()Hook method to supp -
executeRemoval
Hook method for executing removal.- Parameters:
removeAfterAnnotation- the remove after annotation parameter of the executing method.
-