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


סיכום

ערכים קבועים

String APEX_OPTION

String APEX_SUFFIX

String APK_SUFFIX

String APK_ZIP_OPTION

String CHILD_SESSION_CREATION_CMD

String PARENT_SESSION_CREATION_CMD

String ROLLBACK_STATE_COMMITTED

String ROLLBACK_STATE_UNKNOWN

String SPLIT_APKS_SUFFIX

שדות

protected File mTrainFolderPath

‫constructors ציבוריים

InstallApexModuleTargetPreparer()

‫methods ציבוריים

List<File> getModulesToInstall(TestInformation testInfo)

מקבל את המודולים שצריכים להיות מותקנים ב-train, על סמך המודולים שנטענו מראש במכשיר.

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

void tearDown(TestInformation testInfo, Throwable e)

שיטות מוגנות

void addApksToTestFiles()
void addStagedReadyTimeoutForAdb(List<String> cmd)
void addTimeoutMillisForBundletool(List<String> extraArgs)
void checkApexActivation(ITestDevice device)

בודקים אם כל הקודקודים מופעלים.

List<ITestDevice.ApexInfo> collectApexInfoFromApexModules(Map<File, String> testAppFileNames, TestInformation testInfo)

איסוף מידע על apex ממודולי apex לבדיקת הפעלה.

List<String> getApkInstalled()
String getBundletoolFileName()
BundletoolUtil getBundletoolUtil()
String getModuleKeywordFromApexPackageName(String packageName)

מקבל את מילת המפתח (לדוגמה, tzdata עבור com.android.tzdata.apex) משם חבילת ה-APEX.

List<ITestDevice.ApexInfo> getModulesFailToActivate(Set<ITestDevice.ApexInfo> activatedApexes)

קבלת מודולים שלא הופעלו.

List<File> getSplitsForApks(TestInformation testInfo, File moduleFile)

הפונקציה מחלצת ומחזירה פיצולים של קובצי ה-APK שצוינו.

void initBundletoolUtil(TestInformation testInfo)

מאתחלת את כלי bundletool עבור המחלקה הזו.

void installTrain(TestInformation testInfo, List<File> moduleFilenames)

ניסיונות להתקין במכשיר רכבת מרכזית שמכילה קובץ apex.

void installUsingBundleTool(TestInformation testInfo, List<File> testAppFileNames)

ניסיונות להתקין מודולים של mainline באמצעות bundletool.

void installer(TestInformation testInfo, Map<File, String> testAppFileNames)

לנסות להתקין חבילה או חבילה מפוצלת במכשיר.

ITestDevice.ApexInfo retrieveApexInfo(File testApexFile, DeviceDescriptor deviceDescriptor)

מאחזר את ApexInfo שמכיל את packageName ואת versionCode מקובץ ה-Apex הנתון.

ערכים קבועים

APEX_OPTION

protected static final String APEX_OPTION

ערך קבוע: "--apex"

APEX_SUFFIX

protected static final String APEX_SUFFIX

ערך קבוע: ".apex"

APK_SUFFIX

protected static final String APK_SUFFIX

ערך קבוע: ".apk"

APK_ZIP_OPTION

protected static final String APK_ZIP_OPTION

ערך קבוע: "‎--apks-zip"

CHILD_SESSION_CREATION_CMD

protected static final String CHILD_SESSION_CREATION_CMD

ערך קבוע: "pm install-create"

PARENT_SESSION_CREATION_CMD

protected static final String PARENT_SESSION_CREATION_CMD

ערך קבוע: "pm install-create --multi-package"

ROLLBACK_STATE_COMMITTED

public static final String ROLLBACK_STATE_COMMITTED

ערך קבוע: "committed"

ROLLBACK_STATE_UNKNOWN

public static final String ROLLBACK_STATE_UNKNOWN

ערך קבוע: "unknown"

SPLIT_APKS_SUFFIX

protected static final String SPLIT_APKS_SUFFIX

ערך קבוע: ".apks"

שדות

mTrainFolderPath

protected File mTrainFolderPath

‫constructors ציבוריים

InstallApexModuleTargetPreparer

public InstallApexModuleTargetPreparer ()

‫methods ציבוריים

getModulesToInstall

public List<File> getModulesToInstall (TestInformation testInfo)

מקבל את המודולים שצריך להתקין ברכבת, על סמך המודולים שנטענו מראש במכשיר. מודולים שלא נטענו מראש לא יותקנו.

פרמטרים
testInfo TestInformation: TestInformation

החזרות
List<File> רשימה של המודולים שצריך להתקין במכשיר.

הקפצת הודעות שגיאה (throw)
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

הקפצת הודעות שגיאה (throw)
BuildError
DeviceNotAvailableException
TargetSetupError

