ติดตั้ง 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.ติดตั้งApexModuleTargetPreparer


สรุป

เขตข้อมูล

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 util สำหรับคลาสนี้

void installTrain ( TestInformation testInfo, moduleFilenames) installTrain ( TestInformation testInfo, moduleFilenames)

พยายามติดตั้งรถไฟสายหลักที่มีเอเพ็กซ์บนอุปกรณ์

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 ()

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

getModulesToInstall

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 ()

addStagedReadyTimeoutForAdb

protected void addStagedReadyTimeoutForAdb ( cmd)

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

addTimeoutMillisForBundletool

protected void addTimeoutMillisForBundletool ( extraArgs)

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

ตรวจสอบการเปิดใช้งาน Apex

protected void checkApexActivation (ITestDevice device)

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

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

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

รวบรวม ApexInfoFromApexModules

protected  collectApexInfoFromApexModules ( testAppFileNames, 
                TestInformation testInfo)

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

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

testInfo TestInformation : TestInformation

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

ขว้าง
TargetSetupError

รับ APK ติดตั้งแล้ว

protected  getApkInstalled ()

การส่งคืน

getBundletoolFileName.getBundletoolFileName

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

getSplitsForApks

protected  getSplitsForApks (TestInformation testInfo, 
                File moduleFile)

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

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

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

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

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

initBundletoolUtil

protected void initBundletoolUtil (TestInformation testInfo)

เตรียมข้อมูลเบื้องต้น Bundletool util สำหรับคลาสนี้

พารามิเตอร์
testInfo TestInformation : TestInformation สำหรับการร้องขอ

ขว้าง
TargetSetupError หากไม่พบ Bundletool

ติดตั้งTrain

protected void installTrain (TestInformation testInfo, 
                 moduleFilenames)

พยายามติดตั้งรถไฟสายหลักที่มีเอเพ็กซ์บนอุปกรณ์

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

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

ขว้าง
DeviceNotAvailableException
TargetSetupError

ติดตั้งโดยใช้BundleTool

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 : ไฟล์ apex ที่เราดึงข้อมูลมา

deviceDescriptor DeviceDescriptor

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

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