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

@PropertyDependency("eu.bandm.tools.test.interactiveTests") 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 Link icon

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

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

    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 Link icon

    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 Link icon

    childrenInvoker, classBlock, classRules, createTestClass, filter, getDescription, getName, getRunnerAnnotations, getTestClass, run, runLeaf, setScheduler, sort, validatePublicVoidNoArgMethods, withAfterClasses, withBeforeClasses

    Methods inherited from class org.junit.runner.Runner Link icon

    testCount

    Methods inherited from class java.lang.Object Link icon

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details Link icon

  • Constructor Details Link icon

    • JUnit4Runner Link icon

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

    • computeTestMethods Link icon

      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, "@Before" and "@After" and other more complex features of the original software.

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

      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