public final class SpringRunner extends SpringJUnit4ClassRunner
SpringRunner
is an alias for the SpringJUnit4ClassRunner
.
To use this class, simply annotate a JUnit 4 based test class with
@RunWith(SpringRunner.class)
.
If you would like to use the Spring TestContext Framework with a runner other than
this one, use SpringClassRule
and SpringMethodRule
.
NOTE: This class requires JUnit 4.12 or higher.
SpringJUnit4ClassRunner
,
SpringClassRule
,
SpringMethodRule
Constructor and Description |
---|
SpringRunner(Class<?> clazz)
Construct a new
SpringRunner and initialize a
TestContextManager
to provide Spring testing functionality to standard JUnit 4 tests. |
createTest, createTestContextManager, getDescription, getExpectedException, getJUnitTimeout, getSpringTimeout, getTestContextManager, isTestMethodIgnored, methodBlock, possiblyExpectingExceptions, run, runChild, withAfterClasses, withAfters, withBeforeClasses, withBefores, withPotentialRepeat, withPotentialTimeout
collectInitializationErrors, computeTestMethods, describeChild, getChildren, getTestRules, isIgnored, methodInvoker, rules, testName, validateConstructor, validateFields, validateInstanceMethods, validateNoNonStaticInnerClass, validateOnlyOneConstructor, validateTestMethods, validateZeroArgConstructor
childrenInvoker, classBlock, classRules, createTestClass, filter, getName, getRunnerAnnotations, getTestClass, runLeaf, setScheduler, sort, validatePublicVoidNoArgMethods
public SpringRunner(Class<?> clazz) throws InitializationError
SpringRunner
and initialize a
TestContextManager
to provide Spring testing functionality to standard JUnit 4 tests.clazz
- the test class to be runInitializationError
SpringJUnit4ClassRunner.createTestContextManager(Class)