TestInvocation
public
class
TestInvocation
extends Object
implements
ITestInvocation
| java.lang.Object | |
| ↳ | com.android.tradefed.invoker.TestInvocation |
הטמעת ברירת המחדל של ITestInvocation.
טעינה של אובייקטים מרכזיים על סמך IConfiguration
– אחזור של build
– הכנה של יעד
– הרצה של בדיקות
– דיווח על תוצאות
סיכום
ערכים קבועים | |
|---|---|
long |
AVAILABILITY_CHECK_TIMEOUT
|
String |
COMMAND_ARGS_KEY
המפתח של מאפייני הארגומנטים בשורת הפקודה |
String |
INVOCATION_EXTERNAL_DEPENDENCIES
|
String |
TRADEFED_CONFIG_NAME
|
String |
TRADEFED_END_HOST_LOG
|
String |
TRADEFED_EVENT_LOG
|
String |
TRADEFED_INVOC_COMPLETE_HOST_LOG
|
String |
TRADEFED_LOG_NAME
|
constructors ציבוריים | |
|---|---|
TestInvocation()
|
|
methods ציבוריים | |
|---|---|
static
IBuildInfo
|
backFillBuildInfoForReporting(String commandLine)
כלי עזר שמשתמש בשורת הפקודה כדי למלא מחדש את |
static
FailureDescription
|
createFailureFromException(Throwable exception, TestRecordProto.FailureStatus defaultStatus)
יוצרים |
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)
הודעה ל- |
void
|
notifyInvocationStopped(String message)
הודעה ל- |
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
|
applyDeviceAutomatedSetup(IInvocationContext context, 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
המפתח של מאפייני הארגומנטים בשורת הפקודה
ערך קבוע: "command_line_args"
INVOCATION_EXTERNAL_DEPENDENCIES
public static final String INVOCATION_EXTERNAL_DEPENDENCIES
ערך קבוע: "invocation-external-dependencies"
TRADEFED_CONFIG_NAME
public static final String TRADEFED_CONFIG_NAME
ערך קבוע: "tradefed-expanded-config"
TRADEFED_END_HOST_LOG
public static final String TRADEFED_END_HOST_LOG
ערך קבוע: "end_host_log"
TRADEFED_EVENT_LOG
public static final String TRADEFED_EVENT_LOG
ערך קבוע: "event-logs"
TRADEFED_INVOC_COMPLETE_HOST_LOG
public static final String TRADEFED_INVOC_COMPLETE_HOST_LOG
ערך קבוע: "invoc_complete_host_log"
TRADEFED_LOG_NAME
public static final String TRADEFED_LOG_NAME
ערך קבוע: "host_log"
constructors ציבוריים
TestInvocation
public TestInvocation ()
methods ציבוריים
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 |
| הקפצת הודעות שגיאה (throw) | |
|---|---|
DeviceNotAvailableException |
|
Throwable |
|
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 |
applyDeviceAutomatedSetup
protected void applyDeviceAutomatedSetup (IInvocationContext context, IConfiguration config)
| פרמטרים | |
|---|---|
context |
IInvocationContext |
config |
IConfiguration |
setExitCode
protected void setExitCode (CommandRunner.ExitCode code, Throwable stack)
פונקציית עזר להגדרת קוד היציאה. חשוף לבדיקה.
| פרמטרים | |
|---|---|
code |
CommandRunner.ExitCode |
stack |
Throwable |