SubprocessResultsReporter

public class SubprocessResultsReporter
extends Object implements ITestInvocationListener , ILogSaverListener , ISupportGranularResults

java.lang.Object
com.android.tradefed.result.SubprocessResultsReporter


result_reporter として指定され、サブプロセスからテスト、テスト実行、テスト呼び出しの結果を転送するITestInvocationListenerを実装します。

まとめ

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

SubprocessResultsReporter ()

公開メソッド

void close ()

TestSummary getSummary ()

InvocationListener が要約を返すことを許可します。

void invocationEnded (long elapsedTime)

呼び出しが正常に終了したか、何らかのエラー状態により終了したことを報告します。

void invocationFailed ( FailureDescription failure)

何らかのエラー状態による不完全な呼び出しを報告します。

void invocationFailed (Throwable cause)

何らかのエラー状態による不完全な呼び出しを報告します。

void invocationStarted ( IInvocationContext context)

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

void logAssociation (String dataName, LogFile logFile)

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

void printEvent (String key, Object event)

イベント キーと json オブジェクトを出力するヘルパー。

void setOutputTestLog (boolean outputTestLog)

ログに記録されたテストを出力するかどうかを設定します。

boolean supportGranularResults ()

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

void testAssumptionFailure ( TestDescription testId, String trace)

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

void testAssumptionFailure ( TestDescription testId, FailureDescription failure)

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

void testEnded ( TestDescription testId, long endTime, metrics) testEnded ( TestDescription testId, long endTime, metrics)

