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 | invocationStarted ( IInvocationContext context) מדווח על תחילת הזמנת הבדיקה. |
void | logAssociation (String dataName, LogFile logFile) במקרים מסוימים, יומן חייב להיות משויך מאוד למקרי בדיקה, אך ההזדמנות לעשות זאת ב- |
void | testAssumptionFailure ( TestDescription test, String trace) נקרא כאשר בדיקה אטומית מסמנת שהיא מניחה מצב שהוא שקרי |
void | testAssumptionFailure ( TestDescription test, FailureDescription failure) נקרא כאשר בדיקה אטומית מסמנת שהיא מניחה מצב שהוא שקרי |
void | testEnded ( TestDescription test, long endTime, testMetrics) testEnded ( TestDescription test, long endTime, testMetrics) חלופה ל- |
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) testRunEnded (long elapsedTimeMillis, runMetrics) מדווח על סיום ריצת המבחן. |
void | testRunFailed ( FailureDescription failure) ריצת בדיקת הדוחות לא הושלמה עקב כשל המתואר על ידי |
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 | testStarted ( TestDescription test, long startTime) חלופה ל- |
בנאים ציבוריים
EventsLoggerListener
public EventsLoggerListener (String name)
פרמטרים | |
---|---|
name | String |
שיטות ציבוריות
getLoggedEvents
public File getLoggedEvents ()
החזרות | |
---|---|
File |
הקריאה הסתיימה
public void invocationEnded (long elapsedTime)
מדווח שהפנייה הסתיימה, בין אם בהצלחה ובין אם עקב מצב שגיאה כלשהו.
ייקרא אוטומטית על ידי מסגרת TradeFederation.
פרמטרים | |
---|---|
elapsedTime | long : הזמן שחלף של הקריאה ב-ms |
הפניה נכשלה
public void invocationFailed (FailureDescription failure)
מדווח על הזמנה לא מלאה עקב מצב שגיאה כלשהו.
ייקרא אוטומטית על ידי מסגרת TradeFederation.
פרמטרים | |
---|---|
failure | FailureDescription : FailureDescription המתאר את הסיבה לכשל |
התראה התחילה
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 שנרשם קודם לכן ואמור להיות משויך למקרה הבדיקה. |
testAssumption Failure
public void testAssumptionFailure (TestDescription test, String trace)
נקרא כאשר בדיקה אטומית מסמנת שהיא מניחה מצב שהוא שקרי
פרמטרים | |
---|---|
test | TestDescription : מזהה את הבדיקה |
trace | String : עקבות מחסנית של כישלון |
testAssumption Failure
public void testAssumptionFailure (TestDescription test, FailureDescription failure)
נקרא כאשר בדיקה אטומית מסמנת שהיא מניחה מצב שהוא שקרי
פרמטרים | |
---|---|
test | TestDescription : מזהה את הבדיקה |
failure | FailureDescription : FailureDescription המתאר את הכישלון ואת ההקשר שלו. |
הבדיקה הסתיים
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) של המדדים הנפלטים |
מבחן נכשל
public void testFailed (TestDescription test, FailureDescription failure)
מדווח על כישלון של מקרה בדיקה בודד.
ייקרא בין testStarted לבין testEnded.
פרמטרים | |
---|---|
test | TestDescription : מזהה את הבדיקה |
failure | FailureDescription : FailureDescription המתאר את הכישלון ואת ההקשר שלו. |
מבחן נכשל
public void testFailed (TestDescription test, String trace)
מדווח על כישלון של מקרה בדיקה בודד.
ייקרא בין testStarted לבין testEnded.
פרמטרים | |
---|---|
test | TestDescription : מזהה את הבדיקה |
trace | String : עקבות מחסנית של כישלון |
התעלמו מהבדיקה
public void testIgnored (TestDescription test)
נקרא כאשר בדיקה לא תופעל, בדרך כלל מכיוון ששיטת בדיקה מסומנת ב-org.junit.Ignore.
פרמטרים | |
---|---|
test | TestDescription : מזהה את הבדיקה |
testModuleEnded
public void testModuleEnded ()
מדווח על סיום הפעלת מודול.
testModuleStarted
public void testModuleStarted (IInvocationContext moduleContext)
מדווח על תחילת מודול פועל. התקשרות חוזרת זו משויכת ל- testModuleEnded()
והיא אופציונלית ברצף. הוא משמש רק במהלך ריצה המשתמשת במודולים: רצים מבוססי סוויטה.
פרמטרים | |
---|---|
moduleContext | IInvocationContext : IInvocationContext של המודול. |
testRunEnded
public void testRunEnded (long elapsedTimeMillis,runMetrics)
מדווח על סיום ריצת המבחן. FIXME: אין לנו שני ממשקי Map<> עם סוג שונה, אז עלינו להשתמש ב-HashMap כאן.
פרמטרים | |
---|---|
elapsedTimeMillis | long : המכשיר דיווח על זמן שחלף, באלפיות שניות |
runMetrics | Metric . |
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 הפועלים מספר פעמים. ה-probyNumber הוא 0 באינדקס ואמור לעלות בכל פעם שמתרחשת ריצה חדשה. לדוגמה, בדיקה מפורטת חוזרת 3 פעמים, היא צריכה לכלול 4 ריצות בסך הכל תחת אותו runName וה-probationNumber הוא מ-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 הפועלים מספר פעמים. ה-probyNumber הוא 0 באינדקס ואמור לעלות בכל פעם שמתרחשת ריצה חדשה. לדוגמה, בדיקה מפורטת חוזרת 3 פעמים, היא צריכה לכלול 4 ריצות בסך הכל תחת אותו runName וה-probationNumber הוא מ-0 עד 3. |
startTime | long : הזמן שבו התחילה הריצה, נמדד באמצעות System.currentTimeMillis() |
הבדיקה התחילה
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() |