GranularRetriableTestWrapper.StartEndCollector
public
class
GranularRetriableTestWrapper.StartEndCollector
extends ResultAndLogForwarder
| java.lang.Object | |||
| ↳ | com.android.tradefed.result.ResultForwarder | ||
| ↳ | com.android.tradefed.result.ResultAndLogForwarder | ||
| ↳ | com.android.tradefed.testtype.suite.GranularRetriableTestWrapper.StartEndCollector | ||
用于捕获缺失的跑步开始和结束的类辅助程序。
摘要
字段 | |
|---|---|
public
TestDescription |
mCurrentTest
|
public
boolean |
mRunEndedReported
|
public
boolean |
mRunStartReported
|
public
boolean |
mTestInProgress
|
公共方法 | |
|---|---|
void
|
testEnded(TestDescription test,
报告单个测试用例的执行结束时间。 |
void
|
testEnded(TestDescription test, long endTime,
|
void
|
testRunEnded(long elapsedTimeMillis,
报告测试运行结束。 |
void
|
testRunStarted(String runName, int testCount)
报告测试运行的开始。 |
void
|
testRunStarted(String runName, int testCount, int attemptNumber, long startTime)
报告测试运行的开始。 |
void
|
testRunStarted(String runName, int testCount, int attemptNumber)
报告测试运行的开始。 |
void
|
testStarted(TestDescription test, long startTime)
|
void
|
testStarted(TestDescription test)
报告单个测试用例的开始。 |
字段
mRunEndedReported
public boolean mRunEndedReported
mRunStartReported
public boolean mRunStartReported
mTestInProgress
public boolean mTestInProgress
公共方法
testEnded
public void testEnded (TestDescription test,testMetrics)
报告单个测试用例的执行结束时间。
如果未调用 testFailed(TestDescription, FailureDescription),则此测试通过。还会返回测试用例执行期间可能发出的任何键值指标。
| 参数 | |
|---|---|
test |
TestDescription:用于标识测试 |
testMetrics |
:所发出指标的 ERROR(/Map) |
testEnded
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) |
testRunEnded
public void testRunEnded (long elapsedTimeMillis,
runMetrics) 报告测试运行结束。
| 参数 | |
|---|---|
elapsedTimeMillis |
long:设备报告的已用时间,以毫秒为单位 |
runMetrics |
:在测试运行结束时报告的键值对 |
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:用于标识多次运行的同一 runName 的不同尝试的订单号。attemptNumber 从 0 开始,每次新运行都会递增。例如,如果某项测试进行了 3 次精细重试,则在同一 runName 下,该测试总共应运行 4 次,且 attemptNumber 从 0 到 3。 |
startTime |
long:运行开始时间,通过 System.currentTimeMillis() 测量 |
testRunStarted
public void testRunStarted (String runName,
int testCount,
int attemptNumber)报告测试运行的开始。
| 参数 | |
|---|---|
runName |
String:测试运行名称 |
testCount |
int:测试运行中的测试总数 |
attemptNumber |
int:用于标识多次运行的同一 runName 的不同尝试的订单号。attemptNumber 从 0 开始,每次新运行时都会递增。例如,如果某项测试进行了 3 次精细重试,则在同一 runName 下,该测试总共应运行 4 次,且 attemptNumber 从 0 到 3。 |
testStarted
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() 测量 |
testStarted
public void testStarted (TestDescription test)
报告单个测试用例的开始。旧版接口,应尽可能使用 testStarted(com.android.tradefed.result.TestDescription)。
| 参数 | |
|---|---|
test |
TestDescription:用于标识测试 |