to top
public class

XmlDefsTest

extends Object
implements IDeviceTest IResumableTest IShardableTest @OptionClass(alias = "xml-defs")
java.lang.Object
   ↳ com.android.tradefed.testtype.testdefs.XmlDefsTest

Class Overview

Runs a set of instrumentation test's defined in test_defs.xml files.

The test definition files can either be one or more files on local file system, and/or one or more files stored on the device under test.

Summary

Constants
String COVERAGE_TARGET_KEY the metric key name for the test coverage target value
Fields
private boolean mIsRerunMode @Option(name = "rerun", description = "Rerun unexecuted tests individually on same device if test run fails to complete.")
private boolean mIsResumeMode @Option(name = "resume", description = "Schedule unexecuted tests for resumption on another device if first device becomes unavailable.")
private Collection<File> mLocalFiles @Option(name = "local-file-path", description = "local file path to test_defs.xml file to run.")
private int mNumShards @Option(name = "num-shards", description = "Shard this test into given number of separately runnable chunks.")
private Collection<String> mRemotePaths @Option(name = "device-file-path", description = "file path on device to test_defs.xml file to run.", importance = com.android.tradefed.config.Option.Importance.IF_UNSET)
private boolean mSendCoverage @Option(name = "send-coverage", description = "Send coverage target info to test listeners.")
private long mShellTimeout @Option(name = "shell-timeout", description = "The defined timeout (in milliseconds) is used as a maximum waiting time when expecting the command output from the device. At any time, if the shell command does not output anything for a period longer than defined timeout the TF run terminates. For no timeout, set to 0.")
private String mTestSize @Option(name = "size", description = "Restrict tests to a specific test size. One of \'small\', \'medium\', \'large\'", importance = com.android.tradefed.config.Option.Importance.IF_UNSET)
private int mTestTimeout @Option(name = "test-timeout", description = "Sets timeout (in milliseconds) that will be applied to each test. In the event of a test timeout it will log the results and proceed with executing the next test. For no timeout, set to 0.")
private Integer mTimeout @Option(name = "timeout", description = "Deprecated - Use \"shell-timeout\" or \"test-timeout\" instead.")
Public Constructors
XmlDefsTest()
Public Methods
ITestDevice getDevice()
Get the device under test.
boolean isResumable()
void run(ITestInvocationListener listener)
Runs the tests, and reports result to the listener.
void setDevice(ITestDevice device)
Inject the device under test.
Collection<IRemoteTest> split()
Shard the test into separately runnable chunks.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.android.tradefed.testtype.IDeviceTest
From interface com.android.tradefed.testtype.IResumableTest
From interface com.android.tradefed.testtype.IShardableTest
From interface com.android.tradefed.testtype.IRemoteTest

Constants

public static final String COVERAGE_TARGET_KEY

the metric key name for the test coverage target value

Constant Value: "coverage_target"

Fields

private boolean mIsRerunMode

private boolean mIsResumeMode

private Collection<File> mLocalFiles

private int mNumShards

private Collection<String> mRemotePaths

private boolean mSendCoverage

private long mShellTimeout

private String mTestSize

private int mTestTimeout

private Integer mTimeout

Public Constructors

public XmlDefsTest ()

Public Methods

public ITestDevice getDevice ()

Get the device under test.

Returns

public boolean isResumable ()

public void run (ITestInvocationListener listener)

Runs the tests, and reports result to the listener.

Parameters
listener the ITestInvocationListener of test results

public void setDevice (ITestDevice device)

Inject the device under test.

Parameters
device the ITestDevice to use

public Collection<IRemoteTest> split ()

Shard the test into separately runnable chunks.

This will be called before test execution, so injected dependencies (such as the ITestDevice for IDeviceTests) may be null.

Returns
  • a collection of subtests to be executed separately or null if test is not currently shardable