public interface IRemoteAndroidTestRunner
| Modifier and Type | Interface and Description |
|---|---|
static class |
IRemoteAndroidTestRunner.CoverageOutput |
static class |
IRemoteAndroidTestRunner.TestSize |
| Modifier and Type | Method and Description |
|---|---|
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.
|
IRemoteAndroidTestRunner.CoverageOutput |
getCoverageOutputType()
Returns the type of the test coverage produces by the runner.
|
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 |
setCoverageReportLocation(java.lang.String reportPath)
Sets the location of the generated coverage reports.
|
void |
setDebug(boolean debug)
Sets this debug mode of this test run.
|
void |
setEnforceTimeStamp(boolean enforceTimestamp)
Sets this test to enforce expecting a final time stamp from the instrumentation otherwise the
run will be considered failed.
|
void |
setLogOnly(boolean logOnly)
Sets this test run to log only mode - skips test execution.
|
void |
setMaxTimeout(long maxTimeout,
java.util.concurrent.TimeUnit maxTimeUnits)
Sets the maximum time allowed for the instrumentation to finish.
|
void |
setMaxtimeToOutputResponse(int maxTimeToOutputResponse)
Deprecated.
|
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 run(com.android.ddmlib.testrunner.ITestRunListener...) |
void |
setTestCollection(boolean collection)
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.
|
java.lang.String getPackageName()
java.lang.String getRunnerName()
void setClassName(java.lang.String className)
className - fully qualified class name (eg x.y.z)void setClassNames(java.lang.String[] classNames)
If providing more than one class, requires a InstrumentationTestRunner that supports the multiple class argument syntax.
classNames - array of fully qualified class names (eg x.y.z)void setMethodName(java.lang.String className,
java.lang.String testName)
className - fully qualified class name (eg x.y.z)testName - method namevoid setTestPackageName(java.lang.String packageName)
packageName - fully qualified package name (eg x.y.z)void setTestSize(IRemoteAndroidTestRunner.TestSize size)
size - the IRemoteAndroidTestRunner.TestSize to run.void addInstrumentationArg(java.lang.String name,
java.lang.String value)
Must be called before 'run'. If an argument with given name has already been provided, it's value will be overridden.
name - the name of the instrumentation bundle argumentvalue - the value of the argumentvoid removeInstrumentationArg(java.lang.String name)
name - the name of the instrumentation bundle argument to removevoid addBooleanArg(java.lang.String name,
boolean value)
name - the name of the instrumentation bundle argumentvalue - the value of the argumentRemoteAndroidTestRunner.addInstrumentationArg(java.lang.String, java.lang.String)void setLogOnly(boolean logOnly)
void setDebug(boolean debug)
void setCoverage(boolean coverage)
void setCoverageReportLocation(java.lang.String reportPath)
IRemoteAndroidTestRunner.CoverageOutput getCoverageOutputType()
IRemoteAndroidTestRunner.CoverageOutput.void setEnforceTimeStamp(boolean enforceTimestamp)
void setTestCollection(boolean collection)
@Deprecated void setMaxtimeToOutputResponse(int maxTimeToOutputResponse)
setMaxTimeToOutputResponse(long, java.util.concurrent.TimeUnit).void setMaxTimeToOutputResponse(long maxTimeToOutputResponse,
java.util.concurrent.TimeUnit maxTimeUnits)
This allows setting a timeout in case the tests can become stuck and never finish. This is different from the normal timeout on the connection.
By default no timeout will be specified.
maxTimeToOutputResponse - 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 and maxTimeout
values.IShellEnabledDevice.executeShellCommand(String, com.android.ddmlib.IShellOutputReceiver, long, long,
TimeUnit)void setMaxTimeout(long maxTimeout,
java.util.concurrent.TimeUnit maxTimeUnits)
This allows setting a timeout in case the tests can become stuck and never finish. This is different from the normal timeout on the connection.
By default no timeout will be specified.
maxTimeout - 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 and maxTimeout
values.IShellEnabledDevice.executeShellCommand(String, com.android.ddmlib.IShellOutputReceiver, long, long,
TimeUnit)void setRunName(java.lang.String runName)
ITestRunListener on run(com.android.ddmlib.testrunner.ITestRunListener...)
If unspecified, will use package name
runName - void run(ITestRunListener... listeners) throws TimeoutException, AdbCommandRejectedException, ShellCommandUnresponsiveException, java.io.IOException
Convenience method for run(Collection).
listeners - listens for test resultsTimeoutException - in case of a timeout on the connection.AdbCommandRejectedException - if adb rejects the commandShellCommandUnresponsiveException - 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.setMaxtimeToOutputResponse(int)void run(java.util.Collection<ITestRunListener> listeners) throws TimeoutException, AdbCommandRejectedException, ShellCommandUnresponsiveException, java.io.IOException
listeners - collection of listeners for test resultsTimeoutException - in case of a timeout on the connection.AdbCommandRejectedException - if adb rejects the commandShellCommandUnresponsiveException - 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.setMaxtimeToOutputResponse(int)void cancel()