Class SpringRunner
java.lang.Object
org.junit.runner.Runner
org.junit.runners.ParentRunner<FrameworkMethod>
org.junit.runners.BlockJUnit4ClassRunner
org.springframework.test.context.junit4.SpringJUnit4ClassRunner
org.springframework.test.context.junit4.SpringRunner
- All Implemented Interfaces:
Describable
,Filterable
,Orderable
,Sortable
SpringRunner
is an alias for the SpringJUnit4ClassRunner
.
To use this class, 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.
- Since:
- 4.3
- Author:
- Sam Brannen
- See Also:
-
Constructor Summary
ConstructorDescriptionSpringRunner
(Class<?> clazz) Construct a newSpringRunner
and initialize aTestContextManager
to provide Spring testing functionality to standard JUnit 4 tests. -
Method Summary
Methods inherited from class org.springframework.test.context.junit4.SpringJUnit4ClassRunner
createTest, createTestContextManager, getDescription, getExpectedException, getJUnitTimeout, getSpringTimeout, getTestContextManager, isTestMethodIgnored, methodBlock, possiblyExpectingExceptions, run, runChild, withAfterClasses, withAfters, withAfterTestExecutionCallbacks, withBeforeClasses, withBefores, withBeforeTestExecutionCallbacks, withPotentialRepeat, withPotentialTimeout
Methods inherited from class org.junit.runners.BlockJUnit4ClassRunner
collectInitializationErrors, computeTestMethods, createTest, describeChild, getChildren, getTestRules, isIgnored, methodInvoker, rules, testName, validateConstructor, validateFields, validateInstanceMethods, validateNoNonStaticInnerClass, validateOnlyOneConstructor, validateTestMethods, validateZeroArgConstructor
Methods inherited from class org.junit.runners.ParentRunner
childrenInvoker, classBlock, classRules, createTestClass, filter, getName, getRunnerAnnotations, getTestClass, order, runLeaf, setScheduler, sort, validatePublicVoidNoArgMethods, withInterruptIsolation
-
Constructor Details
-
SpringRunner
Construct a newSpringRunner
and initialize aTestContextManager
to provide Spring testing functionality to standard JUnit 4 tests.- Parameters:
clazz
- the test class to be run- Throws:
InitializationError
- See Also:
-