tearDown

public void tearDown (TestInformation testInfo, 
                Throwable e)

פרמטרים
testInfo TestInformation

e Throwable

הקפצת הודעות שגיאה (throw)
DeviceNotAvailableException
DeviceRuntimeException

שיטות מוגנות

addApksToTestFiles

protected void addApksToTestFiles ()

addStagedReadyTimeoutForAdb

protected void addStagedReadyTimeoutForAdb (List<String> cmd)

פרמטרים
cmd List

addTimeoutMillisForBundletool

protected void addTimeoutMillisForBundletool (List<String> extraArgs)

פרמטרים
extraArgs List

checkApexActivation

protected void checkApexActivation (ITestDevice device)

בודקים אם כל הקודקודים מופעלים.

פרמטרים
device ITestDevice: בבדיקה.

הקפצת הודעות שגיאה (throw)
TargetSetupError אם ההפעלה נכשלה.
DeviceNotAvailableException

collectApexInfoFromApexModules

protected List<ITestDevice.ApexInfo> collectApexInfoFromApexModules (Map<File, String> testAppFileNames, 
                TestInformation testInfo)

איסוף מידע על apex ממודולי apex לבדיקת הפעלה.

פרמטרים
testAppFileNames Map: רשימת שמות הקבצים של המודולים להתקנה

testInfo TestInformation: The TestInformation

החזרות
List<ITestDevice.ApexInfo> רשימה שמכילה את apexinfo של מודולי ה-Apex ברשימות קובצי הקלט

הקפצת הודעות שגיאה (throw)
TargetSetupError

getApkInstalled

protected List<String> getApkInstalled ()

החזרות
List<String>

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 List<ITestDevice.ApexInfo> getModulesFailToActivate (Set<ITestDevice.ApexInfo> activatedApexes)

קבלת מודולים שלא הופעלו.

פרמטרים
activatedApexes Set: קבוצת ה-APEX הפעילים במכשיר

החזרות
List<ITestDevice.ApexInfo> רשימה שמכילה את פרטי ה-Apex של מודולי ה-Apex של הקלט שההפעלה שלהם נכשלה.

הקפצת הודעות שגיאה (throw)
DeviceNotAvailableException
TargetSetupError

getSplitsForApks

protected List<File> getSplitsForApks (TestInformation testInfo, 
                File moduleFile)

הפונקציה מחלצת ומחזירה פיצולים של קובצי ה-APK שצוינו.

פרמטרים
testInfo TestInformation: TestInformation

moduleFile File: קובץ המודול שממנו יחולצו הפיצולים.

החזרות
List<File> ‫File[] ‎ שמכיל את הפיצולים.

הקפצת הודעות שגיאה (throw)
TargetSetupError אם לא ניתן למצוא את bundletool או אם יצירת קובץ מפרט המכשיר נכשלת.

initBundletoolUtil

protected void initBundletoolUtil (TestInformation testInfo)

מאתחלת את כלי השירות bundletool עבור המחלקה הזו.

פרמטרים
testInfo TestInformation: ה-TestInformation של הקריאה.

הקפצת הודעות שגיאה (throw)
TargetSetupError אם לא ניתן למצוא את bundletool.

installTrain

protected void installTrain (TestInformation testInfo, 
                List<File> moduleFilenames)

ניסיונות להתקין במכשיר רכבת mainline שמכילה apex.

פרמטרים
testInfo TestInformation: TestInformation

moduleFilenames List: רשימה של מחרוזות. רשימת שמות הקבצים של המודולים הראשיים שרוצים להתקין.

הקפצת הודעות שגיאה (throw)
DeviceNotAvailableException
TargetSetupError

installUsingBundleTool

protected void installUsingBundleTool (TestInformation testInfo, 
                List<File> testAppFileNames)

ניסיונות להתקין מודולים של mainline באמצעות bundletool.

פרמטרים
testInfo TestInformation: TestInformation

testAppFileNames List: שמות הקבצים של המודולים שנטענו מראש להתקנה.

הקפצת הודעות שגיאה (throw)
DeviceNotAvailableException
TargetSetupError

מתקין

protected void installer (TestInformation testInfo, 
                Map<File, String> testAppFileNames)

לנסות להתקין חבילה או חבילה מפוצלת במכשיר.

פרמטרים
testInfo TestInformation: ה-TestInformation של הקריאה

testAppFileNames Map: קובצי ה-APK והחבילה שלהם שרוצים להתקין.

הקפצת הודעות שגיאה (throw)
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 של הקובץ הנתון

הקפצת הודעות שגיאה (throw)
TargetSetupError אם מנתח ה-aapt נכשל בניתוח הקובץ.