TestRunResultListener
public
final
class
TestRunResultListener
extends Object
implements
ITestInvocationListener
| java.lang.Object | |
| ↳ | com.android.tradefed.result.TestRunResultListener |
此监听器允许读取最终的测试运行状态。
摘要
公共构造函数 | |
|---|---|
TestRunResultListener()
|
|
公共方法 | |
|---|---|
boolean
|
isTestFailed(String testName)
|
boolean
|
isTestRunFailed(String testRunName)
|
void
|
testFailed(TestDescription test, FailureDescription failure)
报告单个测试用例的失败情况。 |
void
|
testFailed(TestDescription test, String trace)
报告单个测试用例的失败情况。 |
void
|
testRunEnded(long elapsedTime, HashMap<String, MetricMeasurement.Metric> runMetrics)
报告测试运行结束。 |
void
|
testRunFailed(FailureDescription failure)
报告测试运行因 |
void
|
testRunFailed(String errorMessage)
报告测试运行因严重错误而未能完成。 |
void
|
testRunStarted(String runName, int testCount)
报告测试运行开始。 |
公共构造函数
TestRunResultListener
public TestRunResultListener ()
公共方法
isTestFailed
public boolean isTestFailed (String testName)
| 参数 | |
|---|---|
testName |
String |
| 返回 | |
|---|---|
boolean |
|
isTestRunFailed
public boolean isTestRunFailed (String testRunName)
| 参数 | |
|---|---|
testRunName |
String |
| 返回 | |
|---|---|
boolean |
|
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:失败的堆栈轨迹 |
testRunEnded
public void testRunEnded (long elapsedTime,
HashMap<String, MetricMeasurement.Metric> runMetrics)报告测试运行结束。FIXME:我们不能有两个具有不同类型的 Map<> 接口,因此 必须在此处使用 HashMap。
| 参数 | |
|---|---|
elapsedTime |
long:设备报告的经过时间,以毫秒为单位 |
runMetrics |
HashMap:在测试运行结束时报告的键值对,带有 Metric。 |
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)报告测试运行开始。
| 参数 | |
|---|---|
runName |
String:测试运行名称 |
testCount |
int:测试运行中的测试总数 |