TestResultListener
public abstract class TestResultListener
extends Object
implements ITestLifeCycleReceiver
java.lang.Object | |
↳ | com.android.tradefed.result.TestResultListener |
個々のテスト結果のみを気にする実装者向けの ITestLifecycleListener の簡素化。
さまざまなライフサイクル イベントをフィルター処理して、testResult メソッドに絞り込みます。
これはスレッド セーフではなく、特に ITestLifecycleListener イベントが順番に受信されることを前提としています。
まとめ
パブリック コンストラクター | |
---|---|
TestResultListener () |
公開メソッド | |
---|---|
final void | testAssumptionFailure ( TestDescription test, String trace) アトミック テストが false の条件を想定していることを示すフラグを立てたときに呼び出されます |
final void | testEnded ( TestDescription test, testMetrics) testEnded ( TestDescription test, testMetrics) 個々のテスト ケースの実行終了を報告します。 |
final void | testEnded ( TestDescription test, long endTime, testMetrics) testEnded ( TestDescription test, long endTime, testMetrics) |
final void | testFailed ( TestDescription test, String trace) 個々のテスト ケースの失敗を報告します。 |
final void | testIgnored ( TestDescription test) 通常、テストメソッドに org.junit.Ignore の注釈が付けられているため、テストが実行されない場合に呼び出されます。 |
abstract void | testResult ( TestDescription test, TestResult result) |
void | testRunEnded (long elapsedTimeMillis, runMetrics) testRunEnded (long elapsedTimeMillis, runMetrics) テスト実行の終了を報告します。 |
final void | testStarted ( TestDescription test, long startTime) |
final void | testStarted ( TestDescription test) 個々のテスト ケースの開始を報告します。 |
パブリック コンストラクター
TestResultListener
public TestResultListener ()
公開メソッド
testAssumptionFailure
public final void testAssumptionFailure (TestDescription test, String trace)
アトミック テストが false の条件を想定していることを示すフラグを立てたときに呼び出されます
パラメーター | |
---|---|
test | TestDescription : テストを識別します |
trace | String : 失敗のスタック トレース |
テスト終了
public final void testEnded (TestDescription test,testMetrics)
個々のテスト ケースの実行終了を報告します。
testFailed(TestDescription, FailureDescription)
が呼び出されなかった場合、このテストは成功しました。また、テスト ケースの実行中に発行された可能性のあるキー/値メトリックも返します。
パラメーター | |
---|---|
test | TestDescription : テストを識別します |
testMetrics | ERROR(/Map) |
テスト終了
public final 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 final void testFailed (TestDescription test, String trace)
個々のテスト ケースの失敗を報告します。
testStarted と testEnded の間で呼び出されます。
パラメーター | |
---|---|
test | TestDescription : テストを識別します |
trace | String : 失敗のスタック トレース |
テスト無視
public final void testIgnored (TestDescription test)
通常、テストメソッドに org.junit.Ignore の注釈が付けられているため、テストが実行されない場合に呼び出されます。
パラメーター | |
---|---|
test | TestDescription : テストを識別します |
テスト結果
public abstract void testResult (TestDescription test, TestResult result)
パラメーター | |
---|---|
test | TestDescription |
result | TestResult |
testRunEnded
public void testRunEnded (long elapsedTimeMillis,runMetrics)
テスト実行の終了を報告します。 FIXME: タイプの異なる 2 つの Map<> インターフェイスを持つことはできないため、ここでは HashMap を使用する必要があります。
パラメーター | |
---|---|
elapsedTimeMillis | long : デバイスが報告した経過時間 (ミリ秒) |
runMetrics | Metric でのテスト実行の最後に報告されるキーと値のペア。 |
テスト開始
public final 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()) を介して測定された、テストの開始時間 |
テスト開始
public final void testStarted (TestDescription test)
個々のテスト ケースの開始を報告します。古いインターフェースでは、可能な限りtestStarted(com.android.tradefed.result.TestDescription)
を使用する必要があります。
パラメーター | |
---|---|
test | TestDescription : テストを識別します |