TestInvocation

public class TestInvocation
extends Object implements ITestInvocation

java.lang.Object
   ↳ com.android.tradefed.invoker.TestInvocation


הטמעת ברירת המחדל של ITestInvocation.

טוען אובייקטים ראשיים על סמך IConfiguration - מאחזר את ה-build - מכין את היעד - מפעיל בדיקות - מדווח על התוצאות

סיכום

קבועים

long AVAILABILITY_CHECK_TIMEOUT

שדות

public static final String COMMAND_ARGS_KEY

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

public static final String INVOCATION_EXTERNAL_DEPENDENCIES

public static final String TRADEFED_CONFIG_NAME

public static final String TRADEFED_END_HOST_LOG

public static final String TRADEFED_INVOC_COMPLETE_HOST_LOG

public static final String TRADEFED_LOG_NAME

קונסטרוקטורים גלויים לכולם

TestInvocation()

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

static IBuildInfo backFillBuildInfoForReporting(String commandLine)

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

static FailureDescription createFailureFromException(Throwable exception, TestRecordProto.FailureStatus defaultStatus)

יצירת FailureDescription מהחרגה של קריאה.

IInvocationExecution createInvocationExec(TestInvocation.RunMode mode)

יוצרים את נתיב ההפעלה שצריך לפעול לפיו.

static String getDeviceLogName(TestInvocation.Stage stage)
static String getEmulatorLogName(TestInvocation.Stage stage)
ITestInvocation.ExitInformation getExitInfo()

פרטי היציאה של ההפעלה הנתונה.

void invoke(IInvocationContext context, IConfiguration config, IRescheduler rescheduler, ITestInvocationListener... extraListeners)

מבצעים את הקריאה לבדיקה.

static boolean isSubprocess(IConfiguration config)

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

void notifyInvocationForceStopped(String message, ErrorIdentifier errorId)

מודיעים ל-TestInvocation ש-TradeFed התבקש להפסיק.

void notifyInvocationStopped(String message)

להודיע ל-TestInvocation ש-TradeFed יושבת בסופו של דבר.

static void printStageDelimiter(TestInvocation.Stage phase, boolean end)

הדפסת תו מפריד לשלב נתון של ההפעלה.

void registerExecutionFiles(ExecutionFiles executionFiles)
void setClearcutClient(ClearcutClient client)

מעבירים את הלקוח של Clearcut כדי לדווח על מדדים.

static boolean shouldSkipBugreportError(Throwable t)

שיטת עזר שמזהה שגיאות כשצריך לדלג על דוח הבאג

String toString()

שיטות מוגנות

void addInvocationMetric(InvocationMetricLogger.InvocationMetricKey key, String value)
void addInvocationMetric(InvocationMetricLogger.InvocationMetricKey key, long value)
void applyAutomatedReporters(IConfiguration config)
void setExitCode(CommandRunner.ExitCode code, Throwable stack)

פונקציית עזרה להגדרת קוד היציאה.

קבועים

AVAILABILITY_CHECK_TIMEOUT

public static final long AVAILABILITY_CHECK_TIMEOUT

ערך קבוע: 180000 (0x000000000002bf20)

שדות

COMMAND_ARGS_KEY

public static final String COMMAND_ARGS_KEY

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

INVOCATION_EXTERNAL_DEPENDENCIES

public static final String INVOCATION_EXTERNAL_DEPENDENCIES

TRADEFED_CONFIG_NAME

public static final String TRADEFED_CONFIG_NAME

TRADEFED_END_HOST_LOG

public static final String TRADEFED_END_HOST_LOG

TRADEFED_INVOC_COMPLETE_HOST_LOG

public static final String TRADEFED_INVOC_COMPLETE_HOST_LOG

TRADEFED_LOG_NAME

public static final String TRADEFED_LOG_NAME

קונסטרוקטורים גלויים לכולם

TestInvocation

public TestInvocation ()

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

backFillBuildInfoForReporting

public static IBuildInfo backFillBuildInfoForReporting (String commandLine)

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

פרמטרים
commandLine String

החזרות
IBuildInfo

createFailureFromException

public static FailureDescription createFailureFromException (Throwable exception, 
                TestRecordProto.FailureStatus defaultStatus)

