InstallApexModuleTargetPreparer
public class InstallApexModuleTargetPreparer
extends SuiteApkInstaller
概要
公开方法 |
---|
| getModulesToInstall (TestInformation testInfo) 根据设备上预装的模块,获取应安装在火车上的模块。 |
void | setUp (TestInformation testInfo) |
void | tearDown (TestInformation testInfo, Throwable e) |
受保护的方法 |
---|
| collectApexInfoFromApexModules ( testAppFileNames, TestInformation testInfo) collectApexInfoFromApexModules ( testAppFileNames, TestInformation testInfo) 从顶点模块收集顶点信息以进行激活检查。 |
boolean | containsPersistentApk ( testAppFileNames, TestInformation testInfo) containsPersistentApk ( testAppFileNames, TestInformation testInfo) 检查输入文件是否包含任何持久性apk。 |
| getApkInstalled () |
String | getBundletoolFileName () |
BundletoolUtil | getBundletoolUtil () |
String | getModuleKeywordFromApexPackageName (String packageName) 从顶点包名称中获取关键字(例如com.android.tzdata.apex的“ tzdata”)。 |
| getModulesFailToActivate ( activatedApexes) getModulesFailToActivate ( activatedApexes) 获取未能激活的模块。 |
void | installTrain (TestInformation testInfo, moduleFilenames, String[] extraArgs) installTrain (TestInformation testInfo, moduleFilenames, String[] extraArgs) 尝试在设备上安装包含顶点的干线火车。 |
void | installUsingBundleTool (TestInformation testInfo, testAppFileNames) installUsingBundleTool (TestInformation testInfo, testAppFileNames) 尝试使用bundletool安装主线模块。 |
void | installer (TestInformation testInfo, testAppFileNames) installer (TestInformation testInfo, testAppFileNames) 尝试在设备上安装软件包或拆分软件包。 |
boolean | isPersistentApk (File filename, TestInformation testInfo) 检查apk是否为持久apk。 |
ITestDevice.ApexInfo | retrieveApexInfo (File testApexFile, DeviceDescriptor deviceDescriptor) 从给定的顶点文件中检索包含packageName和versionCode的ApexInfo。 |
公共建设者
InstallApexModuleTargetPreparer
public InstallApexModuleTargetPreparer ()
公开方法
public getModulesToInstall (TestInformation testInfo)
根据设备上预装的模块,获取应安装在火车上的模块。未预装的模块将不会安装。
投掷 |
---|
DeviceNotAvailableException | 设备不可用时。 |
TargetSetupError | 当未安装强制性模块或无法安装模块时。 |
public void setUp (TestInformation testInfo)
参量 |
---|
testInfo | TestInformation |
投掷 |
---|
BuildError | |
DeviceNotAvailableException | |
TargetSetupError | |
public void tearDown (TestInformation testInfo,
Throwable e)
参量 |
---|
testInfo | TestInformation |
e | Throwable |
投掷 |
---|
DeviceNotAvailableException | |
受保护的方法
protected collectApexInfoFromApexModules ( testAppFileNames,
TestInformation testInfo)
从顶点模块收集顶点信息以进行激活检查。
参量 |
---|
testAppFileNames | :要安装的模块的文件名列表 |
testInfo | TestInformation :测试TestInformation |
退货 |
---|
| 在输入文件列表中包含apex模块的apexinfo的列表 |
protected boolean containsPersistentApk ( testAppFileNames,
TestInformation testInfo)
检查输入文件是否包含任何持久性apk。
参量 |
---|
testAppFileNames | :要安装的模块的文件名列表 |
testInfo | TestInformation :测试TestInformation |
退货 |
---|
boolean | 如果输入文件包含持久性apk模块,则为true 。 |
投掷 |
---|
DeviceNotAvailableException | |
TargetSetupError | |
getApkInstalled
protected getApkInstalled ()
protected String getBundletoolFileName ()
getModuleKeywordFromApexPackageName
protected String getModuleKeywordFromApexPackageName (String packageName)
从顶点包名称中获取关键字(例如com.android.tzdata.apex的“ tzdata”)。
参量 |
---|
packageName | String :顶点文件的包名称。 |
getModulesFailToActivate
protected getModulesFailToActivate ( activatedApexes)
获取未能激活的模块。
参量 |
---|
activatedApexes | :设备上的活动顶点集 |
退货 |
---|
| 包含未能激活的输入顶点模块的apexinfo的列表。 |
投掷 |
---|
DeviceNotAvailableException | |
TargetSetupError | |
protected void installTrain (TestInformation testInfo,
moduleFilenames,
String[] extraArgs)
尝试在设备上安装包含顶点的干线火车。
参量 |
---|
testInfo | TestInformation : TestInformation |
moduleFilenames | :字符串列表。要安装的主线模块的文件名列表。 |
extraArgs | String |
投掷 |
---|
DeviceNotAvailableException | |
TargetSetupError | |
protected void installUsingBundleTool (TestInformation testInfo,
testAppFileNames)
尝试使用bundletool安装主线模块。
参量 |
---|
testInfo | TestInformation : TestInformation |
testAppFileNames | :要安装的预加载模块的文件名。 |
投掷 |
---|
DeviceNotAvailableException | |
TargetSetupError | |
protected void installer (TestInformation testInfo,
testAppFileNames)
尝试在设备上安装软件包或拆分软件包。
参量 |
---|
testInfo | TestInformation :调用的TestInformation |
testAppFileNames | :要安装的apk及其软件包。 |
投掷 |
---|
DeviceNotAvailableException | |
TargetSetupError | |
protected boolean isPersistentApk (File filename,
TestInformation testInfo)
检查apk是否为持久apk。
退货 |
---|
boolean | 如果这是一个持久性apk模块,则为true 。 |
投掷 |
---|
DeviceNotAvailableException | |
TargetSetupError | |
resolveApexInfo
protected ITestDevice.ApexInfo retrieveApexInfo (File testApexFile,
DeviceDescriptor deviceDescriptor)
从给定的顶点文件中检索包含packageName和versionCode的ApexInfo。
参量 |
---|
testApexFile | File :我们从中检索信息的顶点文件。 |
deviceDescriptor | DeviceDescriptor |
退货 |
---|
ITestDevice.ApexInfo | 包含给定文件的packageName和versionCode的ApexInfo |
投掷 |
---|
TargetSetupError | 如果aapt解析器无法解析文件。 |