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 instrument 命令的选项。 |
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 :要执行的插桩测试运行程序。如果为 null,则使用默认的运行程序 |
remoteDevice |
IShellEnabledDevice :要在其中执行测试的 Android 设备 |
RemoteAndroidTestRunner
public RemoteAndroidTestRunner (String packageName, String runnerName, IShellEnabledDevice remoteDevice, RemoteAndroidTestRunner.StatusReporterMode statusReporterMode)
创建远程 Android 测试运行程序。
参数 | |
---|---|
packageName |
String :包含要运行的测试的 Android 应用软件包 |
runnerName |
String :要执行的插桩测试运行程序。如果为 null,则使用默认的运行程序 |
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 |
取消
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 instrument 命令的选项。
返回 | |
---|---|
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 |
setCoverageReportLocation
public void setCoverageReportLocation (String reportPath)
参数 | |
---|---|
reportPath |
String |
setDebug
public void setDebug (boolean debug)
参数 | |
---|---|
debug |
boolean |
setLogOnly
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 |
setMaxtimeToOutputResponse
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 |