SpringJUnit4ClassRunner is a custom extension of
BlockJUnit4ClassRunner which provides functionality of the
Spring TestContext Framework to standard JUnit 4.5+ 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)

getDefaultContextLoaderClassName

Get the name of the default ContextLoader class to use for
the supplied test class. The named class will be used if the test class
does not explicitly declare a ContextLoader class via the
@ContextConfiguration annotation.

The default implementation returns null, thus implying use
of the standard default ContextLoader class name.
Can be overridden by subclasses.

run

Check whether the test is enabled in the first place. This prevents
classes with a non-matching @IfProfileValue annotation
from running altogether, even skipping the execution of
prepareTestInstance()TestExecutionListener
methods.

withBeforeClasses

Wraps the Statement returned by the parent implementation with a
RunBeforeTestClassCallbacks statement, thus preserving the
default functionality but adding support for the Spring TestContext
Framework.

withAfterClasses

Wraps the Statement returned by the parent implementation with a
RunAfterTestClassCallbacks statement, thus preserving the default
functionality but adding support for the Spring TestContext Framework.

methodBlock

Furthermore, support for timeouts has been moved down the execution chain
in order to include execution of @Before
and @After methods within the timed
execution. Note that this differs from the default JUnit behavior of
executing @Before and @After methods
in the main thread while executing the actual test method in a separate
thread. Thus, the end effect is that @Before and
@After methods will be executed in the same thread as
the test method. As a consequence, JUnit-specified timeouts will work
fine in combination with Spring transactions. Note that JUnit-specific
timeouts still differ from Spring-specific timeouts in that the former
execute in a separate thread while the latter simply execute in the main
thread (like regular tests).

withBefores

Wraps the Statement returned by the parent implementation with a
RunBeforeTestMethodCallbacks statement, thus preserving the
default functionality but adding support for the Spring TestContext
Framework.

withAfters

Wraps the Statement returned by the parent implementation with a
RunAfterTestMethodCallbacks statement, thus preserving the
default functionality but adding support for the Spring TestContext
Framework.