Class RunAfterTestClassCallbacks
- java.lang.Object
- org.junit.runners.model.Statement
- org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks
public class RunAfterTestClassCallbacks extends Statement
RunAfterTestClassCallbacks
is a custom JUnitStatement
which allows the Spring TestContext Framework to be plugged into the JUnit execution chain by callingafterTestClass()
on the suppliedTestContextManager
.NOTE: This class requires JUnit 4.9 or higher.
- Since:
- 3.0
- Author:
- Sam Brannen
- See Also:
evaluate()
,RunBeforeTestClassCallbacks
Constructor Summary
Constructors Constructor Description RunAfterTestClassCallbacks(Statement next, TestContextManager testContextManager)
Construct a newRunAfterTestClassCallbacks
statement.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
evaluate()
Evaluate the nextStatement
in the execution chain (typically an instance ofRunAfters
), catching any exceptions thrown, and then invokeTestContextManager.afterTestClass()
.
Constructor Detail
RunAfterTestClassCallbacks
public RunAfterTestClassCallbacks(Statement next, TestContextManager testContextManager)
Construct a newRunAfterTestClassCallbacks
statement.- Parameters:
next
- the nextStatement
in the execution chaintestContextManager
- the TestContextManager upon which to callafterTestClass()
Method Detail
evaluate
public void evaluate() throws Throwable
Evaluate the nextStatement
in the execution chain (typically an instance ofRunAfters
), catching any exceptions thrown, and then invokeTestContextManager.afterTestClass()
.If the invocation of
afterTestClass()
throws an exception, it will also be tracked. Multiple exceptions will be combined into aMultipleFailureException
.