org.springframework.test.context.support
Class DirtiesContextTestExecutionListener
java.lang.Object
org.springframework.test.context.support.AbstractTestExecutionListener
org.springframework.test.context.support.DirtiesContextTestExecutionListener
- All Implemented Interfaces:
- TestExecutionListener
public class DirtiesContextTestExecutionListener
- extends AbstractTestExecutionListener
TestExecutionListener
which processes test methods configured
with the @DirtiesContext
annotation.
- Since:
- 2.5
- Author:
- Sam Brannen, Juergen Hoeller
- See Also:
DirtiesContext
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DirtiesContextTestExecutionListener
public DirtiesContextTestExecutionListener()
afterTestMethod
public void afterTestMethod(TestContext testContext)
throws Exception
If the current test method of the supplied
test context
has been annotated with
@DirtiesContext
, the
application context
of the test context will
be marked as dirty
,
and the
DependencyInjectionTestExecutionListener.REINJECT_DEPENDENCIES_ATTRIBUTE
will be set to true
in the test context.
- Specified by:
afterTestMethod
in interface TestExecutionListener
- Overrides:
afterTestMethod
in class AbstractTestExecutionListener
- Parameters:
testContext
- the test context in which the test method was
executed, not null
- Throws:
Exception
- allows any exception to propagate- See Also:
TestExecutionListener.afterTestMethod(TestContext)
Copyright © 2002-2007 The Spring Framework.