結果アグリゲータ
public class ResultAggregator
extends CollectingTestListener
java.lang.オブジェクト | ||
↳ | com.android.tradefed.result.CollectingTestListener | |
↳ | com.android.tradefed.retry.ResultAggregator |
実行された再試行戦略に基づいて、必要に応じて結果を集約する特別なフォワーダー。
まとめ
パブリックコンストラクター | |
---|---|
ResultAggregator ( listeners, RetryStrategy strategy) ResultAggregator ( listeners, RetryStrategy strategy) |
パブリックメソッド | |
---|---|
void | cleanEventsFiles () |
final void | forwardAggregatedInvocationLogs () すべての呼び出しレベルのログを、詳細な結果をサポートしない結果レポーターに転送します。 |
void | invocationEnded (long elapsedTime) 正常に終了したか、何らかのエラー条件により呼び出しが終了したことを報告します。 |
void | invocationFailed ( FailureDescription failure) |
void | invocationFailed (Throwable cause) 何らかのエラー状態が原因で不完全な呼び出しを報告します。 |
void | invocationStarted ( IInvocationContext context) テスト呼び出しの開始を報告します。 |
void | logAssociation (String dataName, LogFile logFile) 場合によっては、ログをテスト ケースと強く関連付ける必要がありますが、直接 |
void | setLogSaver ( ILogSaver logSaver) |
void | setUpdatedReporting (boolean updatedReporting) 新しいレポートを設定します。 |
void | testAssumptionFailure ( TestDescription test, String trace) アトミック テストが条件が false であると仮定することを示すフラグを立てたときに呼び出されます。 |
void | testAssumptionFailure ( TestDescription test, FailureDescription failure) アトミック テストが条件が false であると仮定することを示すフラグを立てたときに呼び出されます。 |
void | testEnded ( TestDescription test, long endTime, testMetrics) testEnded ( TestDescription test, long endTime, testMetrics) |
void | testFailed ( TestDescription test, FailureDescription failure) 個々のテスト ケースの失敗を報告します。 |
void | testFailed ( TestDescription test, String trace) 個々のテスト ケースの失敗を報告します。 |
void | testIgnored ( TestDescription test) 通常、テスト メソッドに org.junit.Ignore アノテーションが付けられているため、テストが実行されないときに呼び出されます。 |
void | testLog (String dataName, LogDataType dataType, InputStreamSource dataStream) |
void | testLogSaved (String dataName, LogDataType dataType, InputStreamSource dataStream, LogFile logFile) |
void | testModuleEnded () モジュールの実行の終了を報告します。 |
void | testModuleStarted ( IInvocationContext moduleContext) モジュールの実行の開始を報告します。 |
void | testRunEnded (long elapsedTime, runMetrics) testRunEnded (long elapsedTime, runMetrics) テスト実行の終了を報告します。 |
void | testRunFailed ( FailureDescription failure) |
void | testRunFailed (String errorMessage) レポートのテスト実行は、致命的なエラーのため完了できませんでした。 |
void | testRunStarted (String name, int testCount, int attemptNumber, long startTime) テスト実行の開始を報告します。 |
void | testStarted ( TestDescription test, long startTime) |
保護されたメソッド | |
---|---|
File[] | getEventsLogs () |
パブリックコンストラクター
結果アグリゲータ
public ResultAggregator (listeners, RetryStrategy strategy)
パラメーター | |
---|---|
listeners | |
strategy | RetryStrategy |
パブリックメソッド
クリーンイベントファイル
public void cleanEventsFiles ()
forwardAggregatedInvocationLogs
public final void forwardAggregatedInvocationLogs ()
すべての呼び出しレベルのログを、詳細な結果をサポートしない結果レポーターに転送します。
呼び出し終了
public void invocationEnded (long elapsedTime)
正常に終了したか、何らかのエラー条件により呼び出しが終了したことを報告します。
TradeFederation フレームワークによって自動的に呼び出されます。パラメーター | |
---|---|
elapsedTime | long : 呼び出しの経過時間 (ミリ秒) |
呼び出し失敗
public void invocationFailed (Throwable cause)
何らかのエラー状態が原因で不完全な呼び出しを報告します。
TradeFederation フレームワークによって自動的に呼び出されます。パラメーター | |
---|---|
cause | Throwable : 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)
で関連付けることができます。 testLogSaved(String, com.android.tradefed.result.LogDataType, com.android.tradefed.result.InputStreamSource, com.android.tradefed.result.LogFile)
コールバックはできません。したがって、このコールバックにより、強力な関連付けを明示的に提供できます。
パラメーター | |
---|---|
dataName | String : データの名前 |
logFile | LogFile : 以前にログに記録され、テスト ケースに関連付ける必要があるLogFile 。 |
setUpdatedReporting
public void setUpdatedReporting (boolean updatedReporting)
新しいレポートを設定します。
パラメーター | |
---|---|
updatedReporting | boolean |
テスト仮定失敗
public void testAssumptionFailure (TestDescription test, String trace)
アトミック テストが条件が false であると仮定することを示すフラグを立てたときに呼び出されます。
パラメーター | |
---|---|
test | TestDescription : テストを識別します |
trace | String : 失敗のスタック トレース |
テスト仮定失敗
public void testAssumptionFailure (TestDescription test, FailureDescription failure)
アトミック テストが条件が false であると仮定することを示すフラグを立てたときに呼び出されます。
パラメーター | |
---|---|
test | TestDescription : テストを識別します |
failure | FailureDescription : 失敗とそのコンテキストを説明するFailureDescription 。 |
テスト終了
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) |
テスト失敗
public void testFailed (TestDescription test, FailureDescription failure)
個々のテスト ケースの失敗を報告します。
testStarted と testEnded の間で呼び出されます。
パラメーター | |
---|---|
test | TestDescription : テストを識別します |
failure | FailureDescription : 失敗とそのコンテキストを説明するFailureDescription 。 |
テスト失敗
public void testFailed (TestDescription test, String trace)
個々のテスト ケースの失敗を報告します。
testStarted と testEnded の間で呼び出されます。
パラメーター | |
---|---|
test | TestDescription : テストを識別します |
trace | String : 失敗のスタック トレース |
テスト無視されました
public void testIgnored (TestDescription test)
通常、テスト メソッドに org.junit.Ignore アノテーションが付けられているため、テストが実行されないときに呼び出されます。
パラメーター | |
---|---|
test | TestDescription : テストを識別します |
テストログ
public void testLog (String dataName, LogDataType dataType, InputStreamSource dataStream)
パラメーター | |
---|---|
dataName | String |
dataType | LogDataType |
dataStream | InputStreamSource |
テストログが保存されました
public void testLogSaved (String dataName, LogDataType dataType, InputStreamSource dataStream, LogFile logFile)
パラメーター | |
---|---|
dataName | String |
dataType | LogDataType |
dataStream | InputStreamSource |
logFile | LogFile |
テストモジュール終了
public void testModuleEnded ()
モジュールの実行の終了を報告します。
テストモジュールが開始されました
public void testModuleStarted (IInvocationContext moduleContext)
モジュールの実行の開始を報告します。このコールバックはtestModuleEnded()
に関連付けられており、シーケンス内ではオプションです。これは、モジュール (スイート ベースのランナー) を使用する実行中にのみ使用されます。
パラメーター | |
---|---|
moduleContext | IInvocationContext : モジュールのIInvocationContext 。 |
テスト実行終了
public void testRunEnded (long elapsedTime,runMetrics)
テスト実行の終了を報告します。修正: タイプの異なる 2 つの Map<> インターフェイスを使用することはできないため、ここでは HashMap を使用する必要があります。
パラメーター | |
---|---|
elapsedTime | long : デバイスが報告した経過時間 (ミリ秒単位) |
runMetrics | Metric を使用したテスト実行の終了時に報告されたキーと値のペア。 |
テスト実行失敗
public void testRunFailed (FailureDescription failure)
FailureDescription
で説明されている障害のため、レポートのテスト実行が完了できませんでした。
パラメーター | |
---|---|
failure | FailureDescription : 失敗とそのコンテキストを説明するFailureDescription 。 |
テスト実行失敗
public void testRunFailed (String errorMessage)
レポートのテスト実行は、致命的なエラーのため完了できませんでした。
パラメーター | |
---|---|
errorMessage | String : 実行失敗の理由を説明するString 。 |
テスト実行開始しました
public void testRunStarted (String name, int testCount, int attemptNumber, long startTime)
テスト実行の開始を報告します。
パラメーター | |
---|---|
name | String : テスト実行名 |
testCount | int : テスト実行のテストの総数 |
attemptNumber | int : 順序番号。複数回実行される同じ runName の異なる試行を識別します。 attemptNumber は 0 から始まるインデックスであり、新しい実行が発生するたびに増加する必要があります。たとえば、テストは 3 回詳細に再試行され、同じ runName で合計 4 回の実行が必要で、attemptNumber は 0 ~ 3 です。 |
startTime | long : System.currentTimeMillis() によって測定された実行の開始時刻 |
テスト開始
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() によって測定されたテストの開始時刻 |
保護されたメソッド
イベントログの取得
protected File[] getEventsLogs ()
戻り値 | |
---|---|
File[] |