InstalledInstrumentationsTest
public
class
InstalledInstrumentationsTest
extends Object
implements
IAutoRetriableTest,
IConfigurationReceiver,
IDeviceTest,
IMetricCollectorReceiver,
IShardableTest
java.lang.Object | |
↳ | com.android.tradefed.testtype.InstalledInstrumentationsTest |
运行当前设备上找到的所有插桩。
摘要
公共构造函数 | |
---|---|
InstalledInstrumentationsTest()
|
公共方法 | |
---|---|
ITestDevice
|
getDevice()
获取被测设备。 |
void
|
run(TestInformation testInfo, ITestInvocationListener listener)
运行测试并向监听器报告结果。 |
void
|
setConfiguration(IConfiguration configuration)
注入正在使用的 |
void
|
setDevice(ITestDevice device)
注入被测设备。 |
void
|
setMetricCollectors(
设置为测试运行定义的 |
boolean
|
shouldRetry(int attemptJustExecuted,
|
|
split(int shardCountHint)
|
公共构造函数
InstalledInstrumentationsTest
public InstalledInstrumentationsTest ()
公共方法
得分
public void run (TestInformation testInfo, ITestInvocationListener listener)
运行测试并向监听器报告结果。
参数 | |
---|---|
testInfo |
TestInformation :包含运行测试的实用信息的 TestInformation 对象。 |
listener |
ITestInvocationListener :测试结果的 ITestInvocationListener |
抛出 | |
---|---|
DeviceNotAvailableException |
setConfiguration
public void setConfiguration (IConfiguration configuration)
注入正在使用的 IConfiguration
。
参数 | |
---|---|
configuration |
IConfiguration |
setMetricCollectors
public void setMetricCollectors (collectors)
设置为测试运行定义的 IMetricCollector
列表。
参数 | |
---|---|
collectors |
|
shouldRetry
public boolean shouldRetry (int attemptJustExecuted,previousResults, skipList)
委托方:ERROR(IRetryDecision.shouldRetry(IRemoteTest, int, List)/com.android.tradefed.retry.IRetryDecision#shouldRetry(com.android.tradefed.testtype.IRemoteTest,int,List) IRetryDecision.shouldRetry(IRemoteTest, int, List))
。决定是否应尝试重试。此外,请对要重试的 IRemoteTest
进行必要的更改(应用过滤条件、准备下次运行等)。
参数 | |
---|---|
attemptJustExecuted |
int :我们刚刚运行的尝试次数。 |
previousResults |
:刚刚运行的测试的 TestRunResult 列表。 |
skipList |
:不应重试的一组项。 |
返回 | |
---|---|
boolean |
如果应重试,则返回 True;否则返回 False。 |
抛出 | |
---|---|
DeviceNotAvailableException |
分割
publicsplit (int shardCountHint)
split()
的替代版本,还提供尝试运行的分片数量。这对于有时无法任意做出决定的一些测试运行程序非常有用。
参数 | |
---|---|
shardCountHint |
int :尝试的分片数。 |
返回 | |
---|---|
|
要单独执行的一组子测试,如果测试目前不可分片,则为 null |