ติดตั้ง ApexModuleTargetPreparer
public class InstallApexModuleTargetPreparer
extends SuiteApkInstaller
สรุป
วิธีการป้องกัน |
---|
void | addApksToTestFiles () |
void | addStagedReadyTimeoutForAdb ( cmd) addStagedReadyTimeoutForAdb ( cmd) |
void | addTimeoutMillisForBundletool ( extraArgs) addTimeoutMillisForBundletool ( extraArgs) |
void | checkApexActivation ( ITestDevice device) ตรวจสอบว่าเปิดใช้งานเอเพ็กซ์ทั้งหมดหรือไม่ |
| collectApexInfoFromApexModules ( testAppFileNames, TestInformation testInfo) collectApexInfoFromApexModules ( testAppFileNames, TestInformation testInfo) รวบรวมข้อมูลเอเพ็กซ์จากโมดูลเอเพ็กซ์สำหรับการตรวจสอบการเปิดใช้งาน |
| getApkInstalled () |
String | getBundletoolFileName () |
BundletoolUtil | getBundletoolUtil () |
String | getModuleKeywordFromApexPackageName (String packageName) รับคำหลัก (เช่น 'tzdata' สำหรับ com.android.tzdata.apex) จากชื่อแพ็คเกจ apex |
| getModulesFailToActivate ( activatedApexes) getModulesFailToActivate ( activatedApexes) รับโมดูลที่เปิดใช้งานไม่สำเร็จ |
| getSplitsForApks ( TestInformation testInfo, File moduleFile) แยกและส่งกลับการแยกสำหรับ apk ที่ระบุ |
void | initBundletoolUtil ( TestInformation testInfo) เริ่มต้นการใช้งาน Bundletool สำหรับคลาสนี้ |
void | installTrain ( TestInformation testInfo, moduleFilenames) installTrain ( TestInformation testInfo, moduleFilenames) พยายามติดตั้ง mainline train ที่มี apex บนอุปกรณ์ |
void | installUsingBundleTool ( TestInformation testInfo, testAppFileNames) installUsingBundleTool ( TestInformation testInfo, testAppFileNames) พยายามติดตั้งโมดูล mainline โดยใช้ bundletool |
void | installer ( TestInformation testInfo, testAppFileNames) installer ( TestInformation testInfo, testAppFileNames) พยายามติดตั้งแพ็คเกจหรือแยกแพ็คเกจบนอุปกรณ์ |
ITestDevice.ApexInfo | retrieveApexInfo (File testApexFile, DeviceDescriptor deviceDescriptor) ดึง ApexInfo ซึ่งมี packageName และ versionCode จากไฟล์ apex ที่กำหนด |
เขตข้อมูล
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
ผู้สร้างสาธารณะ
ติดตั้ง ApexModuleTargetPreparer
public InstallApexModuleTargetPreparer ()
วิธีการสาธารณะ
public getModulesToInstall (TestInformation testInfo)
รับโมดูลที่ควรติดตั้งบนรถไฟ ตามโมดูลที่โหลดไว้ล่วงหน้าบนอุปกรณ์ โมดูลที่ไม่ได้โหลดไว้ล่วงหน้าจะไม่ถูกติดตั้ง
ส่งคืน |
---|
| รายการ ของโมดูลที่ควรติดตั้งในเครื่อง |
setIgnoreIfNotPreloaded
public void setIgnoreIfNotPreloaded (boolean skip)
setSkipApexTearDown
public void setSkipApexTearDown (boolean skip)
public void setUp (TestInformation testInfo)
พารามิเตอร์ |
---|
testInfo | TestInformation |
public void tearDown (TestInformation testInfo,
Throwable e)
พารามิเตอร์ |
---|
testInfo | TestInformation |
e | Throwable |
วิธีการป้องกัน
addApksToTestFiles
protected void addApksToTestFiles ()
เพิ่มStagedReadyTimeoutForAdb
protected void addStagedReadyTimeoutForAdb ( cmd)
protected void addTimeoutMillisForBundletool ( extraArgs)
ตรวจสอบ ApexActivation
protected void checkApexActivation (ITestDevice device)
ตรวจสอบว่าเปิดใช้งานเอเพ็กซ์ทั้งหมดหรือไม่
พารามิเตอร์ |
---|
device | ITestDevice : อยู่ระหว่างการทดสอบ |
protected collectApexInfoFromApexModules ( testAppFileNames,
TestInformation testInfo)
รวบรวมข้อมูลเอเพ็กซ์จากโมดูลเอเพ็กซ์สำหรับการตรวจสอบการเปิดใช้งาน
พารามิเตอร์ |
---|
testAppFileNames | : รายการชื่อไฟล์ของโมดูลที่จะติดตั้ง |
testInfo | TestInformation : TestInformation |
ส่งคืน |
---|
| รายการที่มี apexinfo ของโมดูล apex ในรายการไฟล์อินพุต |
ติดตั้ง getApk
protected getApkInstalled ()
protected String getBundletoolFileName ()
getModuleKeywordFromApexPackageName
protected String getModuleKeywordFromApexPackageName (String packageName)
รับคำหลัก (เช่น 'tzdata' สำหรับ com.android.tzdata.apex) จากชื่อแพ็คเกจ apex
พารามิเตอร์ |
---|
packageName | String : ชื่อแพ็คเกจของไฟล์ apex |
ส่งคืน |
---|
String | สตริง คีย์เวิร์ดของชื่อแพ็กเกจเอเพ็กซ์ |
getModulesFailToActivate
protected getModulesFailToActivate ( activatedApexes)
รับโมดูลที่เปิดใช้งานไม่สำเร็จ
พารามิเตอร์ |
---|
activatedApexes | : ชุดของเอเพ็กซ์ที่ใช้งานบนอุปกรณ์ |
ส่งคืน |
---|
| รายการที่มี apexinfo ของโมดูล apex อินพุตที่เปิดใช้งานไม่สำเร็จ |
protected getSplitsForApks (TestInformation testInfo,
File moduleFile)
แยกและส่งกลับการแยกสำหรับ apk ที่ระบุ
พารามิเตอร์ |
---|
testInfo | TestInformation : TestInformation |
moduleFile | File : ไฟล์โมดูลที่จะแตกแยกจาก |
ส่งคืน |
---|
| ไฟล์ [] ที่มีการแยก |
พ่น |
---|
TargetSetupError | หากไม่พบ Bundletool หรือสร้างไฟล์ข้อมูลจำเพาะของอุปกรณ์ไม่สำเร็จ |
protected void initBundletoolUtil (TestInformation testInfo)
เริ่มต้นการใช้งาน Bundletool สำหรับคลาสนี้
protected void installTrain (TestInformation testInfo,
moduleFilenames)
พยายามติดตั้ง mainline train ที่มี apex บนอุปกรณ์
พารามิเตอร์ |
---|
testInfo | TestInformation : TestInformation |
moduleFilenames | : รายการสตริง รายการชื่อไฟล์ของโมดูล mainline ที่จะติดตั้ง |
protected void installUsingBundleTool (TestInformation testInfo,
testAppFileNames)
พยายามติดตั้งโมดูล mainline โดยใช้ bundletool
พารามิเตอร์ |
---|
testInfo | TestInformation : TestInformation |
testAppFileNames | : ชื่อไฟล์ของโมดูลที่โหลดไว้ล่วงหน้าเพื่อติดตั้ง |
protected void installer (TestInformation testInfo,
testAppFileNames)
พยายามติดตั้งแพ็คเกจหรือแยกแพ็คเกจบนอุปกรณ์
พารามิเตอร์ |
---|
testInfo | TestInformation : TestInformation สำหรับการเรียกใช้ |
testAppFileNames | : apks และแพ็คเกจที่จะติดตั้ง |
ดึงข้อมูล ApexInfo
protected ITestDevice.ApexInfo retrieveApexInfo (File testApexFile,
DeviceDescriptor deviceDescriptor)
ดึง ApexInfo ซึ่งมี packageName และ versionCode จากไฟล์ apex ที่กำหนด
พารามิเตอร์ |
---|
testApexFile | File : ไฟล์เอเพ็กซ์ที่เราดึงข้อมูลมา |
deviceDescriptor | DeviceDescriptor |