יצירת FailureDescription מהחרגה של קריאה.

פרמטרים
exception Throwable: החריג שרוצים להמיר

defaultStatus TestRecordProto.FailureStatus: הסטטוס שבו יש להשתמש כברירת מחדל אם החריגה היא לא IHarnessException.

החזרות
FailureDescription

createInvocationExec

public IInvocationExecution createInvocationExec (TestInvocation.RunMode mode)

יוצרים את נתיב ההפעלה שצריך לפעול לפיו.

פרמטרים
mode TestInvocation.RunMode: המצב שבו אנחנו מריצים כרגע.

החזרות
IInvocationExecution ה-IInvocationExecution שמתאר את ההפעלה.

getDeviceLogName

public static String getDeviceLogName (TestInvocation.Stage stage)

פרמטרים
stage TestInvocation.Stage

החזרות
String

getEmulatorLogName

public static String getEmulatorLogName (TestInvocation.Stage stage)

פרמטרים
stage TestInvocation.Stage

החזרות
String

getExitInfo

public ITestInvocation.ExitInformation getExitInfo ()

פרטי היציאה של ההפעלה הנתונה.

החזרות
ITestInvocation.ExitInformation

להפעיל

public void invoke (IInvocationContext context, 
                IConfiguration config, 
                IRescheduler rescheduler, 
                ITestInvocationListener... extraListeners)

מבצעים את הקריאה לבדיקה.

פרמטרים
context IInvocationContext: ה-IInvocationContext לביצוע בדיקות.

config IConfiguration: ה-IConfiguration של הריצת הבדיקה הזו.

rescheduler IRescheduler: IRescheduler, כדי לתזמן מחדש חלקים מהקריאה להפעלה לביצוע במשאבים אחרים

extraListeners ITestInvocationListener: ITestInvocationListener שרוצים לשלוח אליהם התראה, בנוסף לconfig

זריקות
DeviceNotAvailableException

isSubprocess

public static boolean isSubprocess (IConfiguration config)

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

פרמטרים
config IConfiguration

החזרות
boolean

notifyInvocationForceStopped

public void notifyInvocationForceStopped (String message, 
                ErrorIdentifier errorId)

מודיעים ל-TestInvocation ש-TradeFed התבקש להפסיק.

פרמטרים
message String: ההודעה שמשויכת להפסקת ההפעלה

errorId ErrorIdentifier: המזהה שמשויך להפסקה הכפויה

notifyInvocationStopped

public void notifyInvocationStopped (String message)

להודיע ל-TestInvocation ש-TradeFed יושבת בסופו של דבר.

פרמטרים
message String: ההודעה שמשויכת להפסקת ההפעלה

printStageDelimiter

public static void printStageDelimiter (TestInvocation.Stage phase, 
                boolean end)

הדפסת תו מפריד לשלב נתון של ההפעלה.

פרמטרים
phase TestInvocation.Stage

end boolean

registerExecutionFiles

public void registerExecutionFiles (ExecutionFiles executionFiles)

פרמטרים
executionFiles ExecutionFiles

setClearcutClient

public void setClearcutClient (ClearcutClient client)

מעבירים את הלקוח של Clearcut כדי לדווח על מדדים.

פרמטרים
client ClearcutClient

shouldSkipBugreportError

public static boolean shouldSkipBugreportError (Throwable t)

שיטת עזר שמזהה שגיאות כשצריך לדלג על דוח הבאג

פרמטרים
t Throwable

החזרות
boolean

toString

public String toString ()

החזרות
String

שיטות מוגנות

addInvocationMetric

protected void addInvocationMetric (InvocationMetricLogger.InvocationMetricKey key, 
                String value)

פרמטרים
key InvocationMetricLogger.InvocationMetricKey

value String

addInvocationMetric

protected void addInvocationMetric (InvocationMetricLogger.InvocationMetricKey key, 
                long value)

פרמטרים
key InvocationMetricLogger.InvocationMetricKey

value long

applyAutomatedReporters

protected void applyAutomatedReporters (IConfiguration config)

פרמטרים
config IConfiguration

setExitCode

protected void setExitCode (CommandRunner.ExitCode code, 
                Throwable stack)

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

פרמטרים
code CommandRunner.ExitCode

stack Throwable