LogcatCrashResultForwarder

public class LogcatCrashResultForwarder
extends ResultForwarder

java.lang.Object
com.android.tradefed.result.ResultForwarder
  com.android.tradefed.result.LogcatCrashResultForwarder


特別なリスナー: 失敗時(インストゥルメンテーション プロセスがクラッシュした場合)、 ログキャットからクラッシュを抽出して、テストに関連付けられた失敗メッセージに追加しようとします。

概要

定数

String ERROR_MESSAGE

デバイス側で問題が発生した場合のインストゥルメンテーションからの特別なエラー メッセージ。

String INCOMPLETE_MESSAGE

int MAX_NUMBER_CRASH

String SYSTEM_CRASH_MESSAGE

フィールド

public static final List<String> TIMEOUT_MESSAGES

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

LogcatCrashResultForwarder(ITestDevice device, ITestInvocationListener... listeners)

パブリック メソッド

ITestDevice getDevice()
void setPackageName(String packageName)
void testEnded(TestDescription test, long endTime, HashMap<String, MetricMeasurement.Metric> testMetrics)

testEnded(TestDescription,Map) の代替。終了時間を直接指定できます。

void testFailed(TestDescription test, FailureDescription failure)

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

void testFailed(TestDescription test, String trace)

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

void testRunEnded(long elapsedTime, HashMap<String, MetricMeasurement.Metric> runMetrics)

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

void testRunFailed(FailureDescription error)

FailureDescription で記述された失敗により、テスト実行が完了しなかったことを報告します。

void testRunFailed(String errorMessage)

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

void testStarted(TestDescription test, long startTime)

testStarted(TestDescription) の代替。テストが開始された時刻も指定します。正確な測定を行うため、testEnded(TestDescription,long,Map) と組み合わせます。

定数

ERROR_MESSAGE

public static final String ERROR_MESSAGE

デバイス側で問題が発生した場合のインストゥルメンテーションからの特別なエラー メッセージ。

定数値: "Process crashed."

INCOMPLETE_MESSAGE

public static final String INCOMPLETE_MESSAGE

定数値: "Test run failed to complete"

MAX_NUMBER_CRASH

public static final int MAX_NUMBER_CRASH

定数値: 3 (0x00000003)

SYSTEM_CRASH_MESSAGE

public static final String SYSTEM_CRASH_MESSAGE

定数値: "System has crashed."

フィールド

TIMEOUT_MESSAGES

public static final List<String> TIMEOUT_MESSAGES

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

LogcatCrashResultForwarder

public LogcatCrashResultForwarder (ITestDevice device, 
                ITestInvocationListener... listeners)

パラメータ
device ITestDevice

listeners ITestInvocationListener

パブリック メソッド

getDevice

public ITestDevice getDevice ()

戻り値
ITestDevice

setPackageName

public void setPackageName (String packageName)

パラメータ
packageName String

testEnded

public void testEnded (TestDescription test, 
                long endTime, 
                HashMap<String, MetricMeasurement.Metric> testMetrics)

testEnded(TestDescription,Map) の代替。終了時間を直接指定できます。正確な測定を行うため、testStarted(TestDescription,long) と組み合わせます。

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

endTime long: テストが終了した時刻。System.currentTimeMillis() で測定します。

testMetrics HashMap: 出力された指標の Map

testFailed

public void testFailed (TestDescription test, 
                FailureDescription failure)

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

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

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

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

testFailed

public void testFailed (TestDescription test, 
                String trace)

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

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

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

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

testRunEnded

public void testRunEnded (long elapsedTime, 
                HashMap<String, MetricMeasurement.Metric> runMetrics)

テスト実行の終了を報告します。FIXME: 型が異なる 2 つの Map<> インターフェースを使用することはできないため、 ここでは HashMap を使用する必要があります。

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

runMetrics HashMap: Metric を使用してテスト実行の最後に報告された Key-Value ペア。

testRunFailed

public void testRunFailed (FailureDescription error)

FailureDescription で記述された失敗により、テスト実行が完了しなかったことを報告します。

パラメータ
error FailureDescription: 失敗とそのコンテキストを記述する FailureDescription

testRunFailed

public void testRunFailed (String errorMessage)

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

パラメータ
errorMessage String: 実行の失敗理由を記述する String

testStarted

public void testStarted (TestDescription test, 
                long startTime)

testStarted(TestDescription) の代替。テストが開始された時刻も指定します。正確な測定を行うため、testEnded(TestDescription,long,Map) と組み合わせます。

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

startTime long: テストが開始された時刻。System.currentTimeMillis() で測定します。