ITestLifeCycleReceiver
public
interface
ITestLifeCycleReceiver
| com.android.tradefed.result.ITestLifeCycleReceiver |
インストルメンテーション テストの実行中にイベント通知を受け取ります。
org.junit.runner.notification.RunListener に基づいています。
呼び出しの順序は次のようになります。
- testRunStarted
- testStarted
- [testFailed]
- [testAssumptionFailure]
- [testIgnored]
- testEnded
- ....
- [testRunFailed]
- testRunEnded
概要
パブリック メソッド | |
|---|---|
default
void
|
testAssumptionFailure(TestDescription test, String trace)
アトミック テストが、false の条件を想定していることを示すフラグを設定したときに呼び出されます。 |
default
void
|
testAssumptionFailure(TestDescription test, FailureDescription failure)
アトミック テストが、false の条件を想定していることを示すフラグを設定したときに呼び出されます。 |
default
void
|
testEnded(TestDescription test, HashMap<String, MetricMeasurement.Metric> testMetrics)
個々のテストケースの実行終了を報告します。 |
default
void
|
testEnded(TestDescription test, long endTime, Map<String, String> testMetrics)
終了時間を直接指定できる |
default
void
|
testEnded(TestDescription test, long endTime, HashMap<String, MetricMeasurement.Metric> testMetrics)
終了時間を直接指定できる |
default
void
|
testEnded(TestDescription test, Map<String, String> testMetrics)
個々のテストケースの実行終了を報告します。 |
default
void
|
testFailed(TestDescription test, FailureDescription failure)
個々のテストケースの失敗を報告します。 |
default
void
|
testFailed(TestDescription test, String trace)
個々のテストケースの失敗を報告します。 |
default
void
|
testIgnored(TestDescription test)
テストが実行されない場合に呼び出されます。通常、テストメソッドに org.junit.Ignore のアノテーションが付いていることが原因です。 |
default
void
|
testRunEnded(long elapsedTimeMillis, HashMap<String, MetricMeasurement.Metric> runMetrics)
テスト実行の終了を報告します。 |
default
void
|
testRunEnded(long elapsedTimeMillis, Map<String, String> runMetrics)
テスト実行の終了を報告します。 |
default
void
|
testRunFailed(FailureDescription failure)
|
default
void
|
testRunFailed(String errorMessage)
致命的なエラーのため、レポートのテスト実行を完了できませんでした。 |
default
void
|
testRunStarted(String runName, int testCount, int attemptNumber)
テスト実行の開始を報告します。 |
default
void
|
testRunStarted(String runName, int testCount)
テスト実行の開始を報告します。 |
default
void
|
testRunStarted(String runName, int testCount, int attemptNumber, long startTime)
テスト実行の開始を報告します。 |
default
void
|
testRunStopped(long elapsedTime)
ユーザーのリクエストにより、レポートのテスト実行が完了前に停止しました。 |
default
void
|
testSkipped(TestDescription test, SkipReason reason)
テストがスキップされ、通常は想定されない理由で実行されなかった場合に呼び出されます。 |
default
void
|
testStarted(TestDescription test, long startTime)
|
default
void
|
testStarted(TestDescription test)
個々のテストケースの開始を報告します。 |
パブリック メソッド
testAssumptionFailure
public void testAssumptionFailure (TestDescription test, String trace)
アトミック テストが、false の条件を想定していることを示すフラグを設定したときに呼び出されます
| パラメータ | |
|---|---|
test |
TestDescription: テストを識別します |
trace |
String: 失敗のスタック トレース |
testAssumptionFailure
public void testAssumptionFailure (TestDescription test, FailureDescription failure)
アトミック テストが、false の条件を想定していることを示すフラグを設定したときに呼び出されます
| パラメータ | |
|---|---|
test |
TestDescription: テストを識別します |
failure |
FailureDescription: 失敗とそのコンテキストを説明する FailureDescription。 |
testEnded
public void testEnded (TestDescription test, HashMap<String, MetricMeasurement.Metric> testMetrics)
個々のテストケースの実行終了を報告します。
testFailed(TestDescription, FailureDescription) が呼び出されなかった場合、このテストは合格です。テストケースの実行中に生成された Key-Value 指標も返します。
| パラメータ | |
|---|---|
test |
TestDescription: テストを識別します |
testMetrics |
HashMap: 出力された指標の Map |
testEnded
public void testEnded (TestDescription test, long endTime, Map<String, String> testMetrics)
終了時間を直接指定できる testEnded(TestDescription,Map) の代替。testStarted(TestDescription,long) と組み合わせて正確な測定を行います。
| パラメータ | |
|---|---|
test |
TestDescription: テストを識別します |
endTime |
long: テストが終了した時刻(System.currentTimeMillis() で測定) |
testMetrics |
Map: 出力された指標の Map |
testEnded
public 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, Map<String, String> testMetrics)
個々のテストケースの実行終了を報告します。
testFailed(TestDescription, FailureDescription) が呼び出されなかった場合、このテストは合格です。テストケースの実行中に生成された Key-Value 指標も返します。
| パラメータ | |
|---|---|
test |
TestDescription: テストを識別します |
testMetrics |
Map: 出力された指標の 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: 失敗のスタック トレース |
testIgnored
public void testIgnored (TestDescription test)
テストが実行されない場合に呼び出されます。通常、テストメソッドに org.junit.Ignore のアノテーションが付いていることが原因です。
| パラメータ | |
|---|---|
test |
TestDescription: テストを識別します |
testRunEnded
public void testRunEnded (long elapsedTimeMillis,
HashMap<String, MetricMeasurement.Metric> runMetrics)テスト実行の終了を報告します。FIXME: 型が異なる Map<> インターフェースを 2 つ持つことはできないため、ここでは HashMap を使用する必要があります。
| パラメータ | |
|---|---|
elapsedTimeMillis |
long: デバイスが報告した経過時間(ミリ秒単位) |
runMetrics |
HashMap: Metric を使用したテスト実行の最後にレポートされる Key-Value ペア。 |
testRunEnded
public void testRunEnded (long elapsedTimeMillis,
Map<String, String> runMetrics)テスト実行の終了を報告します。
| パラメータ | |
|---|---|
elapsedTimeMillis |
long: デバイスが報告した経過時間(ミリ秒単位) |
runMetrics |
Map: テスト実行の最後にレポートされる Key-Value ペア |
testRunFailed
public void testRunFailed (FailureDescription failure)
FailureDescription で説明されているエラーのため、レポート テスト実行を完了できませんでした。
| パラメータ | |
|---|---|
failure |
FailureDescription: 失敗とそのコンテキストを説明する FailureDescription。 |
testRunFailed
public 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 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() で測定) |
testRunStopped
public void testRunStopped (long elapsedTime)
ユーザーのリクエストにより、レポートのテスト実行が完了前に停止しました。
TODO: 現在使用されていません。削除することを検討してください
| パラメータ | |
|---|---|
elapsedTime |
long: デバイスが報告した経過時間(ミリ秒単位) |
testSkipped
public void testSkipped (TestDescription test, SkipReason reason)
通常は想定されない理由でテストがスキップされ、実行されなかった場合に呼び出されます。これらのテストは、適切な実行を試みるために再試行されます。
| パラメータ | |
|---|---|
test |
TestDescription: テストを識別します |
reason |
SkipReason: SkipReason |
testStarted
public void testStarted (TestDescription test, long startTime)
testStarted(TestDescription) の代替。テストの開始時刻も指定し、testEnded(TestDescription,long,Map) と組み合わせて正確な測定を行います。
| パラメータ | |
|---|---|
test |
TestDescription: テストを識別します |
startTime |
long: テストが開始された時刻(System.currentTimeMillis() で測定) |
testStarted
public void testStarted (TestDescription test)
個々のテストケースの開始を報告します。古いインターフェース。可能な限り testStarted(TestDescription) を使用する必要があります。
| パラメータ | |
|---|---|
test |
TestDescription: テストを識別します |