安裝儀器測試
public class InstalledInstrumentationsTest
extends Object
implements IDeviceTest , IShardableTest , IMetricCollectorReceiver , IAutoRetriableTest , IConfigurationReceiver
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 ( collectors) setMetricCollectors ( collectors) 設定為測試運行定義的 |
boolean | shouldRetry (int attemptJustExecuted, previousResults, skipList) shouldRetry (int attemptJustExecuted, previousResults, skipList) shouldRetry (int attemptJustExecuted, previousResults, skipList) |
split (int shardCountHint) |
公共構造函數
安裝儀器測試
public InstalledInstrumentationsTest ()
公共方法
跑步
public void run (TestInformation testInfo, ITestInvocationListener listener)
運行測試,並將結果報告給偵聽器。
參數 | |
---|---|
testInfo | TestInformation : TestInformation 物件包含執行測試的有用資訊。 |
listener | ITestInvocationListener :測試結果的ITestInvocationListener |
投擲 | |
---|---|
DeviceNotAvailableException |
設定配置
public void setConfiguration (IConfiguration configuration)
注入正在使用的IConfiguration
。
參數 | |
---|---|
configuration | IConfiguration |
設定MetricCollectors
public void setMetricCollectors (collectors)
設定為測試運行定義的IMetricCollector
清單。
參數 | |
---|---|
collectors |
應該重試
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()
的替代版本還提供嘗試運行的 shardCount。這對於某些有時無法隨意決定的測試運行者很有用。
參數 | |
---|---|
shardCountHint | int :嘗試的分片計數。 |
退貨 | |
---|---|
要單獨執行的子測試的集合,如果測試目前不可分片,則為null |