TestRunToTestInvocationForwarder

public class TestRunToTestInvocationForwarder
extends Object implements ITestRunListener

java.lang.Object
com.android.tradefed.result.ddmlib.TestRunToTestInvocationForwarder


ddmlib ITestRunListener から ITestLifeCycleReceiver へのフォワーダ。ddmlib インターフェースから Tradefed インターフェースへの結果の変換を保証するインターフェース。

Ddmlib インターフェースは、実行中のインストルメンテーション テストにリンクされています。

概要

定数

String ERROR_MESSAGE_FORMAT

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

TestRunToTestInvocationForwarder(ITestLifeCycleReceiver listener)
TestRunToTestInvocationForwarder(Collection<ITestLifeCycleReceiver> listeners)

パブリック メソッド

void testAssumptionFailure(TestIdentifier testId, String trace)

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

void testEnded(TestIdentifier testId, Map<String, String> testMetrics)

個々のテストケースの実行終了を報告します。

void testFailed(TestIdentifier testId, String trace)

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

void testIgnored(TestIdentifier testId)

テストが実行されない場合に呼び出されます。通常、テストメソッドに org.junit.Ignore. のアノテーションが付けられていることが原因です。

void testRunEnded(long elapsedTime, Map<String, String> runMetrics)

テスト実行の終了を報告します。

void testRunFailed(String failure)

致命的なエラーによりテスト実行を完了できなかったことを報告します。

void testRunStarted(String runName, int testCount)

テスト実行の開始を報告します。

void testRunStopped(long elapsedTime)

ユーザー リクエストにより、完了前にテスト実行が停止したことを報告します。

void testStarted(TestIdentifier testId)

個々のテストケースの開始を報告します。

定数

ERROR_MESSAGE_FORMAT

public static final String ERROR_MESSAGE_FORMAT

定数値: "Runner reported an invalid method '%s' (%s). Something went wrong, Skipping its reporting.」

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

TestRunToTestInvocationForwarder

public TestRunToTestInvocationForwarder (ITestLifeCycleReceiver listener)

パラメータ
listener ITestLifeCycleReceiver

TestRunToTestInvocationForwarder

public TestRunToTestInvocationForwarder (Collection<ITestLifeCycleReceiver> listeners)

パラメータ
listeners Collection

パブリック メソッド

testAssumptionFailure

public void testAssumptionFailure (TestIdentifier testId, 
                String trace)

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

パラメータ
testId TestIdentifier: テストを識別します。

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

testEnded

public void testEnded (TestIdentifier testId, 
                Map<String, String> testMetrics)

個々のテストケースの実行終了を報告します。

testFailed(TestIdentifier, String) が呼び出されなかった場合、このテストは合格です。また、テストケースの実行中に生成された Key-Value 指標も返します。

パラメータ
testId TestIdentifier: テストを識別します。

testMetrics Map: テストケースの実行中に生成された指標の Mapandroid.app.Instrumentation#sendStatus によって。同じキーを複数回生成しない限り、挿入順序は保持されます 。IInstrumentationResultParser.StatusKeys で定義されている標準キーは、この Map から除外されます。Ddmlib は、 IInstrumentationResultParser.StatusKeys で定義されている追加のテスト指標を追加する場合があります。

testFailed

public void testFailed (TestIdentifier testId, 
                String trace)

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

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

パラメータ
testId TestIdentifier: テストを識別します。

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

testIgnored

public void testIgnored (TestIdentifier testId)

テストが実行されない場合に呼び出されます。通常、テストメソッドに org.junit.Ignore のアノテーションが付けられていることが原因です。

パラメータ
testId TestIdentifier: テストを識別します。

testRunEnded

public void testRunEnded (long elapsedTime, 
                Map<String, String> runMetrics)

テスト実行の終了を報告します。

パラメータ
elapsedTime long: デバイスから報告された経過時間(ミリ秒)。

runMetrics Map: android.app.Instrumentation#addResults によってテストケースの実行中に生成された指標の Map。同じキーを複数回生成しない限り、挿入順序は保持されます 。IInstrumentationResultParser.StatusKeys で定義されている標準キーは、この Map から除外されます。Ddmlib は、 IInstrumentationResultParser.StatusKeys で定義されている追加のテスト指標を追加する場合があります。

testRunFailed

public void testRunFailed (String failure)

致命的なエラーによりテスト実行を完了できなかったことを報告します。

パラメータ
failure String: 実行の失敗理由を説明する String

testRunStarted

public void testRunStarted (String runName, 
                int testCount)

テスト実行の開始を報告します。

パラメータ
runName String: テスト実行名。

testCount int: テスト実行のテストの合計数。

testRunStopped

public void testRunStopped (long elapsedTime)

ユーザー リクエストにより、完了前にテスト実行が停止したことを報告します。

パラメータ
elapsedTime long: デバイスから報告された経過時間(ミリ秒)。

testStarted

public void testStarted (TestIdentifier testId)

個々のテストケースの開始を報告します。

パラメータ
testId TestIdentifier: テストを識別します。