org.junit.runners
Class JUnit4

java.lang.Object
  extended by org.junit.runner.Runner
      extended by org.junit.runners.ParentRunner<FrameworkMethod>
          extended by org.junit.runners.BlockJUnit4ClassRunner
              extended by org.junit.runners.JUnit4
All Implemented Interfaces:
Describable, Filterable, Orderable, Sortable

public final class JUnit4
extends BlockJUnit4ClassRunner

Aliases the current default JUnit 4 class runner, for future-proofing. If future versions of JUnit change the default Runner class, they will also change the definition of this class. Developers wanting to explicitly tag a class as a JUnit 4 class should use @RunWith(JUnit4.class), not, for example in JUnit 4.5, @RunWith(BlockJUnit4ClassRunner.class). This is the only way this class should be used--any extension that depends on the implementation details of this class is likely to break in future versions.

Since:
4.5

Constructor Summary
JUnit4(Class<?> klass)
          Constructs a new instance of the default runner
 
Method Summary
 
Methods inherited from class org.junit.runners.BlockJUnit4ClassRunner
collectInitializationErrors, computeTestMethods, createTest, createTest, describeChild, getChildren, getTestRules, isIgnored, methodBlock, methodInvoker, possiblyExpectingExceptions, rules, runChild, testName, validateConstructor, validateFields, validateInstanceMethods, validateNoNonStaticInnerClass, validateOnlyOneConstructor, validateTestMethods, validateZeroArgConstructor, withAfters, withBefores, withPotentialTimeout
 
Methods inherited from class org.junit.runners.ParentRunner
childrenInvoker, classBlock, classRules, createTestClass, filter, getDescription, getName, getRunnerAnnotations, getTestClass, order, run, runLeaf, setScheduler, sort, validatePublicVoidNoArgMethods, withAfterClasses, withBeforeClasses, withInterruptIsolation
 
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

JUnit4

public JUnit4(Class<?> klass)
       throws InitializationError
Constructs a new instance of the default runner

Throws:
InitializationError


Copyright © 2002–2020 JUnit. All rights reserved.