ResultAndLogForwarder

public class ResultAndLogForwarder
extends ResultForwarder implements ILogSaverListener

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


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

סיכום

Constructors ציבוריים

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

Ctor

‫methods ציבוריים

void invocationEnded(long elapsedTime)

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

void invocationStarted(IInvocationContext context)

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

void logAssociation(String dataName, LogFile logFile)

במקרים מסוימים, צריך לשייך את היומן באופן חזק לתרחישי בדיקה, אבל אי אפשר לעשות את זה באמצעות הקריאה החוזרת הישירה 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)

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

Constructors ציבוריים

ResultAndLogForwarder

public ResultAndLogForwarder (ITestInvocationListener... listeners)

פרמטרים
listeners ITestInvocationListener

ResultAndLogForwarder

public ResultAndLogForwarder ( listeners)

Ctor

פרמטרים
listeners

‫methods ציבוריים

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)

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

פרמטרים
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 לא יהיה ייחודי לכל הפעלה. כלומר, המטמיעים צריכים להיות מסוגלים לטפל בכמה קריאות עם אותו dataName

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

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

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