ResultAndLogForwarder

public class ResultAndLogForwarder
extends ResultForwarder implements ILogSaverListener

java.lang.Object
   ↳ com.android.tradefed.result.ResultForwarder
     ↳ com.android.tradefed.result.ResultAndLogForwarder


שירות העברה של תוצאות ואירועים ביומן.

סיכום

יוצרים ציבוריים

ResultAndLogForwarder(ITestInvocationListener... listeners)
ResultAndLogForwarder( listeners)

Ctor

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

void invocationEnded(long elapsedTime)

האירוע הזה מדווח על סיום ההפעלה, בין שהיא הסתיימה בהצלחה ובין שהיא הסתיימה בגלל תנאי שגיאה כלשהו.

void invocationStarted(IInvocationContext context)

דיווח על התחלת ההפעלה של הבדיקה.

void logAssociation(String dataName, LogFile logFile)

במקרים מסוימים, צריך לשייך את היומן באופן חזק למקרה בדיקה, אבל אי אפשר לעשות זאת בקריאה החוזרת (callback) הישירה של testLogSaved(String, com.android.tradefed.result.LogDataType, com.android.tradefed.result.InputStreamSource, com.android.tradefed.result.LogFile).

void setLogSaver(ILogSaver logSaver)

מגדירים את ILogSaver כדי לאפשר למטמיע לשמור קבצים.

void testLogSaved(String dataName, LogDataType dataType, InputStreamSource dataStream, LogFile logFile)

הקריאה מתבצעת כשיומן הבדיקה נשמר.

יוצרים ציבוריים

ResultAndLogForwarder

public ResultAndLogForwarder (ITestInvocationListener... listeners)

פרמטרים
listeners ITestInvocationListener

ResultAndLogForwarder

public ResultAndLogForwarder ( listeners)

Ctor

פרמטרים
listeners

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

invocationEnded

public void invocationEnded (long elapsedTime)

האירוע הזה מדווח על סיום ההפעלה, בין שהיא הסתיימה בהצלחה ובין שהיא הסתיימה בגלל תנאי שגיאה כלשהו.

הקריאה תתבצע באופן אוטומטי על ידי מסגרת TradeFederation.

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

invocationStarted

public void invocationStarted (IInvocationContext context)

דיווח על התחלת ההפעלה של הבדיקה.

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

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

logAssociation

public void logAssociation (String dataName, 
                LogFile logFile)

במקרים מסוימים, צריך לשייך את היומן באופן חזק למקרה בדיקה, אבל אי אפשר לעשות זאת בקריאה החוזרת (callback) הישירה של testLogSaved(String, com.android.tradefed.result.LogDataType, com.android.tradefed.result.InputStreamSource, com.android.tradefed.result.LogFile). כך, קריאת ה-callback הזו מאפשרת לספק באופן מפורש שיוך חזק.

פרמטרים
dataName String: השם של הנתונים

logFile LogFile: ה-LogFile שרשום ביומן קודם וצריך לשייך למקרה הבדיקה.

setLogSaver

public void setLogSaver (ILogSaver logSaver)

מגדירים את ILogSaver כדי לאפשר למטמיע לשמור קבצים.

פרמטרים
logSaver ILogSaver: ILogSaver

testLogSaved

public void testLogSaved (String dataName, 
                LogDataType dataType, 
                InputStreamSource dataStream, 
                LogFile logFile)

הקריאה מתבצעת כשיומן הבדיקה נשמר.

צריך להשתמש בו במקום ב-ITestInvocationListener.testLog(String, LogDataType, InputStreamSource).

פרמטרים
dataName String: String שם תיאורי של הנתונים. לדוגמה, 'device_logcat'. הערה: שם המשתנה dataName לא חייב להיות ייחודי לכל קריאה. כלומר, למטמיעים צריכה להיות אפשרות לטפל בכמה קריאות עם אותו שם משתנה.

dataType LogDataType: ה-LogDataType של הנתונים

dataStream InputStreamSource: ה-InputStreamSource של הנתונים. מי שמטמיע את הקוד צריך להפעיל את createInputStream כדי להתחיל לקרוא את הנתונים, ולוודא שהוא סוגר את ה-InputStream שנוצר בסיום.

logFile LogFile: ה-LogFile שמכיל את המטא-נתונים של הקובץ השמור.