ProtoResultReporter

public abstract class ProtoResultReporter
extends Object implements ILogSaverListener, ISupportGranularResults, ITestInvocationListener

java.lang.Object
   ↳ com.android.tradefed.result.proto.ProtoResultReporter


結果レポーターは、すべての結果を含む TestRecord protobuf をビルドします。processFinalProto(TestRecord) の最終的な proto の処理方法を扱うように拡張する必要があります。

概要

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

ProtoResultReporter()

パブリック メソッド

final void invocationEnded(long elapsedTime)

呼び出しが終了したことを報告します(成功した場合も、エラー条件が原因で終了した場合も同様です)。

void invocationFailed(FailureDescription failure)

エラー条件のため、呼び出しが不完全であることを報告します。

void invocationFailed(Throwable cause)

エラー条件のため、呼び出しが不完全であることを報告します。

void invocationSkipped(SkipReason reason)

呼び出しをスキップとして報告します。

void invocationStarted(IInvocationContext context)

テスト呼び出しの開始を報告します。

final void logAssociation(String dataName, LogFile logFile)

場合によっては、ログをテストケースに強く関連付ける必要がありますが、直接の testLogSaved(String,LogDataType,InputStreamSource,LogFile) コールバックでそれを行うことはできません。

void processFinalInvocationLogs(TestRecordProto.TestRecord invocationLogs)

呼び出しレコードを使用して、呼び出しの最終ログを 1 つずつ送信します。

void processFinalProto(TestRecordProto.TestRecord finalRecord)

すべての結果を含む最終的な proto の処理。

void processStartInvocation(TestRecordProto.TestRecord invocationStartRecord, IInvocationContext invocationContext)

invocationStarted(IInvocationContext) の発生後の部分的な呼び出し検査記録 proto の処理。

void processTestCaseEnded(TestRecordProto.TestRecord testCaseRecord)

testEnded(TestDescription,long,HashMap) の発生後の確定済みテストケース レコード proto の処理。

void processTestCaseStarted(TestRecordProto.TestRecord testCaseStartedRecord)

testStarted(TestDescription,long) の発生後の部分的なテストケース レコード proto の処理。

void processTestModuleEnd(TestRecordProto.TestRecord moduleRecord)

testModuleEnded() の発生後の最終的なモジュール レコード proto の処理。

void processTestModuleStarted(TestRecordProto.TestRecord moduleStartRecord)

testModuleStarted(IInvocationContext) の発生後の部分モジュール レコード proto の処理。

void processTestRunEnded(TestRecordProto.TestRecord runRecord, boolean moduleInProgress)

testRunEnded(long,HashMap) の発生後の最終的な実行レコード proto の処理。

void processTestRunStarted(TestRecordProto.TestRecord runStartedRecord)

testRunStarted(String,int) の発生後の部分的なテスト実行レコード proto の処理。

void setGranularResults(boolean granularResults)
void setInlineRecordOfChildren(boolean inline)
boolean supportGranularResults()

レポートが詳細な結果をサポートしている場合は True、そうでない場合は False を返します。

final void testAssumptionFailure(TestDescription test, String trace)

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

final void testAssumptionFailure(TestDescription test, FailureDescription failure)

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

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

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

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

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

final void testFailed(TestDescription test, FailureDescription failure)

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

final void testFailed(TestDescription test, String trace)

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

final void testIgnored(TestDescription test)

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

final void testModuleEnded()

モジュール実行の終了を報告します。

final void testModuleStarted(IInvocationContext moduleContext)

モジュールの実行の開始を報告します。

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

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

final void testRunFailed(FailureDescription failure)

FailureDescription で説明されているエラーのため、レポート テスト実行を完了できませんでした。

final void testRunFailed(String errorMessage)

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

void testRunStarted(String runName, int testCount, int attemptNumber)

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

final void testRunStarted(String runName, int testCount)

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

void testRunStarted(String runName, int testCount, int attemptNumber, long startTime)

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

final void testSkipped(TestDescription test, SkipReason reason)

テストがスキップされ、通常は想定されない理由で実行されなかった場合に呼び出されます。

final void testStarted(TestDescription test, long startTime)

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

final void testStarted(TestDescription test)

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

保護されたメソッド

void afterModuleEnd()
void beforeModuleStart()
TestRecordProto.ChildReference createModuleChildReference(TestRecordProto.TestRecord record)

