Class RuleContainer

java.lang.Object
org.junit.runners.RuleContainer

class RuleContainer extends Object
Data structure for ordering of TestRule/MethodRule instances.
Since:
4.13
  • Field Details

  • Constructor Details

    • RuleContainer

      RuleContainer()
  • Method Details

    • setOrder

      public void setOrder(Object rule, int order)
      Sets order value for the specified rule.
    • add

      public void add(MethodRule methodRule)
    • add

      public void add(TestRule testRule)
    • getSortedEntries

      private List<RuleContainer.RuleEntry> 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 specified statement.
    • getSortedRules

      List<Object> getSortedRules()
      Returns rule instances in the order how they should be applied, i.e. inner-to-outer. VisibleForTesting