TestResult
public
class
TestResult
extends Object
| java.lang.Object | |
| ↳ | com.android.tradefed.result.TestResult |
用于存放单个测试结果的容器。
摘要
字段 | |
|---|---|
public
static
final
String |
IS_FLAKY
|
公共构造函数 | |
|---|---|
TestResult()
|
|
字段
IS_FLAKY
public static final String IS_FLAKY
公共构造函数
TestResult
public TestResult ()
公共方法
addLoggedFile
public void addLoggedFile (String dataName,
LogFile loggedFile)添加与该测试用例关联的日志文件跟踪
| 参数 | |
|---|---|
dataName |
String |
loggedFile |
LogFile |
equals
public boolean equals (Object obj)
| 参数 | |
|---|---|
obj |
Object |
| 返回 | |
|---|---|
boolean |
|
getEndTime
public long getEndTime ()
返回收到 ERROR(/com.android.tradefed.result.ITestInvocationListener#testEnded(com.android.tradefed.result.TestDescription,Map)) 事件的 System.currentTimeMillis() 时间。
| 返回 | |
|---|---|
long |
|
getFailure
public FailureDescription getFailure ()
获取关联的 FailureDescription。如果 getStatus() 为 TestStatus.PASSED,则应为 null。
| 返回 | |
|---|---|
FailureDescription |
|
getLoggedFiles
publicgetLoggedFiles ()
返回包含与该测试用例关联的所有已记录文件的映射的副本。
| 返回 | |
|---|---|
|
|
getMetrics
publicgetMetrics ()
获取关联的测试指标。
| 返回 | |
|---|---|
|
|
getProtoMetrics
publicgetProtoMetrics ()
以 proto 格式获取关联的测试指标。
| 返回 | |
|---|---|
|
|
getStackTrace
public String getStackTrace ()
获取关联的 String 堆栈轨迹。如果 getStatus() 为 TestStatus.PASSED,则应为 null。
| 返回 | |
|---|---|
String |
|
getStartTime
public long getStartTime ()
返回收到 ITestLifeCycleReceiver.testStarted(com.android.tradefed.result.TestDescription) 事件的 System.currentTimeMillis() 时间。
| 返回 | |
|---|---|
long |
|
hashCode
public int hashCode ()
| 返回 | |
|---|---|
int |
|
合并
public static TestResult merge (results, MergeStrategy strategy)
根据合并策略合并同一测试用例的尝试。
| 参数 | |
|---|---|
results |
:要合并的 TestResult 的列表 |
strategy |
MergeStrategy:用于确定合并结果的 MergeStrategy。 |
| 返回 | |
|---|---|
TestResult |
合并后的 TestResult,如果没有可合并的内容,则返回 null。 |
setEndTime
public void setEndTime (long currentTimeMillis)
设置结束时间
| 参数 | |
|---|---|
currentTimeMillis |
long |
setFailure
public void setFailure (FailureDescription failureDescription)
设置堆栈轨迹。
| 参数 | |
|---|---|
failureDescription |
FailureDescription |
setMetrics
public void setMetrics (metrics)
设置测试指标,替换之前的所有值。
| 参数 | |
|---|---|
metrics |
|
setProtoMetrics
public void setProtoMetrics (metrics)
设置测试 proto 指标格式,替换之前的所有值。
| 参数 | |
|---|---|
metrics |
|
setStackTrace
public void setStackTrace (String stackTrace)
设置堆栈轨迹。
| 参数 | |
|---|---|
stackTrace |
String |
setStartTime
public void setStartTime (long startTime)
允许设置测试的开始时间,以便与 ITestLifeCycleReceiver.testStarted(com.android.tradefed.result.TestDescription, long) 搭配使用。
| 参数 | |
|---|---|
startTime |
long |
setStatus
public TestResult setStatus (TestStatus status)
设置 TestStatus。
| 参数 | |
|---|---|
status |
TestStatus |
| 返回 | |
|---|---|
TestResult |
|
setStatus
public TestResult setStatus (TestResult.TestStatus ddmlibStatus)
| 参数 | |
|---|---|
ddmlibStatus |
TestResult.TestStatus |
| 返回 | |
|---|---|
TestResult |
|