RemoteAndroidTestRunner
public
class
RemoteAndroidTestRunner
extends Object
implements
IRemoteAndroidTestRunner
java.lang.Object | |
↳ | com.android.tradefed.result.ddmlib.RemoteAndroidTestRunner |
遠端執行 Android 測試指令並回報結果。
摘要
公用建構函式 | |
---|---|
RemoteAndroidTestRunner(String packageName, IShellEnabledDevice remoteDevice)
替代建構函式。 |
|
RemoteAndroidTestRunner(String packageName, String runnerName, IShellEnabledDevice remoteDevice)
替代建構函式。 |
|
RemoteAndroidTestRunner(String packageName, String runnerName, IShellEnabledDevice remoteDevice, RemoteAndroidTestRunner.StatusReporterMode statusReporterMode)
建立遠端 Android 測試執行程式。 |
公用方法 | |
---|---|
void
|
addBooleanArg(String name, boolean value)
|
void
|
addInstrumentationArg(String name, String value)
|
void
|
cancel()
|
IInstrumentationResultParser
|
createParser(String runName,
建立用來剖析檢測的 |
String
|
getAmInstrumentCommand()
|
IRemoteAndroidTestRunner.CoverageOutput
|
getCoverageOutputType()
|
String
|
getPackageName()
|
String
|
getRunOptions()
傳回 am 檢測指令的選項。 |
String
|
getRunnerName()
|
void
|
removeInstrumentationArg(String name)
|
void
|
run(ITestRunListener... listeners)
|
void
|
run(
|
void
|
setAdditionalTestOutputLocation(String additionalTestDataPath)
|
void
|
setClassName(String className)
|
void
|
setClassNames(String[] classNames)
|
void
|
setCoverage(boolean coverage)
|
void
|
setCoverageReportLocation(String reportPath)
|
void
|
setDebug(boolean debug)
|
void
|
setLogOnly(boolean logOnly)
|
void
|
setMaxTimeToOutputResponse(long maxTimeToOutputResponse, TimeUnit maxTimeUnits)
|
void
|
setMaxTimeout(long maxTimeout, TimeUnit maxTimeUnits)
|
void
|
setMaxtimeToOutputResponse(int maxTimeToOutputResponse)
|
void
|
setMethodName(String className, String testName)
|
void
|
setRunName(String runName)
|
void
|
setRunOptions(String options)
設定 am 檢測指令的選項。 |
void
|
setTestCollection(boolean collect)
|
void
|
setTestPackageName(String packageName)
|
void
|
setTestSize(IRemoteAndroidTestRunner.TestSize size)
|
保護方法 | |
---|---|
String
|
getArgsCommand()
針對提供的檢測引數,傳回完整的檢測指令列語法。 |
String
|
getRunnerPath()
傳回完整的檢測元件路徑。 |
公用建構函式
RemoteAndroidTestRunner
public RemoteAndroidTestRunner (String packageName, IShellEnabledDevice remoteDevice)
替代建構函式。使用預設的檢測執行器。
參數 | |
---|---|
packageName |
String :包含要執行測試的 Android 應用程式套件 |
remoteDevice |
IShellEnabledDevice :要執行測試的 Android 裝置 |
RemoteAndroidTestRunner
public RemoteAndroidTestRunner (String packageName, String runnerName, IShellEnabledDevice remoteDevice)
替代建構函式。使用預設的 statusReporterMode
。
參數 | |
---|---|
packageName |
String :包含要執行的測試的 Android 應用程式套件 |
runnerName |
String :要執行的檢測設備測試執行器。如果為空值,系統會使用預設的執行工具 |
remoteDevice |
IShellEnabledDevice :要執行測試的 Android 裝置 |
RemoteAndroidTestRunner
public RemoteAndroidTestRunner (String packageName, String runnerName, IShellEnabledDevice remoteDevice, RemoteAndroidTestRunner.StatusReporterMode statusReporterMode)
建立遠端 Android 測試執行器。
參數 | |
---|---|
packageName |
String :包含要執行的測試的 Android 應用程式套件 |
runnerName |
String :要執行的檢測設備測試執行器。如果為空值,系統會使用預設的執行工具 |
remoteDevice |
IShellEnabledDevice :要執行測試的 Android 裝置 |
statusReporterMode |
RemoteAndroidTestRunner.StatusReporterMode :用於 am 檢測指令的狀態回報器模式 |
公用方法
addBooleanArg
public void addBooleanArg (String name, boolean value)
參數 | |
---|---|
name |
String |
value |
boolean |
addInstrumentationArg
public void addInstrumentationArg (String name, String value)
參數 | |
---|---|
name |
String |
value |
String |
cancel
public void cancel ()
createParser
public IInstrumentationResultParser createParser (String runName,listeners)
建立將用於剖析檢測輸出的 InstrumentationResultParser
。
參數 | |
---|---|
runName |
String :要使用的執行作業名稱。 |
listeners |
:要用來回報結果的事件監聽器。 |
傳回 | |
---|---|
IInstrumentationResultParser |
InstrumentationResultParser 的例項。 |
getAmInstrumentCommand
public String getAmInstrumentCommand ()
傳回 | |
---|---|
String |
getCoverageOutputType
public IRemoteAndroidTestRunner.CoverageOutput getCoverageOutputType ()
傳回 | |
---|---|
IRemoteAndroidTestRunner.CoverageOutput |
getPackageName
public String getPackageName ()
傳回 | |
---|---|
String |
getRunOptions
public String getRunOptions ()
傳回 am 檢測指令的選項。
傳回 | |
---|---|
String |
getRunnerName
public String getRunnerName ()
傳回 | |
---|---|
String |
removeInstrumentationArg
public void removeInstrumentationArg (String name)
參數 | |
---|---|
name |
String |
得分
public void run (ITestRunListener... listeners)
參數 | |
---|---|
listeners |
ITestRunListener |
擲回 | |
---|---|
AdbCommandRejectedException |
|
ShellCommandUnresponsiveException |
|
TimeoutException |
得分
public void run (listeners)
參數 | |
---|---|
listeners |
|
擲回 | |
---|---|
AdbCommandRejectedException |
|
ShellCommandUnresponsiveException |
|
TimeoutException |
setAdditionalTestOutputLocation
public void setAdditionalTestOutputLocation (String additionalTestDataPath)
參數 | |
---|---|
additionalTestDataPath |
String |
setClassName
public void setClassName (String className)
參數 | |
---|---|
className |
String |
setClassNames
public void setClassNames (String[] classNames)
參數 | |
---|---|
classNames |
String |
setCoverage
public void setCoverage (boolean coverage)
參數 | |
---|---|
coverage |
boolean |
設定 CoverageReportLocation
public void setCoverageReportLocation (String reportPath)
參數 | |
---|---|
reportPath |
String |
setDebug
public void setDebug (boolean debug)
參數 | |
---|---|
debug |
boolean |
僅設定記錄檔
public void setLogOnly (boolean logOnly)
參數 | |
---|---|
logOnly |
boolean |
setMaxTimeToOutputResponse
public void setMaxTimeToOutputResponse (long maxTimeToOutputResponse, TimeUnit maxTimeUnits)
參數 | |
---|---|
maxTimeToOutputResponse |
long |
maxTimeUnits |
TimeUnit |
setMaxTimeout
public void setMaxTimeout (long maxTimeout, TimeUnit maxTimeUnits)
參數 | |
---|---|
maxTimeout |
long |
maxTimeUnits |
TimeUnit |
設定 MaxtimeToOutputResponse
public void setMaxtimeToOutputResponse (int maxTimeToOutputResponse)
參數 | |
---|---|
maxTimeToOutputResponse |
int |
setMethodName
public void setMethodName (String className, String testName)
參數 | |
---|---|
className |
String |
testName |
String |
setRunName
public void setRunName (String runName)
參數 | |
---|---|
runName |
String |
setRunOptions
public void setRunOptions (String options)
設定 am 檢測指令的選項。如需完整清單,請參閱 com/android/commands/am/Am.java
參數 | |
---|---|
options |
String |
setTestCollection
public void setTestCollection (boolean collect)
參數 | |
---|---|
collect |
boolean |
setTestPackageName
public void setTestPackageName (String packageName)
參數 | |
---|---|
packageName |
String |
setTestSize
public void setTestSize (IRemoteAndroidTestRunner.TestSize size)
參數 | |
---|---|
size |
IRemoteAndroidTestRunner.TestSize |
保護方法
getArgsCommand
protected String getArgsCommand ()
針對提供的檢測引數,傳回完整的檢測指令列語法。如果未指定引數,就會傳回空白字串。
傳回 | |
---|---|
String |
getRunnerPath
protected String getRunnerPath ()
傳回完整的檢測元件路徑。
傳回 | |
---|---|
String |