|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.junit.runner.Runner org.junit.internal.runners.JUnit4ClassRunner org.springframework.test.context.junit4.SpringJUnit4ClassRunner
public class SpringJUnit4ClassRunner
SpringJUnit4ClassRunner is a custom extension of JUnit4ClassRunner
which provides functionality of the Spring TestContext Framework
to standard JUnit 4.4+ tests by means of the TestContextManager
and
associated support classes and annotations.
The following list constitutes all annotations currently supported directly
by SpringJUnit4ClassRunner.
(Note that additional annotations may be supported by various
TestExecutionListeners
)
@Test(expected=...)
@ExpectedException
@Test(timeout=...)
@Timed
@Repeat
@Ignore
@ProfileValueSourceConfiguration
@IfProfileValue
TestContextManager
Constructor Summary | |
---|---|
SpringJUnit4ClassRunner(Class<?> clazz)
Constructs a new SpringJUnit4ClassRunner and initializes a
TestContextManager to provide Spring testing functionality to
standard JUnit tests. |
Method Summary | |
---|---|
protected Object |
createTest()
Delegates to JUnit4ClassRunner.createTest() to create the test
instance and then to a TestContextManager to
prepare the test
instance for Spring testing functionality. |
protected TestContextManager |
createTestContextManager(Class<?> clazz)
Creates a new TestContextManager . |
protected TestContextManager |
getTestContextManager()
Get the TestContextManager associated with this runner. |
protected void |
invokeTestMethod(Method method,
RunNotifier notifier)
Invokes the supplied test method and notifies the supplied
RunNotifier of the appropriate events. |
void |
run(RunNotifier notifier)
|
Methods inherited from class org.junit.internal.runners.JUnit4ClassRunner |
---|
classAnnotations, filter, getDescription, getName, getTestClass, getTestMethods, methodDescription, runMethods, sort, testAnnotations, testName, validate, wrapMethod |
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 |
---|
public SpringJUnit4ClassRunner(Class<?> clazz) throws org.junit.internal.runners.InitializationError
SpringJUnit4ClassRunner
and initializes a
TestContextManager
to provide Spring testing functionality to
standard JUnit tests.
clazz
- the Class object corresponding to the test class to be run
org.junit.internal.runners.InitializationError
createTestContextManager(Class)
Method Detail |
---|
public void run(RunNotifier notifier)
run
in class org.junit.internal.runners.JUnit4ClassRunner
protected Object createTest() throws Exception
JUnit4ClassRunner.createTest()
to create the test
instance and then to a TestContextManager
to
prepare
the test
instance for Spring testing functionality.
createTest
in class org.junit.internal.runners.JUnit4ClassRunner
Exception
JUnit4ClassRunner.createTest()
,
TestContextManager.prepareTestInstance(Object)
protected TestContextManager createTestContextManager(Class<?> clazz)
TestContextManager
. Can be overridden by subclasses.
clazz
- the Class object corresponding to the test class to be managedprotected final TestContextManager getTestContextManager()
TestContextManager
associated with this runner.
protected void invokeTestMethod(Method method, RunNotifier notifier)
test method
and notifies the supplied
RunNotifier
of the appropriate events.
invokeTestMethod
in class org.junit.internal.runners.JUnit4ClassRunner
createTest()
,
JUnit4ClassRunner.invokeTestMethod(Method,RunNotifier)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |