ติดตั้ง ApexModuleTargetPreparer

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


สรุป

เขตข้อมูล

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

ผู้สร้างสาธารณะ

InstallApexModuleTargetPreparer ()

วิธีการสาธารณะ

getModulesToInstall ( TestInformation testInfo)

รับโมดูลที่ควรติดตั้งบนรถไฟ ตามโมดูลที่โหลดไว้ล่วงหน้าบนอุปกรณ์

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

void tearDown ( TestInformation testInfo, Throwable e)

วิธีการป้องกัน

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)

รับโมดูลที่ควรติดตั้งบนรถไฟ ตามโมดูลที่โหลดไว้ล่วงหน้าบนอุปกรณ์ โมดูลที่ไม่ได้โหลดไว้ล่วงหน้าจะไม่ถูกติดตั้ง

พารามิเตอร์
testInfo TestInformation : TestInformation

ส่งคืน
รายการ ของโมดูลที่ควรติดตั้งในเครื่อง

พ่น
DeviceNotAvailableException เมื่ออุปกรณ์ไม่พร้อมใช้งาน
TargetSetupError เมื่อไม่ได้ติดตั้งโมดูลบังคับ หรือไม่สามารถติดตั้งโมดูลได้

setIgnoreIfNotPreloaded

public void setIgnoreIfNotPreloaded (boolean skip)

พารามิเตอร์
skip boolean

setSkipApexTearDown

public void setSkipApexTearDown (boolean skip)

พารามิเตอร์
skip boolean

ติดตั้ง

public void setUp (TestInformation testInfo)

พารามิเตอร์
testInfo TestInformation

พ่น
BuildError
DeviceNotAvailableException
TargetSetupError

การถอดออก

public void tearDown (TestInformation testInfo, 
                Throwable e)

พารามิเตอร์
testInfo TestInformation

e Throwable

พ่น
DeviceNotAvailableException

วิธีการป้องกัน

addApksToTestFiles

protected void addApksToTestFiles ()

เพิ่มStagedReadyTimeoutForAdb

protected void addStagedReadyTimeoutForAdb ( cmd)

พารามิเตอร์
cmd

addTimeoutMillisForBundleเครื่องมือ

protected void addTimeoutMillisForBundletool ( extraArgs)

พารามิเตอร์
extraArgs

ตรวจสอบ ApexActivation

protected void checkApexActivation (ITestDevice device)

ตรวจสอบว่าเปิดใช้งานเอเพ็กซ์ทั้งหมดหรือไม่

พารามิเตอร์
device ITestDevice : อยู่ระหว่างการทดสอบ

พ่น
TargetSetupError หากการเปิดใช้งานล้มเหลว
DeviceNotAvailableException

รวบรวม ApexInfoFromApexModules

protected  collectApexInfoFromApexModules ( testAppFileNames, 
                TestInformation testInfo)

รวบรวมข้อมูลเอเพ็กซ์จากโมดูลเอเพ็กซ์สำหรับการตรวจสอบการเปิดใช้งาน

พารามิเตอร์
testAppFileNames : รายการชื่อไฟล์ของโมดูลที่จะติดตั้ง

testInfo TestInformation : TestInformation

ส่งคืน
รายการที่มี apexinfo ของโมดูล apex ในรายการไฟล์อินพุต

พ่น
TargetSetupError

ติดตั้ง getApk

protected  getApkInstalled ()

ส่งคืน

getBundletoolชื่อไฟล์

protected String getBundletoolFileName ()

ส่งคืน
String

getBundletoolUtil

protected BundletoolUtil getBundletoolUtil ()

ส่งคืน
BundletoolUtil

getModuleKeywordFromApexPackageName

protected String getModuleKeywordFromApexPackageName (String packageName)

รับคำหลัก (เช่น 'tzdata' สำหรับ com.android.tzdata.apex) จากชื่อแพ็คเกจ apex

พารามิเตอร์
packageName String : ชื่อแพ็คเกจของไฟล์ apex

ส่งคืน
String สตริง คีย์เวิร์ดของชื่อแพ็กเกจเอเพ็กซ์

getModulesFailToActivate

protected  getModulesFailToActivate ( activatedApexes)

รับโมดูลที่เปิดใช้งานไม่สำเร็จ

พารามิเตอร์
activatedApexes : ชุดของเอเพ็กซ์ที่ใช้งานบนอุปกรณ์

ส่งคืน
รายการที่มี apexinfo ของโมดูล apex อินพุตที่เปิดใช้งานไม่สำเร็จ

พ่น
DeviceNotAvailableException
TargetSetupError

รับ SplitsForApks

protected  getSplitsForApks (TestInformation testInfo, 
                File moduleFile)

แยกและส่งกลับการแยกสำหรับ apk ที่ระบุ

พารามิเตอร์
testInfo TestInformation : TestInformation

moduleFile File : ไฟล์โมดูลที่จะแตกแยกจาก

ส่งคืน
ไฟล์ [] ที่มีการแยก

พ่น
TargetSetupError หากไม่พบ Bundletool หรือสร้างไฟล์ข้อมูลจำเพาะของอุปกรณ์ไม่สำเร็จ

initBundletoolUtil

protected void initBundletoolUtil (TestInformation testInfo)

เริ่มต้นการใช้งาน Bundletool สำหรับคลาสนี้

พารามิเตอร์
testInfo TestInformation : TestInformation สำหรับการเรียกใช้

พ่น
TargetSetupError หากไม่พบ BundleTool

ติดตั้งรถไฟ

protected void installTrain (TestInformation testInfo, 
                 moduleFilenames)

พยายามติดตั้ง mainline train ที่มี apex บนอุปกรณ์

พารามิเตอร์
testInfo TestInformation : TestInformation

moduleFilenames : รายการสตริง รายการชื่อไฟล์ของโมดูล mainline ที่จะติดตั้ง

พ่น
DeviceNotAvailableException
TargetSetupError

ติดตั้งโดยใช้เครื่องมือ Bundle

protected void installUsingBundleTool (TestInformation testInfo, 
                 testAppFileNames)

พยายามติดตั้งโมดูล mainline โดยใช้ bundletool

พารามิเตอร์
testInfo TestInformation : TestInformation

testAppFileNames : ชื่อไฟล์ของโมดูลที่โหลดไว้ล่วงหน้าเพื่อติดตั้ง

พ่น
DeviceNotAvailableException
TargetSetupError

ช่างติดตั้ง

protected void installer (TestInformation testInfo, 
                 testAppFileNames)

พยายามติดตั้งแพ็คเกจหรือแยกแพ็คเกจบนอุปกรณ์

พารามิเตอร์
testInfo TestInformation : TestInformation สำหรับการเรียกใช้

testAppFileNames : apks และแพ็คเกจที่จะติดตั้ง

พ่น
DeviceNotAvailableException
TargetSetupError

ดึงข้อมูล ApexInfo

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

ดึง ApexInfo ซึ่งมี packageName และ versionCode จากไฟล์ apex ที่กำหนด

พารามิเตอร์
testApexFile File : ไฟล์เอเพ็กซ์ที่เราดึงข้อมูลมา

deviceDescriptor DeviceDescriptor

ส่งคืน
ITestDevice.ApexInfo ApexInfo ที่มี packageName และ versionCode ของไฟล์ที่กำหนด

พ่น
TargetSetupError หาก aapt parser ไม่สามารถแยกวิเคราะห์ไฟล์ได้