InstallApexModuleTargetPreparer

public class InstallApexModuleTargetPreparer
extends SuiteApkInstaller

java.lang.Object
com.android.tradefed.targetprep.BaseTargetPreparer
com.android.tradefed.targetprep.TestAppInstallSetup
com.android.tradefed.targetprep.suite.SuiteApkInstaller
com.android.tradefed.targetprep.InstallApexModuleTargetPreparer


Bản tóm tắt

Lĩnh vực

protected static final String APEX_OPTION

protected static final String APEX_SUFFIX

protected static final String APK_SUFFIX

protected static final String APK_ZIP_OPTION

protected static final String CHILD_SESSION_CREATION_CMD

protected static final String PARENT_SESSION_CREATION_CMD

protected static final String SPLIT_APKS_SUFFIX

protected File mTrainFolderPath

nhà thầu công cộng

InstallApexModuleTargetPreparer ()

Phương thức công khai

getModulesToInstall ( TestInformation testInfo)

Nhận các mô-đun sẽ đượ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ị.

void setIgnoreIfNotPreloaded (boolean skip)
void setSkipApexTearDown (boolean skip)
void setUp ( TestInformation testInfo)

void tearDown ( TestInformation testInfo, Throwable e)

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 apex từ các mô-đun apex để 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 được kích hoạt.

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 tuyến đường chính có chứa apex trên thiết bị.

void installUsingBundleTool ( TestInformation testInfo, testAppFileNames) installUsingBundleTool ( TestInformation testInfo, testAppFileNames)

Cố gắng cài đặt (các) mô-đun chính bằng bundletool.

void installer ( TestInformation testInfo, testAppFileNames) installer ( TestInformation testInfo, testAppFileNames)

Cố gắng cài đặt mộ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 có 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 công cộng

InstallApexModuleTargetPreparer

public InstallApexModuleTargetPreparer ()

Phương thức công khai

getModulesToInstall

public  getModulesToInstall (TestInformation testInfo)

Nhận các mô-đun sẽ đượ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 trước sẽ không được cài đặt.

Thông số
testInfo TestInformation : TestInformation

trả lại
Danh sách của các mô-đun nên được cài đặt trên thiết bị.

ném
DeviceNotAvailableException khi không có thiết bị.
TargetSetupError khi các mô-đun bắt buộc không được cài đặt hoặc không thể cài đặt mô-đun.

setIgnoreIfNotPreloaded

public void setIgnoreIfNotPreloaded (boolean skip)

Thông số
skip boolean

setSkipApexTearDown

public void setSkipApexTearDown (boolean skip)

Thông số
skip boolean

cài đặt

public void setUp (TestInformation testInfo)

Thông số
testInfo TestInformation

ném
BuildError
DeviceNotAvailableException
TargetSetupError

phá bỏ

public void tearDown (TestInformation testInfo, 
                Throwable e)

Thông số
testInfo TestInformation

e Throwable

ném
DeviceNotAvailableException

phương pháp được bảo vệ

addApksToTestFiles

protected void addApksToTestFiles ()

addStagedReadyTimeoutForAdb

protected void addStagedReadyTimeoutForAdb ( cmd)

Thông số
cmd

addTimeoutMillisForBundletool

protected void addTimeoutMillisForBundletool ( extraArgs)

Thông số
extraArgs

checkApexKí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.

ném
TargetSetupError nếu kích hoạt không thành công.
DeviceNotAvailableException

thu thậpApexInfoFromApexModules

protected  collectApexInfoFromApexModules ( testAppFileNames, 
                TestInformation testInfo)

Thu thập thông tin apex từ các mô-đun apex để 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

ném
TargetSetupError

getApk đã cài đặt

protected  getApkInstalled ()

trả lại

getBundletoolFileName

protected String getBundletoolFileName ()

trả lại
String

getBundletoolUtil

protected BundletoolUtil getBundletoolUtil ()

trả lại
BundletoolUtil

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 một chuỗi Từ khóa của tên gói apex.

getModulesFailToActivate

protected  getModulesFailToActivate ( activatedApexes)

Nhận các mô-đun không được kích hoạt.

Thông số
activatedApexes : Tập hợp các đỉnh đang hoạt động trên thiết bị

trả lại
một danh sách chứa thông tin apex của các mô-đun apex đầu vào không kích hoạt được.

ném
DeviceNotAvailableException
TargetSetupError

getSplitsForApks

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 thể tìm thấy bundletool hoặc tệp thông số kỹ thuật của thiết bị không tạo được.

initBundletoolUtil

protected void initBundletoolUtil (TestInformation testInfo)

Khởi tạo tiện ích bundletool cho lớp này.

Thông số
testInfo TestInformation : TestInformation cho lệnh gọi.

ném
TargetSetupError nếu không tìm thấy bundletool.

cài đặtTrain

protected void installTrain (TestInformation testInfo, 
                 moduleFilenames)

Cố gắng cài đặt tuyến đường chính có chứa apex 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 tuyến chính sẽ được cài đặt.

ném
DeviceNotAvailableException
TargetSetupError

cài đặtUsingBundleTool

protected void installUsingBundleTool (TestInformation testInfo, 
                 testAppFileNames)

Cố gắng cài đặt (các) mô-đun chính bằ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.

ném
DeviceNotAvailableException
TargetSetupError

trình cài đặt

protected void installer (TestInformation testInfo, 
                 testAppFileNames)

Cố gắng cài đặt mộ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 apks và gói của chúng sẽ được cài đặt.

ném
DeviceNotAvailableException
TargetSetupError

truy xuấtApexInfo

protected ITestDevice.ApexInfo retrieveApexInfo (File testApexFile, 
                DeviceDescriptor deviceDescriptor)

Truy xuất ApexInfo có chứa packageName và versionCode từ tệp apex đã cho.

Thông số
testApexFile File : Tệp apex mà chúng tôi truy xuất thông tin từ đó.

deviceDescriptor DeviceDescriptor

trả lại
ITestDevice.ApexInfo một ApexInfo chứa tên gói và Mã phiên bản của tệp đã cho

ném
TargetSetupError nếu trình phân tích cú pháp aapt không phân tích được tệp.