Cài đặtApexModuleTargetPreparer
public class InstallApexModuleTargetPreparer
extends SuiteApkInstaller
Các lớp con trực tiếp đã biết |
Bản tóm tắt
Phương pháp được bảo vệ |
---|
void | addApksToTestFiles () |
void | addStagedReadyTimeoutForAdb ( cmd) addStagedReadyTimeoutForAdb ( cmd) |
void | addTimeoutMillisForBundletool ( extraArgs) addTimeoutMillisForBundletool ( extraArgs) |
void | checkApexActivation ( ITestDevice device) Kiểm tra xem tất cả các đỉnh đã được kích hoạt chưa. |
| collectApexInfoFromApexModules ( testAppFileNames, TestInformation testInfo) collectApexInfoFromApexModules ( testAppFileNames, TestInformation testInfo) Thu thập thông tin đỉnh từ các mô-đun đỉnh để kiểm tra kích hoạt. |
| getApkInstalled () |
String | getBundletoolFileName () |
BundletoolUtil | getBundletoolUtil () |
String | getModuleKeywordFromApexPackageName (String packageName) Lấy từ khóa (ví dụ: 'tzdata' cho com.android.tzdata.apex) từ tên gói apex. |
| getModulesFailToActivate ( activatedApexes) getModulesFailToActivate ( activatedApexes) Nhận các mô-đun không kích hoạt được. |
| getSplitsForApks ( TestInformation testInfo, File moduleFile) Trích xuất và trả về các phần tách cho các gói ứng dụng được chỉ định. |
void | initBundletoolUtil ( TestInformation testInfo) Khởi tạo tiện ích Bundletool cho lớp này. |
void | installTrain ( TestInformation testInfo, moduleFilenames) installTrain ( TestInformation testInfo, moduleFilenames) Cố gắng cài đặt một đoàn tàu chính có chứa đỉnh trên thiết bị. |
void | installUsingBundleTool ( TestInformation testInfo, testAppFileNames) installUsingBundleTool ( TestInformation testInfo, testAppFileNames) Cố gắng cài đặt (các) mô-đun đường chính bằng cách sử dụng Bundletool. |
void | installer ( TestInformation testInfo, testAppFileNames) installer ( TestInformation testInfo, testAppFileNames) Cố gắng cài đặt gói hoặc gói chia nhỏ trên thiết bị. |
ITestDevice.ApexInfo | retrieveApexInfo (File testApexFile, DeviceDescriptor deviceDescriptor) Truy xuất ApexInfo chứa packageName và versionCode từ tệp apex đã cho. |
Lĩnh vực
APEX_OPTION
protected static final String APEX_OPTION
APEX_SUFFIX
protected static final String APEX_SUFFIX
APK_SUFFIX
protected static final String APK_SUFFIX
APK_ZIP_OPTION
protected static final String APK_ZIP_OPTION
CHILD_SESSION_CREATION_CMD
protected static final String CHILD_SESSION_CREATION_CMD
PARENT_SESSION_CREATION_CMD
protected static final String PARENT_SESSION_CREATION_CMD
SPLIT_APKS_SUFFIX
protected static final String SPLIT_APKS_SUFFIX
mTrainFolderPath
protected File mTrainFolderPath
Nhà thầu xây dựng công cộng
Cài đặtApexModuleTargetPreparer
public InstallApexModuleTargetPreparer ()
Phương pháp công khai
public getModulesToInstall (TestInformation testInfo)
Lấy các mô-đun cần được cài đặt trên tàu, dựa trên các mô-đun được tải sẵn trên thiết bị. Các mô-đun không được tải sẵn sẽ không được cài đặt.
Trả lại |
---|
| Danh sách trong số các mô-đun sẽ được cài đặt trên thiết bị. |
setIgnoreIfNotPreloaded
public void setIgnoreIfNotPreloaded (boolean skip)
setSkipApexTearDown
public void setSkipApexTearDown (boolean skip)
public void setUp (TestInformation testInfo)
Thông số |
---|
testInfo | TestInformation |
public void tearDown (TestInformation testInfo,
Throwable e)
Thông số |
---|
testInfo | TestInformation |
e | Throwable |
Phương pháp được bảo vệ
addApksToTestFiles
protected void addApksToTestFiles ()
addStagedReadyTimeoutForAdb
protected void addStagedReadyTimeoutForAdb ( cmd)
protected void addTimeoutMillisForBundletool ( extraArgs)
kiểm traApexKích hoạt
protected void checkApexActivation (ITestDevice device)
Kiểm tra xem tất cả các đỉnh đã được kích hoạt chưa.
Thông số |
---|
device | ITestDevice : đang được thử nghiệm. |
protected collectApexInfoFromApexModules ( testAppFileNames,
TestInformation testInfo)
Thu thập thông tin đỉnh từ các mô-đun đỉnh để kiểm tra kích hoạt.
Thông số |
---|
testAppFileNames | : Danh sách tên file của các module cần cài đặt |
testInfo | TestInformation : TestInformation |
Trả lại |
---|
| một danh sách chứa thông tin apex của các mô-đun apex trong danh sách tệp đầu vào |
getApkĐã cài đặt
protected getApkInstalled ()
protected String getBundletoolFileName ()
getModuleKeywordFromApexPackageName
protected String getModuleKeywordFromApexPackageName (String packageName)
Lấy từ khóa (ví dụ: 'tzdata' cho com.android.tzdata.apex) từ tên gói apex.
Thông số |
---|
packageName | String : Tên gói của tệp apex. |
Trả lại |
---|
String | a string Từ khóa của tên gói apex. |
getModulesFailToActivate
protected getModulesFailToActivate ( activatedApexes)
Nhận các mô-đun không kích hoạt được.
Thông số |
---|
activatedApexes | : Tập hợp các đỉnh hoạt động trên thiết bị |
Trả lại |
---|
| một danh sách chứa thông tin đỉnh của các mô-đun đỉnh đầu vào không được kích hoạt. |
protected getSplitsForApks (TestInformation testInfo,
File moduleFile)
Trích xuất và trả về các phần tách cho các gói ứng dụng được chỉ định.
Thông số |
---|
testInfo | TestInformation : TestInformation |
moduleFile | File : Tệp mô-đun để trích xuất các phần tách từ đó. |
Trả lại |
---|
| một Tệp [] chứa các phần tách. |
Ném |
---|
TargetSetupError | nếu không tìm thấy Bundletool hoặc tệp thông số thiết bị không tạo được. |
protected void initBundletoolUtil (TestInformation testInfo)
Khởi tạo tiện ích Bundletool cho lớp này.
protected void installTrain (TestInformation testInfo,
moduleFilenames)
Cố gắng cài đặt một đoàn tàu chính có chứa đỉnh trên thiết bị.
Thông số |
---|
testInfo | TestInformation : TestInformation |
moduleFilenames | : Danh sách chuỗi. Danh sách tên tệp của các mô-đun đường chính sẽ được cài đặt. |
protected void installUsingBundleTool (TestInformation testInfo,
testAppFileNames)
Cố gắng cài đặt (các) mô-đun đường chính bằng cách sử dụng Bundletool.
Thông số |
---|
testInfo | TestInformation : TestInformation |
testAppFileNames | : tên tệp của các mô-đun được tải sẵn để cài đặt. |
protected void installer (TestInformation testInfo,
testAppFileNames)
Cố gắng cài đặt gói hoặc gói chia nhỏ trên thiết bị.
Thông số |
---|
testInfo | TestInformation : TestInformation cho lệnh gọi |
testAppFileNames | : Các gói ứng dụng và gói của chúng sẽ được cài đặt. |
truy xuấtApexInfo
protected ITestDevice.ApexInfo retrieveApexInfo (File testApexFile,
DeviceDescriptor deviceDescriptor)
Truy xuất ApexInfo chứa packageName và versionCode từ tệp apex đã cho.
Thông số |
---|
testApexFile | File : Tệp đỉnh mà chúng tôi lấy thông tin từ đó. |
deviceDescriptor | DeviceDescriptor |