TestTimeoutEnforcer

public final class TestTimeoutEnforcer
extends ResultForwarder

java.lang.Object
com.android.tradefed.result.ResultForwarder
com.android.tradefed.testtype.TestTimeoutEnforcer


特定のテスト ケースの実行時間をチェックし、特定のタイムアウトを超えた場合に失敗させることができるリスナー。

このエンフォーサーはテストを中断しませんが、テストを失敗させることに注意してください。

まとめ

田畑

public static final String TEST_CASE_TIMEOUT_DESCRIPTION

public static final String TEST_CASE_TIMEOUT_OPTION

パブリック コンストラクター

TestTimeoutEnforcer (long perTestCaseTimeout, TimeUnit unit, ITestInvocationListener... listeners)

強制する指定されたタイムアウトでTestTimeoutEnforcerを作成します。

TestTimeoutEnforcer (long perTestCaseTimeout, TimeUnit unit, listeners) TestTimeoutEnforcer (long perTestCaseTimeout, TimeUnit unit, listeners)

強制する指定されたタイムアウトでTestTimeoutEnforcerを作成します。

公開メソッド

void testAssumptionFailure ( TestDescription test, FailureDescription failure)

アトミック テストが false の条件を想定していることを示すフラグを立てたときに呼び出されます

void testAssumptionFailure ( TestDescription test, String trace)

アトミック テストが false の条件を想定していることを示すフラグを立てたときに呼び出されます

void testEnded ( TestDescription test, long endTime, testMetrics) testEnded ( TestDescription test, long endTime, testMetrics)

ERROR(/#testEnded(com.android.tradefed.result.TestDescription,Map))の代わりに、終了時間を直接指定できます。

void testFailed ( TestDescription test, FailureDescription failure)

個々のテスト ケースの失敗を報告します。

void testFailed ( TestDescription test, String trace)

個々のテスト ケースの失敗を報告します。

void testIgnored ( TestDescription test)

通常、テストメソッドに org.junit.Ignore の注釈が付けられているため、テストが実行されない場合に呼び出されます。

void testStarted ( TestDescription test, long startTime)

testStarted(com.android.tradefed.result.TestDescription)の代わりに、正確な測定のためERROR(/#testEnded(com.android.tradefed.result.TestDescription,long,Map))と組み合わせて、テストの開始時期も指定します。 .

田畑

TEST_CASE_TIMEOUT_DESCRIPTION

public static final String TEST_CASE_TIMEOUT_DESCRIPTION

TEST_CASE_TIMEOUT_OPTION

public static final String TEST_CASE_TIMEOUT_OPTION

パブリック コンストラクター

TestTimeoutEnforcer

public TestTimeoutEnforcer (long perTestCaseTimeout, 
                TimeUnit unit, 
                ITestInvocationListener... listeners)

強制する指定されたタイムアウトでTestTimeoutEnforcerを作成します。

パラメーター
perTestCaseTimeout long : タイムアウトの値。

unit TimeUnit : perTestCaseTimeout のERROR(/TimeUnit)

listeners ITestInvocationListener : 転送先のITestInvocationListener

TestTimeoutEnforcer

public TestTimeoutEnforcer (long perTestCaseTimeout, 
                TimeUnit unit, 
                 listeners)

強制する指定されたタイムアウトでTestTimeoutEnforcerを作成します。

パラメーター
perTestCaseTimeout long : タイムアウトの値。

unit TimeUnit : perTestCaseTimeout のERROR(/TimeUnit)

listeners : 転送先のITestInvocationListener

公開メソッド

testAssumptionFailure

public void testAssumptionFailure (TestDescription test, 
                FailureDescription failure)

アトミック テストが false の条件を想定していることを示すフラグを立てたときに呼び出されます

パラメーター
test TestDescription : テストを識別します

failure FailureDescription : 失敗とそのコンテキストを説明するFailureDescription

testAssumptionFailure

public void testAssumptionFailure (TestDescription test, 
                String trace)

アトミック テストが false の条件を想定していることを示すフラグを立てたときに呼び出されます

パラメーター
test TestDescription : テストを識別します

trace String : 失敗のスタック トレース

テスト終了

public void testEnded (TestDescription test, 
                long endTime, 
                 testMetrics)

ERROR(/#testEnded(com.android.tradefed.result.TestDescription,Map))の代わりに、終了時間を直接指定できます。正確な測定のためにtestStarted(com.android.tradefed.result.TestDescription, long)と組み合わせます。

パラメーター
test TestDescription : テストを識別します

endTime long : ERROR(/System#currentTimeMillis())を介して測定された、テストが終了した時間

testMetrics : 発行されたメトリックのERROR(/Map)

テスト失敗

public void testFailed (TestDescription test, 
                FailureDescription failure)

個々のテスト ケースの失敗を報告します。

testStarted と testEnded の間で呼び出されます。

パラメーター
test TestDescription : テストを識別します

failure FailureDescription : 失敗とそのコンテキストを説明するFailureDescription

テスト失敗

public void testFailed (TestDescription test, 
                String trace)

個々のテスト ケースの失敗を報告します。

testStarted と testEnded の間で呼び出されます。

パラメーター
test TestDescription : テストを識別します

trace String : 失敗のスタック トレース

テスト無視

public void testIgnored (TestDescription test)

通常、テストメソッドに org.junit.Ignore の注釈が付けられているため、テストが実行されない場合に呼び出されます。

パラメーター
test TestDescription : テストを識別します

テスト開始

public void testStarted (TestDescription test, 
                long startTime)

testStarted(com.android.tradefed.result.TestDescription)の代わりに、正確な測定のためERROR(/#testEnded(com.android.tradefed.result.TestDescription,long,Map))と組み合わせて、テストの開始時期も指定します。 .

パラメーター
test TestDescription : テストを識別します

startTime long : ERROR(/System#currentTimeMillis())を介して測定された、テストの開始時間