LogcatCrashResultForwarder

public class LogcatCrashResultForwarder
extends ResultForwarder

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


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

概要

定数

String ERROR_MESSAGE

デバイス側で問題が発生した場合の計測からの特別なエラー メッセージ。

String INCOMPLETE_MESSAGE

int MAX_NUMBER_CRASH

String SYSTEM_CRASH_MESSAGE

フィールド

public static final TIMEOUT_MESSAGES

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

LogcatCrashResultForwarder(ITestDevice device, ITestInvocationListener... listeners)

パブリック メソッド

ITestDevice getDevice()
void setPackageName(String packageName)
void 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 testRunEnded(long elapsedTime, runMetrics)

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

void testRunFailed(FailureDescription error)

FailureDescription で説明されているエラーのため、テスト実行を完了できなかったことを報告します。

void testRunFailed(String errorMessage)

致命的なエラーのため、レポートのテスト実行を完了できませんでした。

void testStarted(TestDescription test, long startTime)

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

定数

ERROR_MESSAGE

public static final String ERROR_MESSAGE

デバイス側で問題が発生した場合の計測からの特別なエラー メッセージ。

定数値: 「プロセスがクラッシュしました。」

INCOMPLETE_MESSAGE

public static final String INCOMPLETE_MESSAGE

定数値: 「テスト実行を完了できませんでした」

MAX_NUMBER_CRASH

public static final int MAX_NUMBER_CRASH

定数値: 3 (0x00000003)

SYSTEM_CRASH_MESSAGE

public static final String SYSTEM_CRASH_MESSAGE

定数値: 「システムがクラッシュしました。」

フィールド

TIMEOUT_MESSAGES

public static final  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, 
                 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)

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, 
                 runMetrics)

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

パラメータ
elapsedTime long: デバイスが報告した経過時間(ミリ秒単位)

runMetrics : テスト実行の最後にレポートされる 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(com.android.tradefed.result.TestDescription) の代替。ERROR(/#testEnded(com.android.tradefed.result.TestDescription,long,Map)) と組み合わせて正確な測定を行います。

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

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