public class RuleList
extends java.lang.Object
implements org.junit.rules.TestRule
RuleList rule enables ordering of TestRules.
Example:
public class SomeTest {
@Rule
public RuleList rules = new RuleList().add(new FirstRule()
.add(new SecondRule()
.add(new ThirdRule();
| Modifier | Constructor and Description |
|---|---|
|
RuleList()
Creates an empty
RuleList. |
protected |
RuleList(java.util.List<org.junit.rules.TestRule> rules)
Creates a new
RuleList containing the specified TestRules. |
|
RuleList(org.junit.rules.TestRule rule)
Creates a
RuleList containing a single TestRule. |
| Modifier and Type | Method and Description |
|---|---|
RuleList |
add(org.junit.rules.TestRule rule)
Adds a new
TestRule to the end of the current RuleList. |
org.junit.runners.model.Statement |
apply(org.junit.runners.model.Statement base,
org.junit.runner.Description description) |
protected java.util.List<org.junit.rules.TestRule> |
rules()
Returns a reference to the actual list of
TestRules. |
public RuleList()
RuleList.public RuleList(org.junit.rules.TestRule rule)
RuleList containing a single TestRule.rule - the first rule of the RuleListprotected RuleList(java.util.List<org.junit.rules.TestRule> rules)
RuleList containing the specified TestRules.rules - the list of TestRules to addpublic RuleList add(org.junit.rules.TestRule rule)
TestRule to the end of the current RuleList.rule - the rule to add.RuleList with a new TestRule addedpublic org.junit.runners.model.Statement apply(org.junit.runners.model.Statement base,
org.junit.runner.Description description)
apply in interface org.junit.rules.TestRuleprotected java.util.List<org.junit.rules.TestRule> rules()
TestRules. For use by
subclasses and tests.