public class RunAfterTestMethodCallbacks extends Statement
RunAfterTestMethodCallbacks
はカスタム JUnit Statement
であり、提供されている TestContextManager
で afterTestMethod()
を呼び出すことにより、Spring TestContext フレームワークを JUnit 実行チェーンにプラグインできます。注意 : このクラスには、JUnit 4.9 以上が必要です。
evaluate()
, RunBeforeTestMethodCallbacks
コンストラクターと説明 |
---|
RunAfterTestMethodCallbacks(Statement next, ObjectSE testInstance, MethodSE testMethod, TestContextManager testContextManager) 新しい RunAfterTestMethodCallbacks ステートメントを作成します。 |
修飾子と型 | メソッドと説明 |
---|---|
void | evaluate() 実行された例外チェーン(通常は RunAfters のインスタンス)の次の Statement を評価し、スローされた例外をキャッチしてから、最初にキャッチされた例外(ある場合)を提供して TestContextManager.afterTestMethod(Object, Method, Throwable) を呼び出します。 |
cloneSE, equalsSE, finalizeSE, getClassSE, hashCodeSE, notifySE, notifyAllSE, toStringSE, waitSE, waitSE, waitSE
public RunAfterTestMethodCallbacks(Statement next, ObjectSE testInstance, MethodSE testMethod, TestContextManager testContextManager)
RunAfterTestMethodCallbacks
ステートメントを作成します。next
- 実行チェーンの次の Statement
testInstance
- 現在のテストインスタンス (非 null
)testMethod
- テストインスタンスで実行されたばかりのテストメソッド testContextManager
- afterTestMethod()
を呼び出す TestContextManager public void evaluate() throws ThrowableSE
RunAfters
のインスタンス)の次の Statement
を評価し、スローされた例外をキャッチしてから、最初にキャッチされた例外(ある場合)を提供して TestContextManager.afterTestMethod(Object, Method, Throwable)
を呼び出します。afterTestMethod()
の呼び出しが例外をスローした場合、その例外も追跡されます。複数の例外が MultipleFailureException
に結合されます。
Statement
の evaluate
ThrowableSE