Package org.junit.runners
Class RuleContainer
java.lang.Object
org.junit.runners.RuleContainer
Data structure for ordering of
TestRule
/MethodRule
instances.- Since:
- 4.13
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final Comparator<RuleContainer.RuleEntry>
private final List<MethodRule>
private final IdentityHashMap<Object,
Integer> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(MethodRule methodRule) void
apply
(FrameworkMethod method, Description description, Object target, Statement statement) Applies all the rules ordered accordingly to the specifiedstatement
.private List<RuleContainer.RuleEntry>
Returns entries in the order how they should be applied, i.e.Returns rule instances in the order how they should be applied, i.e.void
Sets order value for the specified rule.
-
Field Details
-
orderValues
-
testRules
-
methodRules
-
ENTRY_COMPARATOR
-
-
Constructor Details
-
RuleContainer
RuleContainer()
-
-
Method Details
-
setOrder
Sets order value for the specified rule. -
add
-
add
-
getSortedEntries
Returns entries in the order how they should be applied, i.e. inner-to-outer. -
apply
public Statement apply(FrameworkMethod method, Description description, Object target, Statement statement) Applies all the rules ordered accordingly to the specifiedstatement
. -
getSortedRules
Returns rule instances in the order how they should be applied, i.e. inner-to-outer. VisibleForTesting
-