TestTimeoutEnforcer
public final class TestTimeoutEnforcer
extends ResultForwarder
java.lang.オブジェクト | ||
↳ | 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 (long perTestCaseTimeout, TimeUnit unit, listeners) TestTimeoutEnforcer (long perTestCaseTimeout, TimeUnit unit, listeners) 指定されたタイムアウトを適用して |
パブリックメソッド | |
---|---|
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) |
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) |
田畑
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 。 |
パブリックメソッド
テスト仮定失敗
public void testAssumptionFailure (TestDescription test, FailureDescription failure)
アトミック テストが条件が false であると仮定することを示すフラグを立てたときに呼び出されます。
パラメーター | |
---|---|
test | TestDescription : テストを識別します |
failure | FailureDescription : 失敗とそのコンテキストを説明するFailureDescription 。 |
テスト仮定失敗
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 : 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 : System.currentTimeMillis() によって測定されたテストの開始時刻 |