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(
|
void
|
addTimeoutMillisForBundletool(
|
void
|
checkApexActivation(ITestDevice device)
בודקים אם כל הקודקודים העליונים מופעלים. |
|
collectApexInfoFromApexModules(
אוסף מידע של Apex מהמודולים של Apex לצורך בדיקת ההפעלה. |
|
getApkInstalled()
|
String
|
getBundletoolFileName()
|
BundletoolUtil
|
getBundletoolUtil()
|
String
|
getModuleKeywordFromApexPackageName(String packageName)
הפונקציה מקבלת את מילת המפתח (למשל, 'tzdata' עבור com.android.tzdata.apex) משם החבילה של apex. |
|
getModulesFailToActivate(
הצגת מודולים שלא הופעלו. |
|
getSplitsForApks(TestInformation testInfo, File moduleFile)
הפונקציה מחלצת ומחזירה חלוקות של קובצי ה-apk שצוינו. |
void
|
initBundletoolUtil(TestInformation testInfo)
הפונקציה מאתחלת את ה-bundletool util לכיתה הזו. |
void
|
installTrain(TestInformation testInfo,
ניסיון להתקין במכשיר רכבת ראשית שמכילה את apex. |
void
|
installUsingBundleTool(TestInformation testInfo,
ניסיון להתקין מודולים של mainline באמצעות bundletool. |
void
|
installer(TestInformation testInfo,
מנסים להתקין במכשיר חבילת התקנה או חבילת התקנה מפוצלת. |
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
publicgetModulesToInstall (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)
בודקים אם כל הקודקודים העליונים מופעלים.
פרמטרים | |
---|---|
device |
ITestDevice : בבדיקה. |
זריקות | |
---|---|
TargetSetupError |
אם ההפעלה נכשלה. |
DeviceNotAvailableException |
collectApexInfoFromApexModules
protectedcollectApexInfoFromApexModules ( testAppFileNames, TestInformation testInfo)
איסוף מידע של Apex מהמודולים של Apex לצורך בדיקת הפעלה.
פרמטרים | |
---|---|
testAppFileNames |
: רשימת שמות הקבצים של המודולים להתקנה |
testInfo |
TestInformation : TestInformation |
החזרות | |
---|---|
|
רשימה שמכילה את apexinfo של המודולים של Apex ברשימות של קובצי הקלט |
זריקות | |
---|---|
TargetSetupError |
getApkInstalled
protectedgetApkInstalled ()
החזרות | |
---|---|
|
getBundletoolFileName
protected String getBundletoolFileName ()
החזרות | |
---|---|
String |
getModuleKeywordFromApexPackageName
protected String getModuleKeywordFromApexPackageName (String packageName)
הפונקציה מקבלת את מילת המפתח (למשל, 'tzdata' עבור com.android.tzdata.apex) משם החבילה של apex.
פרמטרים | |
---|---|
packageName |
String : שם החבילה של קובץ ה-apex. |
החזרות | |
---|---|
String |
מחרוזת. מילת המפתח של שם החבילה ברמה העליונה. |
getModulesFailToActivate
protectedgetModulesFailToActivate ( activatedApexes)
הצגת מודולים שלא הופעלו.
פרמטרים | |
---|---|
activatedApexes |
: קבוצת הקודקודים הפעילים במכשיר |
החזרות | |
---|---|
|
רשימה שמכילה את apexinfo של מודולי apex הקלט שלא הופעלו. |
זריקות | |
---|---|
DeviceNotAvailableException |
|
TargetSetupError |
getSplitsForApks
protectedgetSplitsForApks (TestInformation testInfo, File moduleFile)
הפונקציה מחלצת ומחזירה חלוקות של קובצי ה-apk שצוינו.
פרמטרים | |
---|---|
testInfo |
TestInformation : TestInformation |
moduleFile |
File : קובץ המודול שממנו רוצים לחלץ את החלוקות. |
החזרות | |
---|---|
|
מערך של קובצי File[] שמכיל את החלוקות. |
זריקות | |
---|---|
TargetSetupError |
אם לא ניתן למצוא את bundletool או אם יצירת קובץ מפרט המכשיר נכשלה. |
initBundletoolUtil
protected void initBundletoolUtil (TestInformation testInfo)
הפונקציה מאתחלת את ה-bundletool util לכיתה הזו.
פרמטרים | |
---|---|
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)
ניסיון להתקין מודולים של mainline באמצעות 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 נכשל לנתח את הקובץ. |