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)

Runs the tests, and reports result to the listener.

void setConfiguration(IConfiguration configuration)

注入使用的 IConfiguration

void setDevice(ITestDevice device)

注入受測裝置。

void setMetricCollectors(List<IMetricCollector> collectors)

設定為測試執行定義的 IMetricCollector 清單。

boolean shouldRetry(int attemptJustExecuted, List<TestRunResult> previousResults, Set<String> skipList)

委派來源:IRetryDecision.shouldRetry(IRemoteTest,int,List)

Collection<IRemoteTest> split(int shardCountHint)

split() 的替代版本,也會提供嘗試執行的 shardCount。

公用建構函式

InstalledInstrumentationsTest

public InstalledInstrumentationsTest ()

公用方法

getDevice

public ITestDevice getDevice ()

取得受測裝置。

傳回
ITestDevice ITestDevice

得分

public void run (TestInformation testInfo, 
                ITestInvocationListener listener)

執行測試,並向接聽程式回報結果。

參數
testInfo TestInformation:包含執行測試實用資訊的 TestInformation 物件。

listener ITestInvocationListener:測試結果的 ITestInvocationListener

擲回
DeviceNotAvailableException

setConfiguration

public void setConfiguration (IConfiguration configuration)

注入使用的 IConfiguration

參數
configuration IConfiguration

setDevice

public void setDevice (ITestDevice device)

注入測試裝置。

參數
device ITestDevice:要使用的 ITestDevice

setMetricCollectors

public void setMetricCollectors (List<IMetricCollector> collectors)

設定為測試執行作業定義的 IMetricCollector 清單。

參數
collectors List

shouldRetry

public boolean shouldRetry (int attemptJustExecuted, 
                List<TestRunResult> previousResults, 
                Set<String> skipList)

委派來源:IRetryDecision.shouldRetry(IRemoteTest,int,List)。決定是否要嘗試重試。此外,請對 IRemoteTest 進行任何必要變更,以便重試 (套用篩選器、準備下次執行等)。

參數
attemptJustExecuted int:我們剛執行的嘗試次數。

previousResults List:剛執行的測試 TestRunResult 清單。

skipList Set:不應重試的項目集。

傳回
boolean 如果應重試,則為 True,否則為 False。

擲回
DeviceNotAvailableException

拆分

public Collection<IRemoteTest> split (int shardCountHint)

split() 的替代版本,也會提供嘗試執行的 shardCount。這項功能適用於有時無法任意決定的測試執行器。

參數
shardCountHint int:嘗試的分片數量。

傳回
Collection<IRemoteTest> 要個別執行的子測試集合,或 null 如果測試目前無法分片