ILogSaverListener

public interface ILogSaverListener
implements ITestInvocationListener

com.android.tradefed.result.ILogSaverListener


מאפשר ל- ITestInvocationListener להאזין כאשר קבצי יומן נשמרים.

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

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

מחלקה זו גם עוברת את המופע הגלובלי ILogSaver כך ש- ITestInvocationListener s יכולים לשמור קבצים נוספים באותו מיקום.

סיכום

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

default void logAssociation (String dataName, LogFile logFile)

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

default void setLogSaver ( ILogSaver logSaver)

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

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

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

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

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 המכיל את המטא נתונים של הקובץ השמור.