ERROR(/#testEnded(com.android.tradefed.result.TestDescription,Map))の代わりに、終了時間を直接指定できます。

void testEnded ( TestDescription testId, metrics) testEnded ( TestDescription testId, metrics)

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

void testFailed ( TestDescription testId, FailureDescription failure)

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

void testFailed ( TestDescription testId, String reason)

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

void testIgnored ( TestDescription testId)

通常、テストメソッドに org.junit.Ignore の注釈が付けられているため、テストが実行されない場合に呼び出されます。

void testLog (String dataName, LogDataType dataType, InputStreamSource dataStream)

テスト呼び出しから関連するログまたはデバッグ データを提供します。

void testModuleEnded ()

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

void testModuleStarted ( IInvocationContext moduleContext)

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

void testRunEnded (long time, runMetrics) testRunEnded (long time, runMetrics)

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

void testRunFailed ( FailureDescription failure)

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

void testRunFailed (String reason)

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

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

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

void testRunStarted (String runName, int testCount)

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

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

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

void testRunStopped (long arg0)

レポートのテスト実行は、ユーザーの要求により完了前に停止しました。

void testStarted ( TestDescription testId, long startTime)

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

void testStarted ( TestDescription testId)

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

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

SubprocessResultsReporter

public SubprocessResultsReporter ()

公開メソッド

近い

public void close ()

getSummary

public TestSummary getSummary ()

InvocationListener が要約を返すことを許可します。

戻り値
TestSummary実行を要約するTestSummary 、または null

呼び出し終了

public void invocationEnded (long elapsedTime)

呼び出しが正常に終了したか、何らかのエラー状態により終了したことを報告します。

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

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

呼び出し失敗

public void invocationFailed (FailureDescription failure)

何らかのエラー状態による不完全な呼び出しを報告します。

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

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

呼び出し失敗

public void invocationFailed (Throwable cause)

何らかのエラー状態による不完全な呼び出しを報告します。

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

パラメーター
cause Throwable : ERROR(/Throwable)失敗の原因

呼び出し開始

public void invocationStarted (IInvocationContext context)

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

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

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

ログ関連付け

public void logAssociation (String dataName, 
                LogFile logFile)

場合によっては、ログをテスト ケースと強く関連付ける必要がありますが、直接testLogSaved(String, com.android.tradefed.result.LogDataType, com.android.tradefed.result.InputStreamSource, com.android.tradefed.result.LogFile)コールバックはできません。したがって、このコールバックにより、強い関連付けを明示的に提供できます。

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

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

印刷イベント

public void printEvent (String key, 
                Object event)

イベント キーと json オブジェクトを出力するヘルパー。

パラメーター
key String

event Object

setOutputTestLog

public void setOutputTestLog (boolean outputTestLog)

ログに記録されたテストを出力するかどうかを設定します。

パラメーター
outputTestLog boolean

supportGranularResults

public boolean supportGranularResults ()

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

戻り値
boolean

testAssumptionFailure

public void testAssumptionFailure (TestDescription testId, 
                String trace)

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

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

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

testAssumptionFailure

public void testAssumptionFailure (TestDescription testId, 
                FailureDescription failure)

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

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

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

テスト終了

public void testEnded (TestDescription testId, 
                long endTime, 
                 metrics)

ERROR(/#testEnded(com.android.tradefed.result.TestDescription,Map))の代わりに、終了時間を直接指定できます。正確な測定のためにtestStarted(com.android.tradefed.result.TestDescription, long)と組み合わせます。

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

endTime long : ERROR(/System#currentTimeMillis())を介して測定された、テストが終了した時間

metrics : 発行されたメトリックのERROR(/Map)

テスト終了

public void testEnded (TestDescription testId, 
                 metrics)

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

testFailed(TestDescription, FailureDescription)が呼び出されなかった場合、このテストは成功しました。また、テスト ケースの実行中に発行された可能性のあるキー/値メトリックも返します。

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

metrics : 発行されたメトリックのERROR(/Map)

テスト失敗

public void testFailed (TestDescription testId, 
                FailureDescription failure)

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

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

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

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

テスト失敗

public void testFailed (TestDescription testId, 
                String reason)

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

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

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

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

テスト無視

public void testIgnored (TestDescription testId)

通常、テストメソッドに org.junit.Ignore の注釈が付けられているため、テストが実行されない場合に呼び出されます。

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

テストログ

public void testLog (String dataName, 
                LogDataType dataType, 
                InputStreamSource dataStream)

テスト呼び出しから関連するログまたはデバッグ データを提供します。

ERROR(/ITestInvocationListener#invocationFailed(Throwable))またはERROR(/ITestInvocationListener#invocationEnded(long))の前に呼び出す必要があります

TradeFederation フレームワークは、このメソッドを自動的に呼び出し、ホスト ログと、該当する場合はデバイスの logcat を提供します。

パラメーター
dataName String : データのERROR(/String)記述名。例: "device_logcat"。注意 dataName は、呼び出しごとに一意ではない場合があります。つまり、実装者は同じ dataName で複数の呼び出しを処理できなければなりません

dataType LogDataType : データのLogDataType

dataStream InputStreamSource : データのInputStreamSource 。実装者は createInputStream を呼び出してデータの読み取りを開始し、完了したら結果の InputStream を確実に閉じる必要があります。呼び出し元は、testLog メソッドが完了するまで、データのソースが存在し、アクセス可能であることを確認する必要があります。

testModuleEnded

public void testModuleEnded ()

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

testModuleStarted

public void testModuleStarted (IInvocationContext moduleContext)

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

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

testRunEnded

public void testRunEnded (long time, 
                 runMetrics)

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

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

runMetrics : Metricでのテスト実行の最後に報告されるキーと値のペア。

testRunFailed

public void testRunFailed (FailureDescription failure)

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

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

testRunFailed

public void testRunFailed (String reason)

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

パラメーター
reason String : 実行失敗の理由を説明するERROR(/String)

testRunStarted

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

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

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

testCount int : テスト実行中のテストの総数

attemptNumber int : 複数回実行される同じ runName の異なる試行を識別する順序番号。 AttemptNumber のインデックスは 0 であり、新しい実行が発生するたびに増加する必要があります。たとえば、テストは詳細に 3 回再試行されます。同じ runName で合計 4 回実行する必要があり、attemptNumber は 0 から 3 です。

testRunStarted

public 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 : 複数回実行される同じ runName の異なる試行を識別する順序番号。 AttemptNumber のインデックスは 0 であり、新しい実行が発生するたびに増加する必要があります。たとえば、テストは詳細に 3 回再試行されます。同じ runName で合計 4 回実行する必要があり、attemptNumber は 0 から 3 です。

startTime long : 実行が開始された時間、 ERROR(/System#currentTimeMillis())で測定

testRunStopped

public void testRunStopped (long arg0)

レポートのテスト実行は、ユーザーの要求により完了前に停止しました。

TODO: 現在使用されていません。削除を検討してください

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

テスト開始

public void testStarted (TestDescription testId, 
                long startTime)

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

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

startTime long : ERROR(/System#currentTimeMillis())を介して測定された、テストの開始時間

テスト開始

public void testStarted (TestDescription testId)

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

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