ISandbox

public interface ISandbox

com.android.tradefed.sandbox.ISandbox


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

סיכום

שיטות ציבוריות

abstract String createClasspath (File workingDir)

צור נתיב class המבוסס על הסביבה וספריית העבודה המוחזרת על ידי getTradefedSandboxEnvironment(com.android.tradefed.invoker.IInvocationContext, com.android.tradefed.config.IConfiguration, String[]) .

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

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

default discoverTests ( IInvocationContext context, IConfiguration configuration)

תת-שלב של prepareEnvironment(com.android.tradefed.invoker.IInvocationContext, com.android.tradefed.config.IConfiguration, com.android.tradefed.result.ITestInvocationListener) שמגלה בדיקות אם SandboxOptions.shouldUseTestDiscovery() הוא enabled.

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

שלב משנה של prepareEnvironment(com.android.tradefed.invoker.IInvocationContext, com.android.tradefed.config.IConfiguration, com.android.tradefed.result.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 ()

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

שיטות ציבוריות

createClasspath

public abstract String createClasspath (File workingDir)

צור נתיב class המבוסס על הסביבה וספריית העבודה המוחזרת על ידי getTradefedSandboxEnvironment(com.android.tradefed.invoker.IInvocationContext, com.android.tradefed.config.IConfiguration, String[]) .

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

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

זורק
ConfigurationException

createThinLauncherConfig

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

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

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

keyStoreClient IKeyStoreClient : לקוח מאגר המפתחות הנוכחי לשימוש ליצירת תצורות.

runUtil IRunUtil : ה- IRunUtil הנוכחי להפעלת פקודות מארח.

globalConfig File : התצורה הגלובלית לשימוש להפעלת תהליכי משנה של TF.

החזרות
IConfiguration קובץ המצביע על תצורת XML של TF עבור אובייקטים NON_VERSIONED. מחזירה null אם לא ניתן ליצור תצורת משגר דקה.

DiscoverTests

public  discoverTests (IInvocationContext context, 
                IConfiguration configuration)

תת-שלב של prepareEnvironment(com.android.tradefed.invoker.IInvocationContext, com.android.tradefed.config.IConfiguration, com.android.tradefed.result.ITestInvocationListener) שמגלה בדיקות אם SandboxOptions.shouldUseTestDiscovery() הוא enabled.

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

configuration IConfiguration : IConfiguration להפעלת הפקודה.

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

DiscoverTests

public  discoverTests (IInvocationContext context, 
                IConfiguration configuration, 
                ITestLogger logger)

פרמטרים
context IInvocationContext

configuration IConfiguration

logger ITestLogger

החזרות

fetchSandboxExtraArtifacts

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

שלב משנה של prepareEnvironment(com.android.tradefed.invoker.IInvocationContext, com.android.tradefed.config.IConfiguration, com.android.tradefed.result.ITestInvocationListener) אשר מביאים קבצים נוספים הדרושים לארגז החול.

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

configuration IConfiguration : IConfiguration להפעלת הפקודה.

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

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

זורק
com.android.tradefed.build.BuildRetrievalError
com.android.tradefed.config.ConfigurationException
IOException
BuildRetrievalError
ConfigurationException

getTradefedSandboxEnvironment

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

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

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

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

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

החזרות
File ספריית ERROR(/File) המכילה את צנצנות סביבת ארגז החול TF.

getTradefedSandboxEnvironment

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

פרמטרים
context IInvocationContext

nonVersionedConfig IConfiguration

logger ITestLogger

args String

החזרות
File

להכין סביבה

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 עם הסטטוס של ריצת ארגז החול ויומנים.

לקרוע

public abstract void tearDown ()

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