Class JUnit4Runner

java.lang.Object
org.junit.runner.Runner
org.junit.runners.ParentRunner<org.junit.runners.model.FrameworkMethod>
org.junit.runners.BlockJUnit4ClassRunner
eu.bandm.tools.test.JUnit4Runner
All Implemented Interfaces:
org.junit.runner.Describable, org.junit.runner.manipulation.Filterable, org.junit.runner.manipulation.Sortable

public class JUnit4Runner extends org.junit.runners.BlockJUnit4ClassRunner
Class which filters interactive, future, and currently-under-development tests. Can be activated by annotating some parent class of a test class with @RunWith(eu.bandm.tools.test.JUnit4Runner.class).

Overrides the given class in junit-4.12. Is written be analyzing the source in junit-4.12-sources.jar, as downloaded from https://repo1.maven.org/maven2/junit/junit/4.12/junit-4.12-sources.jar.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    JUnit4Runner(Class<?> klass)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected List<org.junit.runners.model.FrameworkMethod>
    Override the framework method to handle our additional annotations.
    protected void
    Remove the error message in case that no single test method has been found in a particular test class.

    Methods inherited from class org.junit.runners.BlockJUnit4ClassRunner

    collectInitializationErrors, createTest, describeChild, getChildren, getTestRules, isIgnored, methodBlock, methodInvoker, possiblyExpectingExceptions, rules, runChild, testName, validateConstructor, validateFields, validateNoNonStaticInnerClass, validateOnlyOneConstructor, validateTestMethods, validateZeroArgConstructor, withAfters, withBefores, withPotentialTimeout

    Methods inherited from class org.junit.runners.ParentRunner

    childrenInvoker, classBlock, classRules, 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
  • Field Details

  • Constructor Details

    • JUnit4Runner

      public JUnit4Runner(Class<?> klass) throws org.junit.runners.model.InitializationError
      Throws:
      org.junit.runners.model.InitializationError
  • Method Details

    • computeTestMethods

      protected List<org.junit.runners.model.FrameworkMethod> computeTestMethods()
      Override the framework method to handle our additional annotations. If at least one annotation = "{code @Work}"
      then run only those
      else consider all with "Test" and ignore all with "Tocome". Ignore all with "interactice" unless system propertie PROPERTY_INTERACTIVE_TESTS is set.

      ATTENTION: Is not clear and not tested how this interacts with sub-classes of tests, "" and "" and other more complex features of the original software.

      Overrides:
      computeTestMethods in class org.junit.runners.BlockJUnit4ClassRunner
    • validateInstanceMethods

      protected void validateInstanceMethods(List<Throwable> errors)
      Remove the error message in case that no single test method has been found in a particular test class. The super-class method is marked Deprecated, but nevertheless called by the re-engineered code.
      Overrides:
      validateInstanceMethods in class org.junit.runners.BlockJUnit4ClassRunner