ResultAggregator
public class ResultAggregator
extends CollectingTestListener
java.lang.Object | ||
↳ | com.android.tradefed.result.CollectingTestListener | |
↳ | com.android.tradefed.retry.ResultAggregator |
משלח מיוחד שמגבש את התוצאות בעת הצורך, בהתבסס על אסטרטגיית הניסיון החוזר שננקטה.
סיכום
בנאים ציבוריים | |
---|---|
ResultAggregator ( listeners, RetryStrategy strategy) ResultAggregator ( listeners, RetryStrategy strategy) |
שיטות ציבוריות | |
---|---|
void | cleanEventsFiles () |
final void | forwardAggregatedInvocationLogs () העבר את כל יומני רמת ההתקשרות לכתבי התוצאות שאינם תומכים בתוצאות המפורטות. |
void | invocationEnded (long elapsedTime) מדווח שהפנייה הסתיימה, בין אם בהצלחה ובין אם עקב מצב שגיאה כלשהו. |
void | invocationFailed ( FailureDescription failure) |
void | invocationFailed (Throwable cause) מדווח על הזמנה לא מלאה עקב מצב שגיאה כלשהו. |
void | invocationStarted ( IInvocationContext context) מדווח על תחילת הזמנת הבדיקה. |
void | logAssociation (String dataName, LogFile logFile) במקרים מסוימים, יומן חייב להיות משויך מאוד למקרי בדיקה, אך ההזדמנות לעשות זאת ב- |
void | setLogSaver ( ILogSaver logSaver) |
void | setUpdatedReporting (boolean updatedReporting) מגדיר את הדיווח החדש. |
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 | testLog (String dataName, LogDataType dataType, InputStreamSource dataStream) |
void | testLogSaved (String dataName, LogDataType dataType, InputStreamSource dataStream, LogFile logFile) |
void | testModuleEnded () מדווח על סיום הפעלת מודול. |
void | testModuleStarted ( IInvocationContext moduleContext) מדווח על תחילת מודול פועל. |
void | testRunEnded (long elapsedTime, runMetrics) testRunEnded (long elapsedTime, runMetrics) מדווח על סיום ריצת המבחן. |
void | testRunFailed ( FailureDescription failure) ריצת בדיקת הדוחות לא הושלמה עקב כשל המתואר על ידי |
void | testRunFailed (String errorMessage) ריצת בדיקת הדוחות לא הושלמה עקב שגיאה קטלנית. |
void | testRunStarted (String name, int testCount, int attemptNumber, long startTime) מדווח על תחילת ריצת מבחן. |
void | testStarted ( TestDescription test, long startTime) חלופה ל- |
שיטות מוגנות | |
---|---|
File[] | getEventsLogs () |
בנאים ציבוריים
ResultAggregator
public ResultAggregator (listeners, RetryStrategy strategy)
פרמטרים | |
---|---|
listeners | |
strategy | RetryStrategy |
שיטות ציבוריות
cleanEventsFiles
public void cleanEventsFiles ()
forwardAggregatedInvocationLogs
public final void forwardAggregatedInvocationLogs ()
העבר את כל יומני רמת ההתקשרות לכתבי התוצאות שאינם תומכים בתוצאות המפורטות.
הקריאה הסתיימה
public void invocationEnded (long elapsedTime)
מדווח שהפנייה הסתיימה, בין אם בהצלחה ובין אם עקב מצב שגיאה כלשהו.
ייקרא אוטומטית על ידי מסגרת TradeFederation.
פרמטרים | |
---|---|
elapsedTime | long : הזמן שחלף של הקריאה ב-ms |
הפניה נכשלה
public void invocationFailed (FailureDescription failure)
פרמטרים | |
---|---|
failure | FailureDescription |
הפניה נכשלה
public void invocationFailed (Throwable cause)
מדווח על הזמנה לא מלאה עקב מצב שגיאה כלשהו.
ייקרא אוטומטית על ידי מסגרת TradeFederation.
פרמטרים | |
---|---|
cause | Throwable : הגורם Throwable לכשל |
התראה התחילה
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 שנרשם קודם לכן ואמור להיות משויך למקרה הבדיקה. |
setUpdatedReporting
public void setUpdatedReporting (boolean updatedReporting)
מגדיר את הדיווח החדש.
פרמטרים | |
---|---|
updatedReporting | boolean |
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 : מזהה את הבדיקה |
testLog
public void testLog (String dataName, LogDataType dataType, InputStreamSource dataStream)
פרמטרים | |
---|---|
dataName | String |
dataType | LogDataType |
dataStream | InputStreamSource |
testLogSaved
public void testLogSaved (String dataName, LogDataType dataType, InputStreamSource dataStream, LogFile logFile)
פרמטרים | |
---|---|
dataName | String |
dataType | LogDataType |
dataStream | InputStreamSource |
logFile | LogFile |
testModuleEnded
public void testModuleEnded ()
מדווח על סיום הפעלת מודול.
testModuleStarted
public void testModuleStarted (IInvocationContext moduleContext)
מדווח על תחילת מודול פועל. התקשרות חוזרת זו משויכת ל- testModuleEnded()
והיא אופציונלית ברצף. הוא משמש רק במהלך ריצה המשתמשת במודולים: רצים מבוססי סוויטה.
פרמטרים | |
---|---|
moduleContext | IInvocationContext : IInvocationContext של המודול. |
testRunEnded
public void testRunEnded (long elapsedTime,runMetrics)
מדווח על סיום ריצת המבחן. FIXME: אין לנו שני ממשקי Map<> עם סוג שונה, אז עלינו להשתמש ב-HashMap כאן.
פרמטרים | |
---|---|
elapsedTime | 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 name, int testCount, int attemptNumber, long startTime)
מדווח על תחילת ריצת מבחן.
פרמטרים | |
---|---|
name | 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() |
שיטות מוגנות
getEventsLogs
protected File[] getEventsLogs ()
החזרות | |
---|---|
File[] |