モジュールの子供の参照を作成します。

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

ProtoResultReporter

public ProtoResultReporter ()

パブリック メソッド

invocationEnded

public final void invocationEnded (long elapsedTime)

呼び出しが終了したことを報告します(成功した場合も、エラー条件が原因で終了した場合も同様です)。

TradeFederation フレームワークによって自動的に呼び出されます。

パラメータ
elapsedTime long: 呼び出しの経過時間(ミリ秒単位)

invocationFailed

public void invocationFailed (FailureDescription failure)

エラー条件のため、呼び出しが不完全であることを報告します。

TradeFederation フレームワークによって自動的に呼び出されます。

パラメータ
failure FailureDescription: 障害の原因を説明する FailureDescription

invocationFailed

public void invocationFailed (Throwable cause)

エラー条件のため、呼び出しが不完全であることを報告します。

TradeFederation フレームワークによって自動的に呼び出されます。

パラメータ
cause Throwable: 失敗の Throwable 原因

invocationSkipped

public void invocationSkipped (SkipReason reason)

呼び出しをスキップとして報告する

パラメータ
reason SkipReason

invocationStarted

public void invocationStarted (IInvocationContext context)

テスト呼び出しの開始を報告します。

TradeFederation フレームワークによって自動的に呼び出されます。複数のデバイスのレポートをサポートするには、レポート作成者がこのメソッドをオーバーライドする必要があります。

パラメータ
context IInvocationContext: 呼び出しに関する情報

logAssociation

public final void logAssociation (String dataName, 
                LogFile logFile)

ログをテストケースに強く関連付ける必要がある場合もありますが、直接の testLogSaved(String,LogDataType,InputStreamSource,LogFile) コールバックでそれを行うことはできません。したがって、このコールバックを使用すると、強力な関連付けを明示的に指定できます。

パラメータ
dataName String: データの名前

logFile LogFile: 以前にロギングされ、テストケースに関連付ける必要がある LogFile

processFinalInvocationLogs

public void processFinalInvocationLogs (TestRecordProto.TestRecord invocationLogs)

呼び出しレコードを使用して、呼び出しの最終ログを 1 つずつ送信します。

パラメータ
invocationLogs TestRecordProto.TestRecord: 呼び出しを表す最終的な proto。

processFinalProto

public void processFinalProto (TestRecordProto.TestRecord finalRecord)

すべての結果を含む最終的な proto の処理。

パラメータ
finalRecord TestRecordProto.TestRecord: すべての呼び出し結果を含む最終的な proto。

processStartInvocation

public void processStartInvocation (TestRecordProto.TestRecord invocationStartRecord, 
                IInvocationContext invocationContext)

invocationStarted(IInvocationContext) の発生後の部分的な呼び出し検査記録 proto の処理。

パラメータ
invocationStartRecord TestRecordProto.TestRecord: invocationStart の後に設定される部分的な proto。

invocationContext IInvocationContext: 呼び出し IInvocationContext

processTestCaseEnded

public void processTestCaseEnded (TestRecordProto.TestRecord testCaseRecord)

testEnded(TestDescription,long,HashMap) の発生後の確定済みテストケース レコード proto の処理。

パラメータ
testCaseRecord TestRecordProto.TestRecord: テストケースを表す最終的な proto。

processTestCaseStarted

public void processTestCaseStarted (TestRecordProto.TestRecord testCaseStartedRecord)

testStarted(TestDescription,long) の発生後の部分的なテストケース レコード proto の処理。

パラメータ
testCaseStartedRecord TestRecordProto.TestRecord: テストケースを表す部分的な proto。

processTestModuleEnd

public void processTestModuleEnd (TestRecordProto.TestRecord moduleRecord)

testModuleEnded() の発生後の最終的なモジュール レコード proto の処理。

パラメータ
moduleRecord TestRecordProto.TestRecord: モジュールを表す最終的な proto。

processTestModuleStarted

public void processTestModuleStarted (TestRecordProto.TestRecord moduleStartRecord)

testModuleStarted(IInvocationContext) の発生後の部分モジュール レコード proto の処理。

パラメータ
moduleStartRecord TestRecordProto.TestRecord: モジュールを表す部分的な proto。

processTestRunEnded

public void processTestRunEnded (TestRecordProto.TestRecord runRecord, 
                boolean moduleInProgress)

