TradefedSandbox
public
class
TradefedSandbox
extends Object
implements
ISandbox
| java.lang.Object | |
| ↳ | com.android.tradefed.sandbox.TradefedSandbox |
קונטיינר ארגז חול שיכול להריץ קריאה לפונקציה של Trade Federation. TODO: Allow Options to be passed to the sandbox.
סיכום
ערכים קבועים | |
|---|---|
String |
EXTRA_TARGET_LAB
|
String |
GENERAL_TESTS_ZIP
|
String |
SANDBOX_ENABLED
|
Constructors ציבוריים | |
|---|---|
TradefedSandbox()
|
|
methods ציבוריים | |
|---|---|
String
|
createClasspath(File workingDir)
יוצרים נתיב מחלקות על סמך הסביבה וספריית העבודה שמוחזרים על ידי |
IConfiguration
|
createThinLauncherConfig(String[] args, IKeyStoreClient keyStoreClient, IRunUtil runUtil, File globalConfig)
מצב מיוחד שבו אין חיבור לריצה הראשית: אם נראה שההגדרה לא קיימת בתיקיית האב, המערכת חוזרת ל-thin launcher, מנסה להגדיר את ארגז החול עם המידע שזמין כרגע וממלאת את ספריית העבודה כדי ליצור את ההגדרה באופן מלא בספרייה עם הגרסה. |
File
|
getTradefedSandboxEnvironment(IInvocationContext context, IConfiguration nonVersionedConfig, ITestLogger logger, String[] args)
|
static
|
matchSandboxExtraBuildTargetByConfigName(String configName)
בהינתן שם הגדרת הבדיקה, צריך להתאים את יעדי הבנייה הנוספים מתוך יעדי הבנייה הנוספים של Sandbox. |
Exception
|
prepareEnvironment(IInvocationContext context, IConfiguration config, ITestInvocationListener listener)
מכינים את הסביבה כדי שארגז החול יפעל בצורה תקינה. |
CommandResult
|
run(TestInformation info, IConfiguration config, ITestLogger logger)
מריצים את ארגז החול עם הסביבה שהוגדרה. |
void
|
tearDown()
מנקים את כל המצבים, הקבצים או הסביבה שאולי השתנו. |
שיטות מוגנות | |
|---|---|
File
|
dumpGlobalConfig(IConfiguration config,
הצגת התצורה הגלובלית אחרי סינון של חלק מהאובייקטים. |
String
|
getJava()
|
Exception
|
prepareConfiguration(IInvocationContext context, IConfiguration config, ITestInvocationListener listener)
מכינים את |
File
|
prepareContext(IInvocationContext context, IConfiguration config)
מכינים את |
ערכים קבועים
EXTRA_TARGET_LAB
public static final String EXTRA_TARGET_LAB
ערך קבוע: "lab"
GENERAL_TESTS_ZIP
public static final String GENERAL_TESTS_ZIP
ערך קבוע: "general-tests.zip"
SANDBOX_ENABLED
public static final String SANDBOX_ENABLED
ערך קבוע: "SANDBOX_ENABLED"
Constructors ציבוריים
TradefedSandbox
public TradefedSandbox ()
methods ציבוריים
createClasspath
public String createClasspath (File workingDir)
יוצרים נתיב מחלקות על סמך הסביבה וספריית העבודה שמוחזרים על ידי ISandbox.getTradefedSandboxEnvironment(com.android.tradefed.invoker.IInvocationContext, com.android.tradefed.config.IConfiguration, String[]).
| פרמטרים | |
|---|---|
workingDir |
File: ספריית העבודה הנוכחית של ארגז החול. |
| החזרות | |
|---|---|
String |
נתיב המחלקה לשימוש. |
| זריקות | |
|---|---|
ConfigurationException |
|
createThinLauncherConfig
public IConfiguration createThinLauncherConfig (String[] args, IKeyStoreClient keyStoreClient, IRunUtil runUtil, File globalConfig)
מצב מיוחד שבו אין חיבור לריצה הראשית: אם נראה שההגדרה לא קיימת בתיקיית האב, המערכת חוזרת ל-thin launcher, מנסה להגדיר את ארגז החול עם המידע שזמין כרגע וממלאת את ספריית העבודה כדי ליצור את ההגדרה באופן מלא בספרייה עם הגרסה.
| פרמטרים | |
|---|---|
args |
String: הארגומנטים המקוריים בשורת הפקודה. |
keyStoreClient |
IKeyStoreClient: לקוח מאגר המפתחות הנוכחי שמשמש ליצירת תצורות. |
runUtil |
IRunUtil: IRunUtil הנוכחי להרצת פקודות במארח. |
globalConfig |
File: ההגדרה הגלובלית שמשמשת להרצת תהליכי משנה של TF. |
| החזרות | |
|---|---|
IConfiguration |
קובץ שמפנה ל-XML של ההגדרות של TF לאובייקטים מסוג NON_VERSIONED. הפונקציה מחזירה null אם לא ניתן ליצור הגדרות של Thin Launcher. |
getTradefedSandboxEnvironment
public File getTradefedSandboxEnvironment (IInvocationContext context, IConfiguration nonVersionedConfig, ITestLogger logger, String[] args)
| פרמטרים | |
|---|---|
context |
IInvocationContext |
nonVersionedConfig |
IConfiguration |
logger |
ITestLogger |
args |
String |
| החזרות | |
|---|---|
File |
|
matchSandboxExtraBuildTargetByConfigName
public staticmatchSandboxExtraBuildTargetByConfigName (String configName)
בהינתן שם הגדרת הבדיקה, צריך להתאים את יעדי הבנייה הנוספים מתוך יעדי הבנייה הנוספים של Sandbox.
| פרמטרים | |
|---|---|
configName |
String |
| החזרות | |
|---|---|
|
|
prepareEnvironment
public Exception prepareEnvironment (IInvocationContext context, IConfiguration config, ITestInvocationListener listener)
מכינים את הסביבה כדי שארגז החול יפעל בצורה תקינה.
| פרמטרים | |
|---|---|
context |
IInvocationContext: ההפעלה הנוכחית IInvocationContext. |
config |
IConfiguration: IConfiguration הפקודה להרצה. |
listener |
ITestInvocationListener: הקריאה הנוכחית ITestInvocationListener שאליה צריך להעביר את התוצאות הסופיות. |
| החזרות | |
|---|---|
Exception |
Exception שמכיל את הכישלון, או Null אם הפעולה הצליחה. |
ראן
public CommandResult run (TestInformation info, IConfiguration config, ITestLogger logger)
מריצים את ארגז החול עם הסביבה שהוגדרה.
| פרמטרים | |
|---|---|
info |
TestInformation: TestInformation שמתאר את ההפעלה |
config |
IConfiguration: IConfiguration הפקודה להרצה. |
logger |
ITestLogger: ITestLogger שבו אפשר לרשום קובצי יומן. |
| החזרות | |
|---|---|
CommandResult |
CommandResult עם הסטטוס של הרצת ארגז החול והיומנים. |
tearDown
public void tearDown ()
מנקים את כל המצבים, הקבצים או הסביבה שאולי השתנו.
שיטות מוגנות
dumpGlobalConfig
protected File dumpGlobalConfig (IConfiguration config,exclusionPatterns)
הצגת התצורה הגלובלית אחרי סינון של חלק מהאובייקטים.
| פרמטרים | |
|---|---|
config |
IConfiguration |
exclusionPatterns |
|
| החזרות | |
|---|---|
File |
|
| זריקות | |
|---|---|
ConfigurationException |
|
getJava
protected String getJava ()
| החזרות | |
|---|---|
String |
|
prepareConfiguration
protected Exception prepareConfiguration (IInvocationContext context, IConfiguration config, ITestInvocationListener listener)
מכינים את IConfiguration שיועבר לתהליך המשנה ויפעיל את
הביצוע של הקונטיינר.
| פרמטרים | |
|---|---|
context |
IInvocationContext: IInvocationContext הנוכחי. |
config |
IConfiguration: IConfiguration שצריך להכין. |
listener |
ITestInvocationListener: ההפעלה הנוכחית ITestInvocationListener. |
| החזרות | |
|---|---|
Exception |
Exception אם משהו השתבש, אחרת null. |
prepareContext
protected File prepareContext (IInvocationContext context, IConfiguration config)
מכינים את IInvocationContext ומבצעים סריאליזציה.
| פרמטרים | |
|---|---|
context |
IInvocationContext: IInvocationContext שצריך להכין. |
config |
IConfiguration: ה-IConfiguration של ארגז החול. |
| החזרות | |
|---|---|
File |
ה-IInvocationContext שעבר סריאליזציה. |
| זריקות | |
|---|---|
|
IOException |