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_INVOC_COMPLETE_HOST_LOG

String TRADEFED_LOG_NAME

Constructors ציבוריים

TestInvocation()

‫methods ציבוריים

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

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

ערך קבוע: "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_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

זריקות
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