AndroidBuildApiLogSaver

public class AndroidBuildApiLogSaver
extends Object implements ILogSaver

java.lang.Object
   ↳ com.google.android.tradefed.result.AndroidBuildApiLogSaver


מחלקת Android ששומרת קובצי יומן ב-Android Build API.

סיכום

‫constructors ציבוריים

AndroidBuildApiLogSaver()

‫methods ציבוריים

LogFile getLogReportDir()

מקבלים את LogFile שמכיל את הנתיב או כתובת ה-URL של הספרייה שבה היומנים נשמרים.

void init(IInvocationContext context)

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

void invocationEnded(long elapsedTime)

דיווח על סיום ההפעלה, בין אם בהצלחה ובין אם בגלל שגיאה כלשהי.

void invocationStarted(IInvocationContext context)

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

LogFile saveLogData(String dataName, LogDataType dataType, InputStream dataStream)

שומרים את נתוני היומן.

LogFile saveLogFile(String dataName, LogDataType dataType, File fileToLog)

שומרים את קובץ היומן.

שיטות מוגנות

IInvocationContext getInvocationContext()
void runUpdate(Androidbuildinternal client, String filePath, String resourceId, String md5, FileContent fileContent, LogDataType type, String contentType)

Constructors ציבוריים

AndroidBuildApiLogSaver

public AndroidBuildApiLogSaver ()

‫methods ציבוריים

getLogReportDir

public LogFile getLogReportDir ()

מקבלים את LogFile שמכיל את הנתיב או כתובת ה-URL של הספרייה שבה היומנים נשמרים.

החזרות
LogFile הכרטיס LogFile.

init

public void init (IInvocationContext context)

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

פרמטרים
context IInvocationContext: מידע על הקריאה.

invocationEnded

public void invocationEnded (long elapsedTime)

דיווח על סיום ההפעלה, בין אם בהצלחה ובין אם בגלל שגיאה כלשהי.

הפונקציה הזו תופעל אוטומטית על ידי המסגרת TradeFederation אחרי הפעלת הפונקציה ITestInvocationListener.invocationEnded(long).

פרמטרים
elapsedTime long: הזמן שחלף מאז ההפעלה במילישניות

invocationStarted

public void invocationStarted (IInvocationContext context)

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

המערכת תתקשר אוטומטית אל TradeFederation framework לפני שהיא תתקשר אל ITestInvocationListener.invocationStarted(IInvocationContext).

פרמטרים
context IInvocationContext: מידע על הקריאה.

saveLogData

public LogFile saveLogData (String dataName, 
                LogDataType dataType, 
                InputStream dataStream)

שומרים את נתוני היומן.

הפונקציה הזו תיקרא אוטומטית על ידי מסגרת TradeFederation בכל פעם שהפונקציה ITestLogger.testLog(String, com.android.tradefed.result.LogDataType, com.android.tradefed.result.InputStreamSource) תיקרא. יכול להיות שמשתמשים בה גם כשיטת עזר לשמירת נתוני יומן נוספים.

בהתאם להטמעה ולמדיניות, יכול להיות שהיומנים יישמרו בצורה דחוסה. יכול להיות שהיומנים מאוחסנים במיקום שאין ל-Tradefed גישה אליו.

פרמטרים
dataName String: שם תיאורי של הנתונים. לדוגמה, device_logcatString

dataType LogDataType: LogDataType של הקובץ.

dataStream InputStream: ERROR(/InputStream) הנתונים.

החזרות
LogFile LogFile שמכיל את הנתיב וכתובת ה-URL של הקובץ שנשמר.

saveLogFile

public LogFile saveLogFile (String dataName, 
                LogDataType dataType, 
                File fileToLog)

שומרים את קובץ היומן.

המסגרת TradeFederation תקרא לו באופן אוטומטי בכל פעם שקוראים ל-ITestLogger.testLog(String, com.android.tradefed.result.LogDataType, com.android.tradefed.result.InputStreamSource) והזרם מפנה לקובץ.

בהתאם להטמעה ולמדיניות, יכול להיות שהיומנים יישמרו בצורה דחוסה. יכול להיות שהיומנים מאוחסנים במיקום שאין ל-Tradefed גישה אליו.

פרמטרים
dataName String: שם תיאורי של הנתונים. לדוגמה, device_logcatString

dataType LogDataType: LogDataType של הקובץ.

fileToLog File: ERROR(/File) שרוצים לשמור.

החזרות
LogFile LogFile שמכיל את הנתיב וכתובת ה-URL של הקובץ שנשמר.

שיטות מוגנות

getInvocationContext

protected IInvocationContext getInvocationContext ()

החזרות
IInvocationContext

runUpdate

protected void runUpdate (Androidbuildinternal client, 
                String filePath, 
                String resourceId, 
                String md5, 
                FileContent fileContent, 
                LogDataType type, 
                String contentType)

פרמטרים
client Androidbuildinternal

filePath String

resourceId String

md5 String

fileContent FileContent

type LogDataType

contentType String