## org.springframework.test.context.support
Class AbstractTestExecutionListener

    java.lang.Object
      org.springframework.test.context.support.AbstractTestExecutionListener

All Implemented Interfaces:
  TestExecutionListener

Direct Known Subclasses:
  DependencyInjectionTestExecutionListener, DirtiesContextTestExecutionListener, TransactionalTestExecutionListener

    public abstract class AbstractTestExecutionListener

extends Object
implements TestExecutionListener

Abstract implementation of the `TestExecutionListener` interface which provides empty method stubs. Subclasses can extend this class and override only those methods suitable for the task at hand.

Since:
  2.5
Author:
  Sam Brannen, Juergen Hoeller

Constructor Summary
`AbstractTestExecutionListener()`

Method Summary
`void` `afterTestClass(TestContext testContext)` The default implementation is empty.
`void` `afterTestMethod(TestContext testContext)` The default implementation is empty.
`void` `beforeTestClass(TestContext testContext)` The default implementation is empty.
`void` `beforeTestMethod(TestContext testContext)` The default implementation is empty.
`void` `prepareTestInstance(TestContext testContext)` The default implementation is empty.

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

Constructor Detail

### AbstractTestExecutionListener

    public AbstractTestExecutionListener()

Method Detail

### beforeTestClass

    public void beforeTestClass(TestContext testContext)
                         throws Exception

  The default implementation is empty. Can be overridden by subclasses as necessary.

  Specified by:
    `beforeTestClass` in interface `TestExecutionListener`
  Parameters:
    `testContext` - the test context for the test; never `null`
  Throws:
    `Exception` - allows any exception to propagate

### prepareTestInstance

    public void prepareTestInstance(TestContext testContext)
                             throws Exception

  The default implementation is empty. Can be overridden by subclasses as necessary.

  Specified by:
    `prepareTestInstance` in interface `TestExecutionListener`
  Parameters:
    `testContext` - the test context for the test; never `null`
  Throws:
    `Exception` - allows any exception to propagate

### beforeTestMethod

    public void beforeTestMethod(TestContext testContext)
                          throws Exception

  The default implementation is empty. Can be overridden by subclasses as necessary.

  Specified by:
    `beforeTestMethod` in interface `TestExecutionListener`
  Parameters:
    `testContext` - the test context in which the test method will be executed; never `null`
  Throws:
    `Exception` - allows any exception to propagate

### afterTestMethod

    public void afterTestMethod(TestContext testContext)
                         throws Exception

  The default implementation is empty. Can be overridden by subclasses as necessary.

  Specified by:
    `afterTestMethod` in interface `TestExecutionListener`
  Parameters:
    `testContext` - the test context in which the test method was executed; never `null`
  Throws:
    `Exception` - allows any exception to propagate

### afterTestClass

    public void afterTestClass(TestContext testContext)
                        throws Exception

  The default implementation is empty. Can be overridden by subclasses as necessary.

  Specified by:
    `afterTestClass` in interface `TestExecutionListener`
  Parameters:
    `testContext` - the test context for the test; never `null`
  Throws:
    `Exception` - allows any exception to propagate