EventsLoggerListener

public class EventsLoggerListener
extends Object implements ILogSaverListener

java.lang.Object
   ↳ com.android.tradefed.result.EventsLoggerListener


מאזין שמתעדה ביומן את כל האירועים שהוא מקבל בקובץ

סיכום

קונסטרוקטורים גלויים לכולם

EventsLoggerListener(String name)

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

File getLoggedEvents()
void invocationEnded(long elapsedTime)

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

void invocationFailed(FailureDescription failure)

דיווח על קריאה חלקית עקב תנאי שגיאה כלשהו.

void invocationSkipped(SkipReason reason)

דיווח על קריאה כ'דילוג'

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 testAssumptionFailure(TestDescription test, String trace)

הקריאה מתבצעת כשבדיקה אטומית מסמנת שהיא מניחה תנאי שהוא שקר

void testAssumptionFailure(TestDescription test, FailureDescription failure)

הקריאה מתבצעת כשבדיקה אטומית מסמנת שהיא מניחה תנאי שהוא שקר

void testEnded(TestDescription test, long endTime, testMetrics)

חלופה ל-ERROR(/#testEnded(com.android.tradefed.result.TestDescription,Map)), שבה אפשר לציין את שעת הסיום ישירות.

void testFailed(TestDescription test, FailureDescription failure)

דיווח על כשל של מקרה בדיקה ספציפי.

void testFailed(TestDescription test, String trace)

דיווח על כשל של מקרה בדיקה ספציפי.

void testIgnored(TestDescription test)

הקריאה מתבצעת כשבדיקה לא מופעלת, בדרך כלל כי השיטה לבדיקה מסומנת ב-org.junit.Ignore.

void testModuleEnded()

דיווח על סיום הרצת מודול.

void testModuleStarted(IInvocationContext moduleContext)

האירוע הזה מדווח על תחילת ההרצה של מודול.

void testRunEnded(long elapsedTimeMillis, runMetrics)

דיווח על סיום הרצת הבדיקה.

void testRunFailed(FailureDescription failure)

הרצת הבדיקה של הדוחות נכשלה בגלל כשל שמתואר ב-FailureDescription.

void testRunFailed(String errorMessage)

הרצת הבדיקה של הדוחות נכשלה בגלל שגיאה קטלנית.

void testRunStarted(String runName, int testCount, int attemptNumber)

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

void testRunStarted(String runName, int testCount)

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

void testRunStarted(String runName, int testCount, int attemptNumber, long startTime)

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

void testSkipped(TestDescription test, SkipReason reason)

הקריאה מתבצעת כשבדיקה מופעלת ולא מתבצעת מסיבה שלא צפויה בדרך כלל.

void testStarted(TestDescription test, long startTime)

חלופה ל-testStarted(com.android.tradefed.result.TestDescription) שבה מציינים גם את מועד ההתחלה של הבדיקה, בשילוב עם ERROR(/#testEnded(com.android.tradefed.result.TestDescription,long,Map)) למדידה מדויקת.

קונסטרוקטורים גלויים לכולם

EventsLoggerListener

public EventsLoggerListener (String name)

פרמטרים
name String

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

getLoggedEvents

public File getLoggedEvents ()

החזרות
File

invocationEnded

public void invocationEnded (long elapsedTime)

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

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

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

invocationFailed

public void invocationFailed (FailureDescription failure)

דיווח על קריאה חלקית עקב תנאי שגיאה כלשהו.

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

פרמטרים
failure FailureDescription: ה-FailureDescription שמתאר את הסיבה לכישלון

invocationSkipped

public void invocationSkipped (SkipReason reason)

דיווח על קריאה כ'דילוג'

פרמטרים
reason SkipReason

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 שרשום ביומן קודם וצריך לשייך למקרה הבדיקה.

testAssumptionFailure

public void testAssumptionFailure (TestDescription test, 
                String trace)

הקריאה מתבצעת כשבדיקה אטומית מסמנת שהיא מניחה תנאי שהוא שקר

פרמטרים
test TestDescription: מזהה את הבדיקה

trace String: סטאק טריי של הכשל

testAssumptionFailure

public void testAssumptionFailure (TestDescription test, 
                FailureDescription failure)

הקריאה מתבצעת כשבדיקה אטומית מסמנת שהיא מניחה תנאי שהוא שקר

פרמטרים
test TestDescription: מזהה את הבדיקה

failure FailureDescription: FailureDescription שמתאר את התקלה ואת ההקשר שלה.

testEnded

public void testEnded (TestDescription test, 
                long endTime, 
                 testMetrics)

חלופה ל-ERROR(/#testEnded(com.android.tradefed.result.TestDescription,Map)), שבה אפשר לציין את שעת הסיום ישירות. כדי לקבל מדידה מדויקת, כדאי לשלב את הקוד עם testStarted(com.android.tradefed.result.TestDescription, long).

פרמטרים
test TestDescription: מזהה את הבדיקה

endTime long: השעה שבה הסתיים הבדיקה, נמדדת באמצעות System.currentTimeMillis()

testMetrics : ERROR(/Map) של המדדים שמונפקים

testFailed

public void testFailed (TestDescription test, 
                FailureDescription failure)

דיווח על כשל של מקרה בדיקה ספציפי.

הקריאה תתבצע בין testStarted ל-testEnded.

פרמטרים
test TestDescription: מזהה את הבדיקה

failure FailureDescription: FailureDescription שמתאר את התקלה ואת ההקשר שלה.

testFailed

public void testFailed (TestDescription test, 
                String trace)

דיווח על כשל של מקרה בדיקה ספציפי.

הקריאה תתבצע בין testStarted ל-testEnded.

פרמטרים
test TestDescription: מזהה את הבדיקה

trace String: סטאק טריי של הכשל

testIgnored

public void testIgnored (TestDescription test)

הקריאה מתבצעת כשבדיקה לא מופעלת, בדרך כלל כי השיטה לבדיקה מסומנת ב-org.junit.Ignore.

פרמטרים
test TestDescription: מזהה את הבדיקה

testModuleEnded

public void testModuleEnded ()

דיווח על סיום הרצת מודול.

testModuleStarted

public void testModuleStarted (IInvocationContext moduleContext)

האירוע הזה מדווח על תחילת ההרצה של מודול. קריאת החזרה (callback) הזו משויכת ל-testModuleEnded() והיא אופציונלית בסדרה. הוא משמש רק במהלך ריצה שמשתמשת במודולים: כלי ריצה מבוססי-חבילות.

פרמטרים
moduleContext IInvocationContext: ה-IInvocationContext של המודול.

testRunEnded

public void testRunEnded (long elapsedTimeMillis, 
                 runMetrics)

דיווח על סיום הרצת הבדיקה.

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

runMetrics : צמדי מפתח/ערך שמדווחים בסוף הרצה של בדיקה

testRunFailed

public void testRunFailed (FailureDescription failure)

הרצת הבדיקה של הדוחות נכשלה בגלל כשל שמתואר ב-FailureDescription.

פרמטרים
failure FailureDescription: FailureDescription שמתאר את התקלה ואת ההקשר שלה.

testRunFailed

public void testRunFailed (String errorMessage)

הרצת הבדיקה של הדוחות נכשלה בגלל שגיאה קטלנית.

פרמטרים
errorMessage String: String שמתאר את הסיבה לכישלון ההרצה.

testRunStarted

public void testRunStarted (String runName, 
                int testCount, 
                int attemptNumber)

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

פרמטרים
runName String: שם ההרצה לניסיון

testCount int: המספר הכולל של הבדיקות בהרצה לניסיון

attemptNumber int: מספר הזמנה, שמזהה את הניסיונות השונים של אותו runName שירוצו כמה פעמים. הערך של attemptNumber מתחיל ב-0 וצריך לעלות בכל פעם שמתבצעה הפעלה חדשה. לדוגמה, אם מתבצעות 3 ניסיונות מפורטים של בדיקה, צריכות להיות לה 4 הפעלות בסך הכול באותו runName, והערך של attemptNumber יהיה בין 0 ל-3.

testRunStarted

public void testRunStarted (String runName, 
                int testCount)

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

פרמטרים
runName String: שם ההרצה לניסיון

testCount int: המספר הכולל של הבדיקות בהרצה לניסיון

testRunStarted

public void testRunStarted (String runName, 
                int testCount, 
                int attemptNumber, 
                long startTime)

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

פרמטרים
runName String: שם ההרצה לניסיון

testCount int: המספר הכולל של הבדיקות בהרצה לניסיון

attemptNumber int: מספר הזמנה, שמזהה את הניסיונות השונים של אותו runName שירוצו כמה פעמים. הערך של attemptNumber מתחיל ב-0 וצריך לעלות בכל פעם שמתבצעה הפעלה חדשה. לדוגמה, אם ניסוי מסוים מנסה שוב 3 פעמים ברמת פירוט גבוהה, צריכות להיות לו 4 הפעלות בסך הכול באותו runName, והערך של attemptNumber יהיה בין 0 ל-3.

startTime long: השעה שבה הרצת הקוד התחילה, שנמדדת באמצעות System.currentTimeMillis()

testSkipped

public void testSkipped (TestDescription test, 
                SkipReason reason)

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

פרמטרים
test TestDescription: מזהה את הבדיקה

reason SkipReason: SkipReason

testStarted

public void testStarted (TestDescription test, 
                long startTime)

חלופה ל-testStarted(com.android.tradefed.result.TestDescription) שבה מציינים גם את מועד ההתחלה של הבדיקה, בשילוב עם ERROR(/#testEnded(com.android.tradefed.result.TestDescription,long,Map)) למדידה מדויקת.

פרמטרים
test TestDescription: מזהה את הבדיקה

startTime long: השעה שבה הבדיקה התחילה, נמדדת באמצעות System.currentTimeMillis()