The Spring Framework

## 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`

Constructor Summary
`DirtiesContextTestExecutionListener()`

Method Summary
`void` `afterTestMethod(TestContext testContext)` 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.

Methods inherited from class org.springframework.test.context.support.AbstractTestExecutionListener
`beforeTestMethod, prepareTestInstance`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### DirtiesContextTestExecutionListener

    public DirtiesContextTestExecutionListener()

Method Detail

### 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 (never `null`)
  Throws:
    `Exception` - allows any exception to propagate

The Spring Framework

Copyright © 2002-2008 The Spring Framework.