ModuleListener
public class ModuleListener
extends CollectingTestListener
java.lang.Object | ||
↳ | com.android.tradefed.result.CollectingTestListener | |
↳ | com.android.tradefed.testtype.suite.ModuleListener |
מאזין מצורף לכל IRemoteTest
של כל מודול על מנת לאסוף את רשימת התוצאות.
סיכום
בנאים ציבוריים | |
---|---|
ModuleListener ( ITestInvocationListener listener, IInvocationContext moduleContext) בַּנַאִי. |
שיטות ציבוריות | |
---|---|
boolean | hasLastAttemptFailed () מחזירה אם הפעלת הניסיון החוזר האחרון של המאזין נכשל או לא. |
void | logAssociation (String dataName, LogFile logFile) במקרים מסוימים, יומן חייב להיות משויך מאוד למקרי בדיקה, אך ההזדמנות לעשות זאת ב- |
void | setAttemptIsolation ( CurrentInvocation.IsolationGrade isolation) קובע אם יש לדווח על הניסיון כמבודד או לא. |
void | setCollectTestsOnly (boolean collectTestsOnly) קובע אם אנחנו אוספים רק את הבדיקות או לא. |
void | setMarkTestsSkipped (boolean skip) האם לסמן את כל מקרי המבחן שדילג או לא. |
void | setTestMappingSources ( testMappingSources) setTestMappingSources ( testMappingSources) מגדיר מקורות מיפוי בדיקה שיווספו למדדים. |
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 | testLogSaved (String dataName, LogDataType dataType, InputStreamSource dataStream, LogFile logFile) |
void | testRunEnded (long elapsedTime, runMetrics) testRunEnded (long elapsedTime, runMetrics) מדווח על סיום ריצת המבחן. |
void | testRunFailed ( FailureDescription failure) ריצת בדיקת הדוחות לא הושלמה עקב כשל המתואר על ידי |
void | testRunFailed (String errorMessage) ריצת בדיקת הדוחות לא הושלמה עקב שגיאה קטלנית. |
void | testRunStarted (String name, int numTests, int attemptNumber) מדווח על תחילת ריצת מבחן. |
void | testRunStarted (String name, int numTests, int attemptNumber, long startTime) מדווח על תחילת ריצת מבחן. |
void | testSkipped ( TestDescription test, SkipReason reason) נקרא כאשר מדלגים על בדיקה ולא בוצעה מסיבה שאינה צפויה בדרך כלל. |
void | testStarted ( TestDescription test, long startTime) חלופה ל- |
בנאים ציבוריים
ModuleListener
public ModuleListener (ITestInvocationListener listener, IInvocationContext moduleContext)
בַּנַאִי.
פרמטרים | |
---|---|
listener | ITestInvocationListener |
moduleContext | IInvocationContext |
שיטות ציבוריות
hasLastAttemptFailed
public boolean hasLastAttemptFailed ()
מחזירה אם הפעלת הניסיון החוזר האחרון של המאזין נכשל או לא.
החזרות | |
---|---|
boolean |
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 שנרשם קודם לכן ואמור להיות משויך למקרה הבדיקה. |
setAttemptIsolation
public void setAttemptIsolation (CurrentInvocation.IsolationGrade isolation)
קובע אם יש לדווח על הניסיון כמבודד או לא.
פרמטרים | |
---|---|
isolation | CurrentInvocation.IsolationGrade |
setCollectTestsOnly
public void setCollectTestsOnly (boolean collectTestsOnly)
קובע אם אנחנו אוספים רק את הבדיקות או לא.
פרמטרים | |
---|---|
collectTestsOnly | boolean |
setMarkTestsSkipped
public void setMarkTestsSkipped (boolean skip)
האם לסמן את כל מקרי המבחן שדילג או לא.
פרמטרים | |
---|---|
skip | boolean |
setTestMappingSources
public void setTestMappingSources (testMappingSources)
מגדיר מקורות מיפוי בדיקה שיווספו למדדים.
פרמטרים | |
---|---|
testMappingSources |
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)
פרמטרים | |
---|---|
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 |
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 numTests, int attemptNumber)
מדווח על תחילת ריצת מבחן.
פרמטרים | |
---|---|
name | String : שם ריצת המבחן |
numTests | int : המספר הכולל של בדיקות בריצת מבחן |
attemptNumber | int : מספר הזמנה, מזהה את הניסיונות השונים של אותו runName הפועלים מספר פעמים. ה-probyNumber הוא 0 באינדקס ואמור לעלות בכל פעם שמתרחשת ריצה חדשה. לדוגמה, בדיקה מפורטת חוזרת 3 פעמים, היא צריכה לכלול 4 ריצות בסך הכל תחת אותו runName וה-probationNumber הוא מ-0 עד 3. |
testRunStarted
public void testRunStarted (String name, int numTests, int attemptNumber, long startTime)
מדווח על תחילת ריצת מבחן.
פרמטרים | |
---|---|
name | String : שם ריצת המבחן |
numTests | int : המספר הכולל של בדיקות בריצת מבחן |
attemptNumber | int : מספר הזמנה, מזהה את הניסיונות השונים של אותו runName הפועלים מספר פעמים. ה-probyNumber הוא 0 באינדקס ואמור לעלות בכל פעם שמתרחשת ריצה חדשה. לדוגמה, בדיקה מפורטת חוזרת 3 פעמים, היא צריכה לכלול 4 ריצות בסך הכל תחת אותו runName וה-probationNumber הוא מ-0 עד 3. |
startTime | long : הזמן שבו התחילה הריצה, נמדד באמצעות System.currentTimeMillis() |
דילוג על הבדיקה
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() |