התקן את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)

מחלץ ומחזיר פיצולים עבור ה-apks שצוינו.

void initBundletoolUtil ( TestInformation testInfo)

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

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

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

void installUsingBundleTool ( TestInformation testInfo, testAppFileNames) installUsingBundleTool ( TestInformation testInfo, testAppFileNames)

ניסיונות להתקין מודולים ראשיים באמצעות 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

checkApexActivation

protected void checkApexActivation (ITestDevice device)

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

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

זורק
TargetSetupError אם ההפעלה נכשלה.
DeviceNotAvailableException

collectApexInfoFromApexModules

protected  collectApexInfoFromApexModules ( testAppFileNames, 
                TestInformation testInfo)

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

פרמטרים
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 a string מילת המפתח של שם החבילה apex.

getModulesFailToActivate

protected  getModulesFailToActivate ( activatedApexes)

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

פרמטרים
activatedApexes : ערכת הקודקודים הפעילים במכשיר

החזרות
רשימה המכילה את apexinfo של מודולי apex הקלט שלא הצליחו להיות מופעלים.

זורק
DeviceNotAvailableException
TargetSetupError

getSplitsForApks

protected  getSplitsForApks (TestInformation testInfo, 
                File moduleFile)

מחלץ ומחזיר פיצולים עבור ה-apks שצוינו.

פרמטרים
testInfo TestInformation : ה- TestInformation

moduleFile 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

התקןUsingBundleTool

protected void installUsingBundleTool (TestInformation testInfo, 
                 testAppFileNames)

ניסיונות להתקין מודולים ראשיים באמצעות 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 המכיל את שם החבילה ו-versionCode של הקובץ הנתון

זורק
TargetSetupError אם aapt parser לא הצליח לנתח את הקובץ.