ISandbox

public interface ISandbox

com.android.tradefed.sandbox.ISandbox


ממשק שמגדיר ארגז חול שאפשר להשתמש בו כדי להפעיל קריאה לפונקציה.

סיכום

‫methods ציבוריים

abstract String createClasspath(File workingDir)

יוצרים נתיב מחלקות על סמך הסביבה וספריית העבודה שמוחזרות על ידי getTradefedSandboxEnvironment(IInvocationContext,IConfiguration,String[]).

abstract IConfiguration createThinLauncherConfig(String[] args, IKeyStoreClient keyStoreClient, IRunUtil runUtil, File globalConfig)

מצב מיוחד שבו אין חיבור לריצה הראשית: אם נראה שההגדרה לא קיימת בתיקיית האב, המערכת חוזרת להפעלה דקה שבה היא מנסה להגדיר את ארגז החול עם המידע שזמין כרגע, וממלאת את ספריית העבודה כדי ליצור את ההגדרה באופן מלא בספרייה עם הגרסה.

default Map<String, List<String>> discoverTests(IInvocationContext context, IConfiguration configuration)

שלב משנה של prepareEnvironment(IInvocationContext,IConfiguration,ITestInvocationListener) שבו מתבצעת בדיקה אם SandboxOptions.shouldUseTestDiscovery() מופעל.

default Map<String, List<String>> discoverTests(IInvocationContext context, IConfiguration configuration, ITestLogger logger)
default IFolderBuildInfo fetchSandboxExtraArtifacts(IInvocationContext context, IConfiguration configuration, String[] args)

שלב משנה של prepareEnvironment(IInvocationContext,IConfiguration,ITestInvocationListener) שבו מתבצעת אחזור של קבצים נוספים שנדרשים לארגז החול.

default File getTradefedSandboxEnvironment(IInvocationContext context, IConfiguration nonVersionedConfig, String[] args)

הפונקציה מחזירה את סביבת ארגז החול TF שבה צריך להשתמש על סמך הארגומנטים של שורת הפקודה.

default File getTradefedSandboxEnvironment(IInvocationContext context, IConfiguration nonVersionedConfig, ITestLogger logger, String[] args)
abstract Exception prepareEnvironment(IInvocationContext context, IConfiguration configuration, ITestInvocationListener listener)

מכינים את הסביבה כדי שארגז החול יפעל בצורה תקינה.

abstract CommandResult run(TestInformation info, IConfiguration configuration, ITestLogger logger)

מריצים את ארגז החול עם הסביבה שהוגדרה.

abstract void tearDown()

מנקים את כל המצבים, הקבצים או הסביבות שאולי השתנו.

‫methods ציבוריים

createClasspath

public abstract String createClasspath (File workingDir)

יוצרים נתיב מחלקות על סמך הסביבה וספריית העבודה שמוחזרות על ידי getTradefedSandboxEnvironment(IInvocationContext,IConfiguration,String[]).

פרמטרים
workingDir File: ספריית העבודה הנוכחית של ארגז החול.

החזרות
String נתיב המחלקה לשימוש.

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

createThinLauncherConfig

public abstract 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 אם לא ניתן ליצור הגדרות של משגר דק.

discoverTests

public Map<String, List<String>> discoverTests (IInvocationContext context, 
                IConfiguration configuration)

שלב משנה של prepareEnvironment(IInvocationContext,IConfiguration,ITestInvocationListener) שבו מתבצעת בדיקה אם SandboxOptions.shouldUseTestDiscovery() מופעל.

פרמטרים
context IInvocationContext: ההפעלה הנוכחית IInvocationContext.

configuration IConfiguration: IConfiguration של הפקודה להרצה.

החזרות
Map<String, List<String>> המפה של הבדיקות שזוהו או null אם הבדיקה לא נתמכת או נכשלה.

discoverTests

public Map<String, List<String>> discoverTests (IInvocationContext context, 
                IConfiguration configuration, 
                ITestLogger logger)

פרמטרים
context IInvocationContext

configuration IConfiguration

logger ITestLogger

החזרות
Map<String, List<String>>

fetchSandboxExtraArtifacts

public IFolderBuildInfo fetchSandboxExtraArtifacts (IInvocationContext context, 
                IConfiguration configuration, 
                String[] args)

שלב משנה של prepareEnvironment(IInvocationContext,IConfiguration,ITestInvocationListener) שבו מתבצעת אחזור של קבצים נוספים שנדרשים לארגז החול.

פרמטרים
context IInvocationContext: ההפעלה הנוכחית IInvocationContext.

configuration IConfiguration: IConfiguration של הפקודה להרצה.

args String: הארגומנטים בשורת הפקודה.

החזרות
IFolderBuildInfo הגרסה שאוחזרה עבור הקבצים הנוספים בארגז החול.

הקפצת הודעות שגיאה (throw)
com.android.tradefed.build.BuildRetrievalError
com.android.tradefed.config.ConfigurationException
java.io.IOException
BuildRetrievalError
ConfigurationException
IOException

getTradefedSandboxEnvironment

public File getTradefedSandboxEnvironment (IInvocationContext context, 
                IConfiguration nonVersionedConfig, 
                String[] args)

הפונקציה מחזירה את סביבת ארגז החול TF שבה צריך להשתמש על סמך הארגומנטים של שורת הפקודה.

פרמטרים
context IInvocationContext: IInvocationContext של ההורה.

nonVersionedConfig IConfiguration: IConfiguration שמייצג את האובייקטים ללא גרסאות.

args String: הארגומנטים בשורת הפקודה.

החזרות
File ספרייה File שמכילה את קובצי ה-jar של סביבת הארגז של TF.

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

getTradefedSandboxEnvironment

public File getTradefedSandboxEnvironment (IInvocationContext context, 
                IConfiguration nonVersionedConfig, 
                ITestLogger logger, 
                String[] args)

פרמטרים
context IInvocationContext

nonVersionedConfig IConfiguration

logger ITestLogger

args String

החזרות
File

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

prepareEnvironment

public abstract Exception prepareEnvironment (IInvocationContext context, 
                IConfiguration configuration, 
                ITestInvocationListener listener)

מכינים את הסביבה כדי שארגז החול יפעל בצורה תקינה.

פרמטרים
context IInvocationContext: ההפעלה הנוכחית IInvocationContext.

configuration IConfiguration: IConfiguration של הפקודה להרצה.

listener ITestInvocationListener: ההפעלה הנוכחית ITestInvocationListener שבה צריך להעביר את התוצאות הסופיות.

החזרות
Exception אובייקט Exception שמכיל את הכישלון, או Null אם הפעולה הצליחה.

ראן

public abstract CommandResult run (TestInformation info, 
                IConfiguration configuration, 
                ITestLogger logger)

מריצים את ארגז החול עם הסביבה שהוגדרה.

פרמטרים
info TestInformation: ה-TestInformation שמתאר את ההפעלה

configuration IConfiguration: IConfiguration של הפקודה להרצה.

logger ITestLogger: ITestLogger שבו אפשר לרשום קובצי יומן.

החזרות
CommandResult CommandResult עם הסטטוס של ההרצה בסביבת הארגז ויומנים.

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

tearDown

public abstract void tearDown ()

מנקים את כל המצבים, הקבצים או הסביבה שאולי השתנו.