התקן אתApexModuleTargetPreparer
public class InstallApexModuleTargetPreparer
extends SuiteApkInstaller
סיכום
שיטות מוגנות |
---|
void | addApksToTestFiles () |
| collectApexInfoFromApexModules ( testAppFileNames, TestInformation testInfo) collectApexInfoFromApexModules ( testAppFileNames, TestInformation testInfo) אוסף מידע קודקוד ממודולי הקודקוד לבדיקת הפעלה. |
boolean | containsPersistentApk ( testAppFileNames, TestInformation testInfo) containsPersistentApk ( testAppFileNames, TestInformation testInfo) בודק אם קבצי הקלט מכילים apk קבוע כלשהו. |
| 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, String[] extraArgs) installTrain (TestInformation testInfo, moduleFilenames, String[] extraArgs) ניסיונות להתקין רכבת מרכזית המכילה apex על המכשיר. |
void | installUsingBundleTool (TestInformation testInfo, testAppFileNames) installUsingBundleTool (TestInformation testInfo, testAppFileNames) ניסיונות להתקין מודולים ראשיים באמצעות bundletool. |
void | installer (TestInformation testInfo, testAppFileNames) installer (TestInformation testInfo, testAppFileNames) נסה להתקין חבילה או חבילה מפוצלת במכשיר. |
boolean | isPersistentApk (File filename, TestInformation testInfo) בודק אם apk הוא apk מתמיד. |
ITestDevice.ApexInfo | retrieveApexInfo (File testApexFile, DeviceDescriptor deviceDescriptor) מאחזר את ApexInfo שמכיל packageName ו-versionCode מקובץ ה-apex הנתון. |
שדות
APEX_SUFFIX
protected static final String APEX_SUFFIX
APK_SUFFIX
protected static final String APK_SUFFIX
SPLIT_APKS_SUFFIX
protected static final String SPLIT_APKS_SUFFIX
בנאים ציבוריים
התקן אתApexModuleTargetPreparer
public InstallApexModuleTargetPreparer ()
שיטות ציבוריות
public getModulesToInstall (TestInformation testInfo)
מקבל את המודולים שצריך להתקין ברכבת, על סמך המודולים שנטענו מראש במכשיר. מודולים שאינם נטענים מראש לא יותקנו.
החזרות |
---|
| רשימה של המודולים שיש להתקין במכשיר. |
זורק |
---|
DeviceNotAvailableException | כאשר המכשיר אינו זמין. |
TargetSetupError | כאשר מודולים חובה אינם מותקנים, או כאשר לא ניתן להתקין מודול. |
setIgnoreIfNotPreloaded
public void setIgnoreIfNotPreloaded (boolean skip)
setSkipApexTearDown
public void setSkipApexTearDown (boolean skip)
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 ()
protected collectApexInfoFromApexModules ( testAppFileNames,
TestInformation testInfo)
אוסף מידע קודקוד ממודולי הקודקוד לבדיקת הפעלה.
פרמטרים |
---|
testAppFileNames | : רשימת שמות הקבצים של המודולים להתקנה |
testInfo | TestInformation : ה- TestInformation |
החזרות |
---|
| רשימה המכילה את apexinfo של מודולי apex ברשימות קבצי הקלט |
protected boolean containsPersistentApk ( testAppFileNames,
TestInformation testInfo)
בודק אם קבצי הקלט מכילים apk קבוע כלשהו.
פרמטרים |
---|
testAppFileNames | : רשימת שמות הקבצים של המודולים להתקנה |
testInfo | TestInformation : ה- TestInformation |
החזרות |
---|
boolean | true אם קבצי הקלט מכילים מודול apk מתמיד. |
זורק |
---|
DeviceNotAvailableException | |
TargetSetupError | |
getApkInstalled
protected getApkInstalled ()
protected String getBundletoolFileName ()
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 | |
protected getSplitsForApks (TestInformation testInfo,
File moduleFile)
מחלץ ומחזיר פיצולים עבור ה-apks שצוינו.
פרמטרים |
---|
testInfo | TestInformation : ה- TestInformation |
moduleFile | File : קובץ המודול שממנו יש לחלץ את הפיצולים. |
החזרות |
---|
| קובץ[] המכיל את הפיצולים. |
זורק |
---|
TargetSetupError | אם לא ניתן למצוא את bundletool או שקובץ מפרט ההתקן לא מצליח ליצור. |
protected void initBundletoolUtil (TestInformation testInfo)
מאתחל את השירות bundletool עבור מחלקה זו.
זורק |
---|
TargetSetupError | אם לא ניתן למצוא את bundletool. |
protected void installTrain (TestInformation testInfo,
moduleFilenames,
String[] extraArgs)
ניסיונות להתקין רכבת מרכזית המכילה apex על המכשיר.
פרמטרים |
---|
testInfo | TestInformation : ה- TestInformation |
moduleFilenames | : רשימה של מחרוזות. רשימת שמות הקבצים של המודולים הראשיים שיש להתקין. |
extraArgs | String |
זורק |
---|
DeviceNotAvailableException | |
TargetSetupError | |
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 | |
protected boolean isPersistentApk (File filename,
TestInformation testInfo)
בודק אם apk הוא apk מתמיד.
פרמטרים |
---|
filename | File : קובץ מודול ה-apk שיש לבדוק |
testInfo | TestInformation : ה- TestInformation |
החזרות |
---|
boolean | true אם זה מודול apk מתמיד. |
זורק |
---|
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 לא הצליח לנתח את הקובץ. |