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


สรุป

ช่อง

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

public static final String ROLLBACK_STATE_COMMITTED

public static final String ROLLBACK_STATE_UNKNOWN

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)
void addTimeoutMillisForBundletool( extraArgs)
void checkApexActivation(ITestDevice device)

ตรวจสอบว่าเปิดใช้งาน Apex ทั้งหมดแล้ว

collectApexInfoFromApexModules( testAppFileNames, TestInformation testInfo)

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

getApkInstalled()
String getBundletoolFileName()
BundletoolUtil getBundletoolUtil()
String getModuleKeywordFromApexPackageName(String packageName)

รับคีย์เวิร์ด (เช่น 'tzdata' สำหรับ com.android.tzdata.apex) จากชื่อแพ็กเกจ Apex

getModulesFailToActivate( activatedApexes)

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

getSplitsForApks(TestInformation testInfo, File moduleFile)

ดึงข้อมูลและแสดงผลแยกสำหรับ APK ที่ระบุ

void initBundletoolUtil(TestInformation testInfo)

เริ่มต้นเครื่องมือ Bundletool สำหรับคลาสนี้

void installTrain(TestInformation testInfo, moduleFilenames)

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

void installUsingBundleTool(TestInformation testInfo, testAppFileNames)

พยายามติดตั้งโมดูลหลักโดยใช้ Bundletool

void 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

ROLLBACK_STATE_COMMITTED

public static final String ROLLBACK_STATE_COMMITTED

ROLLBACK_STATE_UNKNOWN

public static final String ROLLBACK_STATE_UNKNOWN

SPLIT_APKS_SUFFIX

protected static final String SPLIT_APKS_SUFFIX

mTrainFolderPath

protected File mTrainFolderPath

ตัวสร้างแบบสาธารณะ

InstallApexModuleTargetPreparer

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

setUp

public void setUp (TestInformation testInfo)

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

การโยน
BuildError
DeviceNotAvailableException
TargetSetupError

tearDown

public void tearDown (TestInformation testInfo, 
                Throwable e)

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

e Throwable

การโยน
DeviceNotAvailableException
DeviceRuntimeException

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

addApksToTestFiles

protected void addApksToTestFiles ()

addStagedReadyTimeoutForAdb

protected void addStagedReadyTimeoutForAdb ( cmd)

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

addTimeoutMillisForBundletool

protected void addTimeoutMillisForBundletool ( extraArgs)

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

checkApexActivation

protected void checkApexActivation (ITestDevice device)

ตรวจสอบว่าเปิดใช้งาน Apex ทั้งหมดแล้ว

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

การโยน
TargetSetupError หากเปิดใช้งานไม่สำเร็จ
DeviceNotAvailableException

collectApexInfoFromApexModules

protected  collectApexInfoFromApexModules ( testAppFileNames, 
                TestInformation testInfo)

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

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

testInfo TestInformation: TestInformation

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

การโยน
TargetSetupError

getApkInstalled

protected  getApkInstalled ()

คิกรีเทิร์น

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 สตริง คีย์เวิร์ดของชื่อแพ็กเกจ Apex

getModulesFailToActivate

protected  getModulesFailToActivate ( activatedApexes)

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

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

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

การโยน
DeviceNotAvailableException
TargetSetupError

getSplitsForApks

protected  getSplitsForApks (TestInformation testInfo, 
                File moduleFile)

ดึงข้อมูลและแสดงผลแยกสำหรับ APK ที่ระบุ

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

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

คิกรีเทิร์น
File[] ที่มีส่วนที่แยก

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

initBundletoolUtil

protected void initBundletoolUtil (TestInformation testInfo)

เริ่มต้นเครื่องมือ Bundletool สำหรับคลาสนี้

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

การโยน
TargetSetupError หากไม่พบ Bundletool

installTrain

protected void installTrain (TestInformation testInfo, 
                 moduleFilenames)

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

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

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

การโยน
DeviceNotAvailableException
TargetSetupError

installUsingBundleTool

protected void installUsingBundleTool (TestInformation testInfo, 
                 testAppFileNames)

พยายามติดตั้งโมดูลหลักโดยใช้ Bundletool

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

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

การโยน
DeviceNotAvailableException
TargetSetupError

โปรแกรมติดตั้ง

protected void installer (TestInformation testInfo, 
                 testAppFileNames)

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

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

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

การโยน
DeviceNotAvailableException
TargetSetupError

retrieveApexInfo

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

ดึงข้อมูล ApexInfo ซึ่งมี packageName และ versionCode จากไฟล์ Apex ที่ระบุ

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

deviceDescriptor DeviceDescriptor

คิกรีเทิร์น
ITestDevice.ApexInfo ApexInfo ที่มี packageName และ versionCode ของไฟล์ที่ระบุ

การโยน
TargetSetupError หากโปรแกรมแยกวิเคราะห์ aapt แยกวิเคราะห์ไฟล์ไม่สำเร็จ