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, long endTime, Map<String, String> testMetrics)
|
void
|
testEnded(TestDescription test, long endTime, HashMap<String, MetricMeasurement.Metric> testMetrics)
|
void
|
testEnded(TestDescription test, Map<String, String> testMetrics)
|
void
|
testEnded(TestDescription test, HashMap<String, MetricMeasurement.Metric> testMetrics)
报告单个测试用例的执行结束。 |
void
|
testRunEnded(long elapsedTimeMillis, Map<String, String> runMetrics)
|
void
|
testRunEnded(long elapsedTime, HashMap<String, MetricMeasurement.Metric> runMetrics)
报告测试运行结束。 |
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, long endTime, Map<String, String> testMetrics)
| 参数 | |
|---|---|
test |
TestDescription |
endTime |
long |
testMetrics |
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)
| 参数 | |
|---|---|
test |
TestDescription |
testMetrics |
Map |
testEnded
public void testEnded (TestDescription test, HashMap<String, MetricMeasurement.Metric> testMetrics)
报告单个测试用例的执行结束。
如果未调用 testFailed(TestDescription, FailureDescription),则此测试通过。还会返回在测试用例执行期间可能发出的任何键值
指标。
| 参数 | |
|---|---|
test |
TestDescription:标识测试 |
testMetrics |
HashMap:发出的指标的 Map |
testRunEnded
public void testRunEnded (long elapsedTimeMillis,
Map<String, String> runMetrics)| 参数 | |
|---|---|
elapsedTimeMillis |
long |
runMetrics |
Map |
testRunEnded
public void testRunEnded (long elapsedTime,
HashMap<String, MetricMeasurement.Metric> runMetrics)报告测试运行结束。FIXME:我们不能有两个具有不同类型的 Map<> 接口,因此 我们必须在此处使用 HashMap。
| 参数 | |
|---|---|
elapsedTime |
long:设备报告的经过时间,以毫秒为单位 |
runMetrics |
HashMap:在测试运行结束时报告的键值对,带有 Metric。 |
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(TestDescription) 的替代方法,可用于指定测试开始时间,并与 testEnded(TestDescription,long,Map) 结合使用,以进行准确测量。
| 参数 | |
|---|---|
test |
TestDescription:标识测试 |
startTime |
long:测试开始时间,通过 System.currentTimeMillis() 测量 |
testStarted
public void testStarted (TestDescription test)
报告单个测试用例的开始。旧接口,应尽可能使用 testStarted(TestDescription)。
| 参数 | |
|---|---|
test |
TestDescription:标识测试 |