testRunEnded(long,HashMap) の発生後の最終的な実行レコード proto の処理。

パラメータ
runRecord TestRecordProto.TestRecord: 実行を表すファイナライズされた proto。

moduleInProgress boolean: モジュールが進行中かどうか。

processTestRunStarted

public void processTestRunStarted (TestRecordProto.TestRecord runStartedRecord)

testRunStarted(String,int) の発生後の部分的なテスト実行レコード proto の処理。

パラメータ
runStartedRecord TestRecordProto.TestRecord: 実行を表す部分的な proto。

setGranularResults

public void setGranularResults (boolean granularResults)

パラメータ
granularResults boolean

setInlineRecordOfChildren

public void setInlineRecordOfChildren (boolean inline)

パラメータ
inline boolean

supportGranularResults

public boolean supportGranularResults ()

レポートが詳細な結果をサポートしている場合は True、そうでない場合は False を返します。

戻り値
boolean

testAssumptionFailure

public final void testAssumptionFailure (TestDescription test, 
                String trace)

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

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

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

testAssumptionFailure

public final void testAssumptionFailure (TestDescription test, 
                FailureDescription failure)

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

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

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

testEnded

public final 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

testEnded

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

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

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

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

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

testFailed

public final void testFailed (TestDescription test, 
                FailureDescription failure)

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

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

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

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

testFailed

public final void testFailed (TestDescription test, 
                String trace)

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

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

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

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

testIgnored

public final void testIgnored (TestDescription test)

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

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

testModuleEnded

public final void testModuleEnded ()

モジュール実行の終了を報告します。

testModuleStarted

public final void testModuleStarted (IInvocationContext moduleContext)

モジュールの実行開始を報告します。このコールバックは testModuleEnded() に関連付けられており、シーケンスでは省略可能です。モジュールを使用する実行(スイートベースのランナー)でのみ使用されます。

パラメータ
moduleContext IInvocationContext: モジュールの IInvocationContext

testRunEnded

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

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

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

runMetrics HashMap: Metric を使用したテスト実行の最後にレポートされる Key-Value ペア。

testRunFailed

public final void testRunFailed (FailureDescription failure)

FailureDescription で説明されているエラーのため、レポート テスト実行を完了できませんでした。

パラメータ
failure FailureDescription: 失敗とそのコンテキストを説明する FailureDescription

testRunFailed

public final void testRunFailed (String errorMessage)

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

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

testRunStarted

public void testRunStarted (String runName, 
                int testCount, 
                int attemptNumber)

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

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

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

attemptNumber int: 実行名が同じで複数回実行される異なる試行を識別する注文番号。attemptNumber は 0 から始まり、新しい実行が発生するたびに増分されます。たとえば、テストが 3 回きめ細かく再試行される場合、同じ runName で合計 4 回の実行が行われ、attemptNumber は 0 ~ 3 になります。

testRunStarted

public final void testRunStarted (String runName, 
                int testCount)

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

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

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

testRunStarted

public void testRunStarted (String runName, 
                int testCount, 
                int attemptNumber, 
                long startTime)

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

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

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

attemptNumber int: 実行名が同じで複数回実行される異なる試行を識別する注文番号。attemptNumber は 0 から始まり、新しい実行が発生するたびに増分されます。たとえば、テストが 3 回再試行される場合、同じ runName で合計 4 回実行され、attemptNumber は 0 ~ 3 になります。

startTime long: 実行の開始時刻(System.currentTimeMillis() で測定)

testSkipped

public final void testSkipped (TestDescription test, 
                SkipReason reason)

通常は想定されない理由でテストがスキップされ、実行されなかった場合に呼び出されます。これらのテストは、適切な実行を試みるために再試行されます。

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

reason SkipReason: SkipReason

testStarted

public final void testStarted (TestDescription test, 
                long startTime)

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

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

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

testStarted

public final void testStarted (TestDescription test)

個々のテストケースの開始を報告します。古いインターフェース。可能な限り testStarted(TestDescription) を使用する必要があります。

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

保護されたメソッド

afterModuleEnd

protected void afterModuleEnd ()

beforeModuleStart

protected void beforeModuleStart ()

createModuleChildReference

protected TestRecordProto.ChildReference createModuleChildReference (TestRecordProto.TestRecord record)

モジュールの子参照を作成します。

パラメータ
record TestRecordProto.TestRecord

戻り値
TestRecordProto.ChildReference