Package de.ppi.deepsampler.junit4
Class DeepSamplerRule
java.lang.Object
de.ppi.deepsampler.junit4.DeepSamplerRule
- All Implemented Interfaces:
org.junit.rules.MethodRule
public class DeepSamplerRule
extends java.lang.Object
implements org.junit.rules.MethodRule
As a convenient alternative, Samplers may be prepared by annotating properties in test classes with
PrepareSampler instead of using
Sampler.prepare(Class). In Junit4 test cases the annotation is interpreted by this Rule.
The Rule also clears Samplers that might have been created by preceding tests before a new test method is started.
This would otherwise have to be done by calling Sampler.clear() manually in each test.
The Rule is activated by adding a property to the test class like this: @Rule public DeepSamplerRule deepSamplerRule = new DeepSamplerRule();
-
Constructor Summary
Constructors Constructor Description DeepSamplerRule() -
Method Summary
Modifier and Type Method Description org.junit.runners.model.Statementapply(org.junit.runners.model.Statement base, org.junit.runners.model.FrameworkMethod method, java.lang.Object target)
-
Constructor Details
-
DeepSamplerRule
public DeepSamplerRule()
-
-
Method Details
-
apply
public org.junit.runners.model.Statement apply(org.junit.runners.model.Statement base, org.junit.runners.model.FrameworkMethod method, java.lang.Object target)- Specified by:
applyin interfaceorg.junit.rules.MethodRule
-