TestRunResult
public class TestRunResult
extends Object
java.lang.Object | |
↳ | com.android.tradefed.result.TestRunResult |
1 回のテスト実行の結果を保持します。
テストの正確な数を維持し、不完全なテストを追跡します。
スレッドセーフではありません! test* コールバックは順番に呼び出す必要があります
まとめ
田畑 | |
---|---|
public static final String | ERROR_DIVIDER
|
パブリック コンストラクター | |
---|---|
TestRunResult () 空の |
公開メソッド | |
---|---|
getCompletedTests () 完了したテストのセットを取得します。 | |
long | getElapsedTime () 現在の実行経過時間を返します。 |
int | getExpectedTestCount () この TestRunResult が期待するテスト ケースの数を取得します。 |
getFailedTests () 失敗したテストのセットを取得します。 | |
String | getName () |
int | getNumAllFailedTests () 失敗状態 (失敗、仮定失敗) のテストの総数を返す |
int | getNumCompleteTests () この実行で完了したテストの数を取得します。つまり、ステータスが != 未完了です。 |
int | getNumTests () この実行でのテストの数を取得します。 |
int | getNumTestsInState (TestResult.TestStatus status) この実行で特定の状態にあるテストの数を取得します。 |
getPassedTests () 合格したテストのセットを取得します。 | |
FailureDescription | getRunFailureDescription () 実行が失敗しなかった場合は、実行の失敗記述子 |
String | getRunFailureMessage () 実行失敗のエラー メッセージを返します。実行が失敗しなかった場合は |
MultiMap <String, LogFile > | getRunLoggedFiles () そのテスト ケースに関連付けられたすべてのログ ファイルを含むマップのコピーを返します。 |
getRunMetrics () | |
getRunProtoMetrics () | |
long | getStartTime () 最初の testRunStart 呼び出しの開始時刻を返します。 |
getTestResults () テスト結果のマップを返します。 | |
getTestsInState ( statuses) getTestsInState ( statuses) 特定のステータスのテストのセットを取得します。 | |
getTestsResultsInState (TestResult.TestStatus status) 特定の状態のすべての | |
String | getTextSummary () 結果を説明するわかりやすい文字列を返します。 |
boolean | hasFailedTests () |
boolean | isRunComplete () |
boolean | isRunFailure () |
static TestRunResult | merge ( testRunResults) merge ( testRunResults) |
static TestRunResult | merge ( testRunResults, MergeStrategy strategy) merge ( testRunResults, MergeStrategy strategy) 同じ testRunName の複数の TestRunResult をマージします。 |
void | resetRunFailure () 実行失敗ステータスをリセットします。 |
void | setAggregateMetrics (boolean metricAggregation) |
void | setRunComplete (boolean runComplete) |
void | testAssumptionFailure ( TestDescription test, String trace) |
void | testAssumptionFailure ( TestDescription test, FailureDescription failure) |
void | testEnded ( TestDescription test, long endTime, testMetrics) testEnded ( TestDescription test, long endTime, testMetrics) |
void | testEnded ( TestDescription test, testMetrics) testEnded ( TestDescription test, testMetrics) |
void | testFailed ( TestDescription test, FailureDescription failure) |
void | testFailed ( TestDescription test, String trace) |
void | testIgnored ( TestDescription test) |
void | testLogSaved (String dataName, LogFile logFile) ログに記録されているファイルに関する情報が保存され、進行中のテスト ケースまたはテスト ランに関連付けられます。 |
void | testRunEnded (long elapsedTime, runMetrics) testRunEnded (long elapsedTime, runMetrics) 新しい proto メトリクスを使用した新しいインターフェース。 |
void | testRunFailed ( FailureDescription failureDescription) |
void | testRunFailed (String errorMessage) |
void | testRunStarted (String runName, int testCount, long startTime) テスト実行が開始されたことを通知します。 |
void | testRunStarted (String runName, int testCount) テスト実行が開始されたことを通知します。 |
void | testRunStopped (long elapsedTime) |
void | testStarted ( TestDescription test, long startTime) |
void | testStarted ( TestDescription test) |
田畑
ERROR_DIVIDER
public static final String ERROR_DIVIDER
パブリック コンストラクター
公開メソッド
getCompletedTests
publicgetCompletedTests ()
完了したテストのセットを取得します。
戻り値 | |
---|---|
getElapsedTime
public long getElapsedTime ()
現在の実行経過時間を返します。
戻り値 | |
---|---|
long |
getExpectedTestCount
public int getExpectedTestCount ()
この TestRunResult が期待するテスト ケースの数を取得します。実際の数は、テストのクラッシュにより、予想される数よりも少ない場合があります。通常、このような不一致は、テスト実行の失敗を示します。
戻り値 | |
---|---|
int |
getFailedTests
publicgetFailedTests ()
失敗したテストのセットを取得します。
戻り値 | |
---|---|
getName
public String getName ()
戻り値 | |
---|---|
String | テスト実行名 |
getNumAllFailedTests
public int getNumAllFailedTests ()
失敗状態 (失敗、仮定失敗) のテストの総数を返す
戻り値 | |
---|---|
int |
getNumCompleteTests
public int getNumCompleteTests ()
この実行で完了したテストの数を取得します。つまり、ステータスが != 未完了です。
戻り値 | |
---|---|
int |
getNumTests
public int getNumTests ()
この実行でのテストの数を取得します。
戻り値 | |
---|---|
int |
getNumTestsInState
public int getNumTestsInState (TestResult.TestStatus status)
この実行で特定の状態にあるテストの数を取得します。
パラメーター | |
---|---|
status | TestResult.TestStatus |
戻り値 | |
---|---|
int |
getPassedTests
publicgetPassedTests ()
合格したテストのセットを取得します。
戻り値 | |
---|---|
getRunFailureDescription
public FailureDescription getRunFailureDescription ()
実行が失敗しなかった場合は、実行の失敗記述子null
返します。
戻り値 | |
---|---|
FailureDescription |
getRunFailureMessage
public String getRunFailureMessage ()
実行失敗のエラー メッセージを返します。実行が失敗しなかった場合はnull
。
戻り値 | |
---|---|
String |
getRunLoggedFiles
public MultiMap<String, LogFile> getRunLoggedFiles ()
そのテスト ケースに関連付けられたすべてのログ ファイルを含むマップのコピーを返します。
戻り値 | |
---|---|
MultiMap <String, LogFile > |
getStartTime
public long getStartTime ()
最初の testRunStart 呼び出しの開始時刻を返します。
戻り値 | |
---|---|
long |
getTestResults
publicgetTestResults ()
テスト結果のマップを返します。
戻り値 | |
---|---|
getTestsInState
publicgetTestsInState ( statuses)
特定のステータスのテストのセットを取得します。
パラメーター | |
---|---|
statuses |
戻り値 | |
---|---|
getTestsResultsInState
publicgetTestsResultsInState (TestResult.TestStatus status)
特定の状態のすべてのTestResult
を返します。
パラメーター | |
---|---|
status | TestResult.TestStatus |
戻り値 | |
---|---|
getTextSummary
public String getTextSummary ()
結果を説明するわかりやすい文字列を返します。
戻り値 | |
---|---|
String |
hasFailedTests
public boolean hasFailedTests ()
戻り値 | |
---|---|
boolean | テストの実行に失敗またはエラーのテストがあった場合はtrue 。 |
isRunComplete
public boolean isRunComplete ()
戻り値 | |
---|---|
boolean | テスト実行が終了した場合はtrue 。 |
isRunFailure
public boolean isRunFailure ()
戻り値 | |
---|---|
boolean | テストの実行が失敗した場合はtrue 。 |
マージ
public static TestRunResult merge (testRunResults)
パラメーター | |
---|---|
testRunResults |
戻り値 | |
---|---|
TestRunResult |
以下も参照してください。
マージ
public static TestRunResult merge (testRunResults, MergeStrategy strategy)
同じ testRunName の複数の TestRunResult をマージします。テストケースが複数の TestRunResults に表示されるが、結果が異なる場合 (たとえば、「boottest-device」が 3 回実行され、結果が FAIL-FAIL-PASS である場合)、FAILED 実行からのすべてのスタック トレースを連結し、最終的な実行結果をステータスとして信頼します。メトリクス、ログ ファイル、開始/終了時間。
パラメーター | |
---|---|
testRunResults | |
strategy | MergeStrategy : 結果のマージに採用されるマージ戦略。 |
戻り値 | |
---|---|
TestRunResult | testRunResults からマージされたデータを含む最終的な TestRunResult。 |
resetRunFailure
public void resetRunFailure ()
実行失敗ステータスをリセットします。
再試行するときに、実行失敗ステータスのリセットが必要になる場合があります。これは、実際の障害を解決しないように注意して行う必要があります。
setAggregateMetrics
public void setAggregateMetrics (boolean metricAggregation)
パラメーター | |
---|---|
metricAggregation | boolean |
setRunComplete
public void setRunComplete (boolean runComplete)
パラメーター | |
---|---|
runComplete | boolean |
testAssumptionFailure
public void testAssumptionFailure (TestDescription test, String trace)
パラメーター | |
---|---|
test | TestDescription |
trace | String |
testAssumptionFailure
public void testAssumptionFailure (TestDescription test, FailureDescription failure)
パラメーター | |
---|---|
test | TestDescription |
failure | FailureDescription |
テスト終了
public void testEnded (TestDescription test, long endTime,testMetrics)
パラメーター | |
---|---|
test | TestDescription |
endTime | long |
testMetrics |
テスト終了
public void testEnded (TestDescription test,testMetrics)
パラメーター | |
---|---|
test | TestDescription |
testMetrics |
テスト失敗
public void testFailed (TestDescription test, FailureDescription failure)
パラメーター | |
---|---|
test | TestDescription |
failure | FailureDescription |
テスト失敗
public void testFailed (TestDescription test, String trace)
パラメーター | |
---|---|
test | TestDescription |
trace | String |
testLogSaved
public void testLogSaved (String dataName, LogFile logFile)
ログに記録されているファイルに関する情報が保存され、進行中のテスト ケースまたはテスト ランに関連付けられます。
パラメーター | |
---|---|
dataName | String : データを参照する名前。 |
logFile | LogFile : オブジェクトが保存された場所とそれに関する情報を表すLogFile オブジェクト。 |
testRunEnded
public void testRunEnded (long elapsedTime,runMetrics)
新しい proto メトリクスを使用した新しいインターフェース。
パラメーター | |
---|---|
elapsedTime | long |
runMetrics |
testRunFailed
public void testRunFailed (FailureDescription failureDescription)
パラメーター | |
---|---|
failureDescription | FailureDescription |
testRunFailed
public void testRunFailed (String errorMessage)
パラメーター | |
---|---|
errorMessage | String |
testRunStarted
public void testRunStarted (String runName, int testCount, long startTime)
テスト実行が開始されたことを通知します。
パラメーター | |
---|---|
runName | String : 追跡目的でテスト実行に関連付けられた名前。 |
testCount | int : テストの実行に関連付けられた予想されるテスト ケースの数。 |
startTime | long |
testRunStarted
public void testRunStarted (String runName, int testCount)
テスト実行が開始されたことを通知します。
パラメーター | |
---|---|
runName | String : 追跡目的でテスト実行に関連付けられた名前。 |
testCount | int : テストの実行に関連付けられた予想されるテスト ケースの数。 |
testRunStopped
public void testRunStopped (long elapsedTime)
パラメーター | |
---|---|
elapsedTime | long |
テスト開始
public void testStarted (TestDescription test, long startTime)
パラメーター | |
---|---|
test | TestDescription |
startTime | long |