ResultForwarder
public class ResultForwarder
extends Object
implements ITestInvocationListener
java.lang.Object | |
↳ | com.android.tradefed.result.ResultForwarder |
ITestInvocationListener
המעביר את תוצאות ההתקשרות לרשימה של מאזינים אחרים.
סיכום
בנאים ציבוריים | |
---|---|
ResultForwarder ( listeners) ResultForwarder ( listeners) צור | |
ResultForwarder ( ITestInvocationListener... listeners) בונה arg משתנה חלופי עבור |
קונסטרוקטורים מוגנים | |
---|---|
ResultForwarder () צור |
שיטות ציבוריות | |
---|---|
TestSummary | getSummary () מאפשר ל-InvocationListener להחזיר סיכום. |
void | invocationEnded (long elapsedTime) מדווח שהפנייה הסתיימה, בין אם בהצלחה ובין אם עקב מצב שגיאה כלשהו. |
void | invocationFailed ( FailureDescription failure) מדווח על הזמנה לא מלאה עקב מצב שגיאה כלשהו. |
void | invocationFailed (Throwable cause) מדווח על הזמנה לא מלאה עקב מצב שגיאה כלשהו. |
void | invocationSkipped ( SkipReason reason) מדווח על הזמנה כדילוג |
void | invocationStarted ( IInvocationContext context) מדווח על תחילת הפעלת הבדיקה. |
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 | testEnded ( TestDescription test, testMetrics) testEnded ( TestDescription test, 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 | 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 runName, int testCount, int attemptNumber) מדווח על תחילת ריצת מבחן. |
void | testRunStarted (String runName, int testCount) מדווח על תחילת ריצת מבחן. |
void | testRunStarted (String runName, int testCount, int attemptNumber, long startTime) מדווח על תחילת ריצת מבחן. |
void | testRunStopped (long elapsedTime) הפעלת בדיקת הדוחות הופסקה לפני השלמתה עקב בקשת משתמש. |
void | testSkipped ( TestDescription test, SkipReason reason) נקרא כאשר מדלגים על בדיקה ולא בוצעה מסיבה שאינה צפויה בדרך כלל. |
void | testStarted ( TestDescription test, long startTime) חלופה ל- |
void | testStarted ( TestDescription test) מדווח על תחילת מקרה בדיקה בודד. |
שיטות מוגנות | |
---|---|
getListeners () קבלו את רשימת המאזינים. | |
void | setListeners ( ITestInvocationListener... listeners) הגדר את המאזינים לאחר הבנייה. |
void | setListeners ( listeners) setListeners ( listeners) הגדר את המאזינים לאחר הבנייה. |
בנאים ציבוריים
ResultForwarder
public ResultForwarder (listeners)
צור ResultForwarder
.
פרמטרים | |
---|---|
listeners | ITestInvocationListener האמיתי להעביר תוצאות אליהם |
ResultForwarder
public ResultForwarder (ITestInvocationListener... listeners)
בונה arg משתנה חלופי עבור ResultForwarder
.
פרמטרים | |
---|---|
listeners | ITestInvocationListener : ה- ITestInvocationListener האמיתי להעביר אליו תוצאות |
קונסטרוקטורים מוגנים
ResultForwarder
protected ResultForwarder ()
צור ResultForwarder
עם הגדרת מאזין דחוי. מיועד רק לשימוש על ידי תת מחלקות.
שיטות ציבוריות
getSummary
public TestSummary getSummary ()
מאפשר ל-InvocationListener להחזיר סיכום.
החזרות | |
---|---|
TestSummary | TestSummary המסכם את הריצה, או null |
הקריאה הסתיימה
public void invocationEnded (long elapsedTime)
מדווח שהפנייה הסתיימה, בין אם בהצלחה ובין אם עקב מצב שגיאה כלשהו.
ייקרא אוטומטית על ידי מסגרת TradeFederation.
פרמטרים | |
---|---|
elapsedTime | long : הזמן שחלף של הקריאה ב-ms |
הפניה נכשלה
public void invocationFailed (FailureDescription failure)
מדווח על הזמנה לא מלאה עקב מצב שגיאה כלשהו.
ייקרא אוטומטית על ידי מסגרת TradeFederation.
פרמטרים | |
---|---|
failure | FailureDescription : FailureDescription המתאר את הסיבה לכשל |
הפניה נכשלה
public void invocationFailed (Throwable cause)
מדווח על הזמנה לא מלאה עקב מצב שגיאה כלשהו.
ייקרא אוטומטית על ידי מסגרת TradeFederation.
פרמטרים | |
---|---|
cause | Throwable : הסיבה Throwable לזריקה לכשל |
הקריאה דילגה
public void invocationSkipped (SkipReason reason)
מדווח על הזמנה כדילוג
פרמטרים | |
---|---|
reason | SkipReason |
התראה התחילה
public void invocationStarted (IInvocationContext context)
מדווח על תחילת הפעלת הבדיקה.
ייקרא אוטומטית על ידי מסגרת TradeFederation. כתבים צריכים לעקוף שיטה זו כדי לתמוך בדיווח על מספר מכשירים.
פרמטרים | |
---|---|
context | IInvocationContext : מידע על הפנייה |
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 testEnded (TestDescription test,testMetrics)
מדווח על סיום הביצוע של מקרה בדיקה בודד.
אם testFailed(TestDescription, FailureDescription)
לא הופעל, מבחן זה עבר. מחזירה גם מדדי מפתח/ערך שייתכן שנפלטו במהלך ביצוע מקרה הבדיקה.
פרמטרים | |
---|---|
test | TestDescription : מזהה את הבדיקה |
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)
מספק את היומן המשויך או נתוני ניפוי באגים מקריאת הבדיקה.
יש לקרוא לפני ERROR(/ITestInvocationListener#invocationFailed(Throwable))
או ERROR(/ITestInvocationListener#invocationEnded(long))
המסגרת של TradeFederation תקרא אוטומטית לשיטה זו, תספק את יומן המארח ואם רלוונטי, את logcat המכשיר.
פרמטרים | |
---|---|
dataName | String : שם String של המחרוזת של הנתונים. למשל "device_logcat". הערה ייתכן ש-dataName אינו ייחודי לכל הזמנה. כלומר, המיישמים חייבים להיות מסוגלים לטפל במספר שיחות עם אותו dataName |
dataType | LogDataType : LogDataType של הנתונים |
dataStream | InputStreamSource : InputStreamSource של הנתונים. על המיישמים להתקשר ל-createInputStream כדי להתחיל לקרוא את הנתונים, ולהבטיח לסגור את ה-InputStream שהתקבל לאחר השלמתו. המתקשרים צריכים לוודא שמקור הנתונים נשאר קיים ונגיש עד להשלמת שיטת testLog. |
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 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() |
testRunStopped
public void testRunStopped (long elapsedTime)
הפעלת בדיקת הדוחות הופסקה לפני השלמתה עקב בקשת משתמש.
מטלה: לא בשימוש כרגע, שקול להסיר
פרמטרים | |
---|---|
elapsedTime | long : המכשיר דיווח על זמן שחלף, באלפיות שניות |
דילוג על הבדיקה
public void testSkipped (TestDescription test, SkipReason reason)
נקרא כאשר מדלגים על בדיקה ולא בוצעה מסיבה שאינה צפויה בדרך כלל. בדיקות אלו ינוסו לנסות שוב כדי לנסות לבצע ביצוע תקין.
פרמטרים | |
---|---|
test | TestDescription : מזהה את הבדיקה |
reason | SkipReason : SkipReason |
הבדיקה התחילה
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() |
הבדיקה התחילה
public void testStarted (TestDescription test)
מדווח על תחילת מקרה בדיקה בודד. ממשק ישן יותר, צריך להשתמש testStarted(com.android.tradefed.result.TestDescription)
במידת האפשר.
פרמטרים | |
---|---|
test | TestDescription : מזהה את הבדיקה |
שיטות מוגנות
getListeners
protectedgetListeners ()
קבלו את רשימת המאזינים. מיועד רק לשימוש על ידי תת מחלקות.
החזרות | |
---|---|
הרשימה של ITestInvocationListener s. |
setListeners
protected void setListeners (ITestInvocationListener... listeners)
הגדר את המאזינים לאחר הבנייה. מיועד רק לשימוש על ידי תת מחלקות.
פרמטרים | |
---|---|
listeners | ITestInvocationListener : ה- ITestInvocationListener האמיתי להעביר אליו תוצאות |
setListeners
protected void setListeners (listeners)
הגדר את המאזינים לאחר הבנייה. מיועד רק לשימוש על ידי תת מחלקות.
פרמטרים | |
---|---|
listeners | ITestInvocationListener האמיתי להעביר תוצאות אליהם |