クラス AbstractTestNGSpringContextTests

java.lang.ObjectSE
org.springframework.test.context.testng.AbstractTestNGSpringContextTests
実装されたすべてのインターフェース:
AwareApplicationContextAwareorg.testng.IHookableorg.testng.ITestNGListener
既知の直属サブクラス
AbstractTransactionalTestNGSpringContextTests

public abstract class AbstractTestNGSpringContextTests extends ObjectSE implements org.testng.IHookable, ApplicationContextAware
Spring TestContext フレームワークを、TestNG 環境での明示的な ApplicationContext テストサポートと統合する抽象基本テストクラス。

具象サブクラスは、通常、クラスレベルの @ContextConfiguration アノテーションを宣言して、アプリケーションコンテキスト リソースの場所またはコンポーネントクラスを構成する必要があります。具象サブクラスには、暗黙的または明示的に super(); に委譲するコンストラクターも必要です。

導入:
2.5
作成者:
Sam Brannen, Juergen Hoeller
関連事項:
  • フィールドの詳細

  • コンストラクターの詳細

    • AbstractTestNGSpringContextTests

      public AbstractTestNGSpringContextTests()
      新しい AbstractTestNGSpringContextTests インスタンスを作成し、現在のテストクラスの内部 TestContextManager を初期化します。
  • メソッドの詳細

    • setApplicationContext

      public final void setApplicationContext(ApplicationContext applicationContext)
      ApplicationContextAware セマンティクスを介して提供される、このテストインスタンスによって使用される ApplicationContext を設定します。
      次で指定:
      インターフェース ApplicationContextAwaresetApplicationContext 
      パラメーター:
      applicationContext - このテストが実行される ApplicationContext
      関連事項:
    • springTestContextBeforeTestClass

      @BeforeClass(alwaysRun=true) protected void springTestContextBeforeTestClass() throws ExceptionSE
      「テストクラスの前」コールバックを呼び出すように構成された TestContextManager にデリゲートします。
      例外:
      ExceptionSE - 登録された TestExecutionListener が例外をスローした場合
    • springTestContextPrepareTestInstance

      @BeforeClass(alwaysRun=true, dependsOnMethods="springTestContextBeforeTestClass") protected void springTestContextPrepareTestInstance() throws ExceptionSE
      依存関係の注入など、個々のテストを実行する前にこのテストインスタンスを準備するように構成された TestContextManager に委譲します。
      例外:
      ExceptionSE - 登録された TestExecutionListener が例外をスローした場合
    • springTestContextBeforeTestMethod

      @BeforeMethod(alwaysRun=true) protected void springTestContextBeforeTestMethod(MethodSE testMethod) throws ExceptionSE
      実際のテストが実行される前にテストメソッドを前処理するように構成された TestContextManager に委譲します。
      パラメーター:
      testMethod - 実行しようとしているテストメソッド
      例外:
      ExceptionSE - すべての例外の伝播を許可します
    • run

      public void run(org.testng.IHookCallBack callBack, org.testng.ITestResult testResult)
      提供された callback のテストメソッドにデリゲートして実際のテストを実行し、テストの実行中にスローされた例外があれば、それを追跡します。
      次で指定:
      インターフェース org.testng.IHookablerun 
      関連事項:
      • IHookable.run(IHookCallBack, ITestResult)
    • springTestContextAfterTestMethod

      @AfterMethod(alwaysRun=true) protected void springTestContextAfterTestMethod(MethodSE testMethod) throws ExceptionSE
      実際のテストの実行後にテストメソッドを後処理するように構成された TestContextManager に委譲します。
      パラメーター:
      testMethod - テストインスタンスで実行されたばかりのテストメソッド
      例外:
      ExceptionSE - すべての例外の伝播を許可します
    • springTestContextAfterTestClass

      @AfterClass(alwaysRun=true) protected void springTestContextAfterTestClass() throws ExceptionSE
      「テスト後」コールバックを呼び出すように構成された TestContextManager にデリゲートします。
      例外:
      ExceptionSE - 登録された TestExecutionListener が例外をスローした場合