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.
סיכום
שדות | |
---|---|
public
static
final
String |
EXTRA_TARGET_LAB
|
public
static
final
String |
GENERAL_TESTS_ZIP
|
public
static
final
String |
SANDBOX_ENABLED
|
יוצרים ציבוריים | |
---|---|
TradefedSandbox()
|
שיטות ציבוריות | |
---|---|
String
|
createClasspath(File workingDir)
יצירת classpath על סמך הסביבה וספריית העבודה שמוחזרת על ידי |
IConfiguration
|
createThinLauncherConfig(String[] args, IKeyStoreClient keyStoreClient, IRunUtil runUtil, File globalConfig)
מצב מיוחד שמנותק מההרצה הראשית: אם נראה שההגדרה לא קיימת בהורה, אנחנו עוברים למרכז האפליקציות הדק, שבו אנחנו מנסים להגדיר את ארגז החול עם המידע הידוע כרגע ולמלא את ספריית העבודה כדי ליצור את ההגדרה באופן מלא בספרייה עם הגרסאות. |
File
|
getTradefedSandboxEnvironment(IInvocationContext context, IConfiguration nonVersionedConfig, ITestLogger logger, String[] args)
|
static
|
matchSandboxExtraBuildTargetByConfigName(String configName)
על סמך שם הגדרת הבדיקה, מתאימים את יעדי ה-build הנוספים ליעדי ה-build הנוספים של Sandbox. |
Exception
|
prepareEnvironment(IInvocationContext context, IConfiguration config, ITestInvocationListener listener)
מכינים את הסביבה כדי שארגז החול יפעל כמו שצריך. |
CommandResult
|
run(TestInformation info, IConfiguration config, ITestLogger logger)
מריצים את ארגז החול עם הסביבה שהוגדרה. |
void
|
tearDown()
מנקים את כל המצבים, הקבצים או הסביבה שעשויים להשתנות. |
שיטות מוגנות | |
---|---|
File
|
dumpGlobalConfig(IConfiguration config,
יצירת גרסת dump של התצורה הגלובלית שסוננה מחלק מהאובייקטים. |
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
GENERAL_TESTS_ZIP
public static final String GENERAL_TESTS_ZIP
SANDBOX_ENABLED
public static final String SANDBOX_ENABLED
יוצרים ציבוריים
TradefedSandbox
public TradefedSandbox ()
שיטות ציבוריות
createClasspath
public String createClasspath (File workingDir)
יצירת classpath על סמך הסביבה וספריית העבודה שמוחזרת על ידי 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)
מצב מיוחד שמנותק מההפעלה הראשית: אם נראה שההגדרה לא קיימת בהורה, אנחנו עוברים למרכז האפליקציות הדק, שבו אנחנו מנסים להגדיר את ארגז החול עם המידע הידוע כרגע ולמלא את ספריית העבודה כדי ליצור את ההגדרה באופן מלא בספרייה עם הגרסאות.
פרמטרים | |
---|---|
args |
String : הארגומנטים המקוריים בשורת הפקודה. |
keyStoreClient |
IKeyStoreClient : לקוח מאגר המפתחות הנוכחי שמשמש ליצירת הגדרות. |
runUtil |
IRunUtil : IRunUtil הנוכחי להרצת פקודות המארח. |
globalConfig |
File : ההגדרה הגלובלית שבה משתמשים כדי להריץ תהליכים משניים של TF. |
החזרות | |
---|---|
IConfiguration |
קובץ שמצביע על קובץ ה-XML של תצורת TF לאובייקטים מסוג NON_VERSIONED. הפונקציה מחזירה ערך null אם לא ניתן ליצור הגדרות של מרכז אפליקציות דק. |
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)
על סמך שם הגדרת הבדיקה, מתאימים את יעדי ה-build הנוספים ליעדי ה-build הנוספים של 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 עם סטטוס ההרצה ב-sandbox והיומנים. |
tearDown
public void tearDown ()
מנקים את כל המצבים, הקבצים או הסביבה שעשויים להשתנות.
שיטות מוגנות
dumpGlobalConfig
protected File dumpGlobalConfig (IConfiguration config,exclusionPatterns)
יצירת גרסת dump של התצורה הגלובלית שסוננה מחלק מהאובייקטים.
פרמטרים | |
---|---|
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 |
חריגה אם משהו השתבש, null אחרת. |
prepareContext
protected File prepareContext (IInvocationContext context, IConfiguration config)
מכינים את IInvocationContext
ומעבירים אותו לסריאליזציה.
פרמטרים | |
---|---|
context |
IInvocationContext : ה-IInvocationContext שרוצים להכין. |
config |
IConfiguration : ה-IConfiguration של ארגז החול. |
החזרות | |
---|---|
File |
IInvocationContext בסריאליזציה. |
זריקות | |
---|---|
|
IOException |