测试文件推送设置
public class TestFilePushSetup
extends BaseTargetPreparer
implements IDiscoverDependencies
java.lang.Object | ||
↳ | com.android.tradefed.targetprep.BaseTargetPreparer | |
↳ | com.android.tradefed.targetprep.TestFilePushSetup |
一种ITargetPreparer
,将IDeviceBuildInfo.getTestsDir()
文件夹中的一个或多个文件/目录推送到设备上。
如果测试 zip 不存在或不包含所需的 apk,则此准备器将在备用目录中查找。搜索将从指定的最后一个替代目录到第一个指定的顺序进行。
概括
公共构造函数 | |
---|---|
TestFilePushSetup () |
公共方法 | |
---|---|
reportDependencies () | |
void | setUp ( TestInformation testInfo)
|
受保护的方法 | |
---|---|
void | addTestFileName (String fileName) 将文件添加到要推送的项目列表中 |
void | clearTestFileName () |
getFailedToPushFiles () 返回推送失败的文件集。 | |
File | getLocalPathForFilename ( IBuildInfo buildInfo, String fileName, ITestDevice device) 根据构建信息中的测试工件信息解析主机端路径。 |
getTestFileNames () 检索要从测试 zip 推送到设备上的文件列表 | |
void | setThrowIfNoFile (boolean throwIfNoFile) |
公共构造函数
测试文件推送设置
public TestFilePushSetup ()
公共方法
报告依赖关系
publicreportDependencies ()
退货 | |
---|---|
设置
public void setUp (TestInformation testInfo)
参数 | |
---|---|
testInfo | TestInformation |
投掷 | |
---|---|
BuildError | |
DeviceNotAvailableException | |
TargetSetupError |
受保护的方法
添加测试文件名
protected void addTestFileName (String fileName)
将文件添加到要推送的项目列表中
清除测试文件名
protected void clearTestFileName ()
获取推送文件失败
protectedgetFailedToPushFiles ()
返回推送失败的文件集。仅当 'throw-if-not-found' 为 false 时才能使用,否则第一次失败的推送将引发异常。
退货 | |
---|---|
获取文件名的本地路径
protected File getLocalPathForFilename (IBuildInfo buildInfo, String fileName, ITestDevice device)
根据构建信息中的测试工件信息解析主机端路径。
参数 | |
---|---|
buildInfo | IBuildInfo :构建工件信息 |
fileName | String : 要推送的工件的文件名 |
device | ITestDevice |
退货 | |
---|---|
File | 表示主机上的物理文件/路径ERROR(/File) |
投掷 | |
---|---|
TargetSetupError |
获取测试文件名
protectedgetTestFileNames ()
检索要从测试 zip 推送到设备上的文件列表
退货 | |
---|---|
如果没有文件则设置抛出异常
protected void setThrowIfNoFile (boolean throwIfNoFile)
参数 | |
---|---|
throwIfNoFile | boolean |