|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.android.ddmlib.testrunner.RemoteAndroidTestRunner
public class RemoteAndroidTestRunner
Runs a Android test command remotely and reports results.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface com.android.ddmlib.testrunner.IRemoteAndroidTestRunner |
|---|
IRemoteAndroidTestRunner.TestSize |
| Constructor Summary | |
|---|---|
RemoteAndroidTestRunner(java.lang.String packageName,
IShellEnabledDevice remoteDevice)
Alternate constructor. |
|
RemoteAndroidTestRunner(java.lang.String packageName,
java.lang.String runnerName,
IShellEnabledDevice remoteDevice)
Creates a remote Android test runner. |
|
| Method Summary | |
|---|---|
void |
addBooleanArg(java.lang.String name,
boolean value)
Adds a boolean argument to include in instrumentation command. |
void |
addInstrumentationArg(java.lang.String name,
java.lang.String value)
Adds a argument to include in instrumentation command. |
void |
cancel()
Requests cancellation of this test run. |
java.lang.String |
getPackageName()
Returns the application package name. |
java.lang.String |
getRunnerName()
Returns the runnerName. |
void |
removeInstrumentationArg(java.lang.String name)
Removes a previously added argument. |
void |
run(java.util.Collection<ITestRunListener> listeners)
Execute this test run. |
void |
run(ITestRunListener... listeners)
Execute this test run. |
void |
setClassName(java.lang.String className)
Sets to run only tests in this class Must be called before 'run'. |
void |
setClassNames(java.lang.String[] classNames)
Sets to run only tests in the provided classes Must be called before 'run'. |
void |
setCoverage(boolean coverage)
Sets this code coverage mode of this test run. |
void |
setDebug(boolean debug)
Sets this debug mode of this test run. |
void |
setLogOnly(boolean logOnly)
Sets this test run to log only mode - skips test execution. |
void |
setMaxtimeToOutputResponse(int maxTimeToOutputResponse)
|
void |
setMaxTimeToOutputResponse(long maxTimeToOutputResponse,
java.util.concurrent.TimeUnit maxTimeUnits)
Sets the maximum time allowed between output of the shell command running the tests on the devices. |
void |
setMethodName(java.lang.String className,
java.lang.String testName)
Sets to run only specified test method Must be called before 'run'. |
void |
setRunName(java.lang.String runName)
Set a custom run name to be reported to the ITestRunListener on IRemoteAndroidTestRunner.run(com.android.ddmlib.testrunner.ITestRunListener...)
If unspecified, will use package name |
void |
setRunOptions(java.lang.String options)
Sets options for the am instrument command. |
void |
setTestCollection(boolean collect)
Sets this test run to test collection mode. |
void |
setTestPackageName(java.lang.String packageName)
Sets to run all tests in specified package Must be called before 'run'. |
void |
setTestSize(IRemoteAndroidTestRunner.TestSize size)
Sets to run only tests of given size. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RemoteAndroidTestRunner(java.lang.String packageName,
java.lang.String runnerName,
IShellEnabledDevice remoteDevice)
packageName - the Android application package that contains the tests to runrunnerName - the instrumentation test runner to execute. If null, will use default
runnerremoteDevice - the Android device to execute tests on
public RemoteAndroidTestRunner(java.lang.String packageName,
IShellEnabledDevice remoteDevice)
packageName - the Android application package that contains the tests to runremoteDevice - the Android device to execute tests on| Method Detail |
|---|
public java.lang.String getPackageName()
IRemoteAndroidTestRunner
getPackageName in interface IRemoteAndroidTestRunnerpublic java.lang.String getRunnerName()
IRemoteAndroidTestRunner
getRunnerName in interface IRemoteAndroidTestRunnerpublic void setClassName(java.lang.String className)
IRemoteAndroidTestRunner
setClassName in interface IRemoteAndroidTestRunnerclassName - fully qualified class name (eg x.y.z)public void setClassNames(java.lang.String[] classNames)
IRemoteAndroidTestRunnerIf providing more than one class, requires a InstrumentationTestRunner that supports the multiple class argument syntax.
setClassNames in interface IRemoteAndroidTestRunnerclassNames - array of fully qualified class names (eg x.y.z)
public void setMethodName(java.lang.String className,
java.lang.String testName)
IRemoteAndroidTestRunner
setMethodName in interface IRemoteAndroidTestRunnerclassName - fully qualified class name (eg x.y.z)testName - method namepublic void setTestPackageName(java.lang.String packageName)
IRemoteAndroidTestRunner
setTestPackageName in interface IRemoteAndroidTestRunnerpackageName - fully qualified package name (eg x.y.z)
public void addInstrumentationArg(java.lang.String name,
java.lang.String value)
IRemoteAndroidTestRunner
addInstrumentationArg in interface IRemoteAndroidTestRunnername - the name of the instrumentation bundle argumentvalue - the value of the argumentpublic void removeInstrumentationArg(java.lang.String name)
IRemoteAndroidTestRunner
removeInstrumentationArg in interface IRemoteAndroidTestRunnername - the name of the instrumentation bundle argument to remove
public void addBooleanArg(java.lang.String name,
boolean value)
IRemoteAndroidTestRunner
addBooleanArg in interface IRemoteAndroidTestRunnername - the name of the instrumentation bundle argumentvalue - the value of the argumentaddInstrumentationArg(java.lang.String, java.lang.String)public void setLogOnly(boolean logOnly)
IRemoteAndroidTestRunner
setLogOnly in interface IRemoteAndroidTestRunnerpublic void setDebug(boolean debug)
IRemoteAndroidTestRunner
setDebug in interface IRemoteAndroidTestRunnerpublic void setCoverage(boolean coverage)
IRemoteAndroidTestRunner
setCoverage in interface IRemoteAndroidTestRunnerpublic void setTestSize(IRemoteAndroidTestRunner.TestSize size)
IRemoteAndroidTestRunner
setTestSize in interface IRemoteAndroidTestRunnersize - the IRemoteAndroidTestRunner.TestSize to run.public void setTestCollection(boolean collect)
IRemoteAndroidTestRunner
setTestCollection in interface IRemoteAndroidTestRunnerpublic void setMaxtimeToOutputResponse(int maxTimeToOutputResponse)
setMaxtimeToOutputResponse in interface IRemoteAndroidTestRunner
public void setMaxTimeToOutputResponse(long maxTimeToOutputResponse,
java.util.concurrent.TimeUnit maxTimeUnits)
IRemoteAndroidTestRunner
setMaxTimeToOutputResponse in interface IRemoteAndroidTestRunnermaxTimeToOutputResponse - the maximum amount of time during which the command is allowed
to not output any response. A value of 0 means the method will wait forever
(until the receiver cancels the execution) for command output and
never throw.maxTimeUnits - Units for non-zero maxTimeToOutputResponse values.IDevice.executeShellCommand(String, com.android.ddmlib.IShellOutputReceiver, int)public void setRunName(java.lang.String runName)
IRemoteAndroidTestRunnerITestRunListener on IRemoteAndroidTestRunner.run(com.android.ddmlib.testrunner.ITestRunListener...)
If unspecified, will use package name
setRunName in interface IRemoteAndroidTestRunner
public void run(ITestRunListener... listeners)
throws TimeoutException,
AdbCommandRejectedException,
ShellCommandUnresponsiveException,
java.io.IOException
IRemoteAndroidTestRunnerIRemoteAndroidTestRunner.run(Collection).
run in interface IRemoteAndroidTestRunnerlisteners - listens for test results
TimeoutException - in case of a timeout on the connection.
AdbCommandRejectedException - if adb rejects the command
ShellCommandUnresponsiveException - if the device did not output any test result for
a period longer than the max time to output.
java.io.IOException - if connection to device was lost.IRemoteAndroidTestRunner.setMaxtimeToOutputResponse(int)
public void run(java.util.Collection<ITestRunListener> listeners)
throws TimeoutException,
AdbCommandRejectedException,
ShellCommandUnresponsiveException,
java.io.IOException
IRemoteAndroidTestRunner
run in interface IRemoteAndroidTestRunnerlisteners - collection of listeners for test results
TimeoutException - in case of a timeout on the connection.
AdbCommandRejectedException - if adb rejects the command
ShellCommandUnresponsiveException - if the device did not output any test result for
a period longer than the max time to output.
java.io.IOException - if connection to device was lost.IRemoteAndroidTestRunner.setMaxtimeToOutputResponse(int)
public void setRunOptions(@NonNull
java.lang.String options)
public void cancel()
IRemoteAndroidTestRunner
cancel in interface IRemoteAndroidTestRunner
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||