Class RuleTestRunner

  • All Implemented Interfaces:
    org.junit.runner.Describable, org.junit.runner.manipulation.Filterable, org.junit.runner.manipulation.Sortable

    public class RuleTestRunner
    extends org.junit.runners.ParentRunner<TestDescriptor>
    A JUnit Runner, that executes all declared rule tests in the class. It supports Before and After methods as well as TestRules.
    Author:
    Andreas Dangel
    • Constructor Summary

      Constructors 
      Constructor Description
      RuleTestRunner​(java.lang.Class<? extends RuleTst> testClass)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected org.junit.runner.Description describeChild​(TestDescriptor testCase)  
      protected java.util.List<TestDescriptor> getChildren()  
      boolean hasUnitTests()
      Checks whether this test class has additionally unit test methods.
      protected boolean isIgnored​(TestDescriptor child)  
      protected void runChild​(TestDescriptor testCase, org.junit.runner.notification.RunNotifier notifier)  
      • Methods inherited from class org.junit.runners.ParentRunner

        childrenInvoker, classBlock, classRules, collectInitializationErrors, createTestClass, filter, getDescription, getName, getRunnerAnnotations, getTestClass, run, runLeaf, setScheduler, sort, validatePublicVoidNoArgMethods, withAfterClasses, withBeforeClasses
      • Methods inherited from class org.junit.runner.Runner

        testCount
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • RuleTestRunner

        public RuleTestRunner​(java.lang.Class<? extends RuleTst> testClass)
                       throws org.junit.runners.model.InitializationError
        Throws:
        org.junit.runners.model.InitializationError
    • Method Detail

      • describeChild

        protected org.junit.runner.Description describeChild​(TestDescriptor testCase)
        Specified by:
        describeChild in class org.junit.runners.ParentRunner<TestDescriptor>
      • hasUnitTests

        public boolean hasUnitTests()
        Checks whether this test class has additionally unit test methods.
        Returns:
        true if there is at least one unit test method.
      • getChildren

        protected java.util.List<TestDescriptor> getChildren()
        Specified by:
        getChildren in class org.junit.runners.ParentRunner<TestDescriptor>
      • runChild

        protected void runChild​(TestDescriptor testCase,
                                org.junit.runner.notification.RunNotifier notifier)
        Specified by:
        runChild in class org.junit.runners.ParentRunner<TestDescriptor>
      • isIgnored

        protected boolean isIgnored​(TestDescriptor child)
        Overrides:
        isIgnored in class org.junit.runners.ParentRunner<TestDescriptor>