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解析器無法解析文件。 |