ResultAggregator

public class ResultAggregator
extends CollectingTestListener

java.lang.Object
   ↳ com.android.tradefed.result.CollectingTestListener
     ↳ com.android.tradefed.retry.ResultAggregator


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

סיכום

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

ResultAggregator( listeners, RetryStrategy strategy)

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

void cleanEventsFiles()
final void forwardAggregatedInvocationLogs()

להעביר את כל היומנים ברמת ההפעלה לכלי הדיווח על תוצאות שלא תומכים בתוצאות המפורטות.

void invocationEnded(long elapsedTime)

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

void invocationFailed(FailureDescription failure)

void invocationFailed(Throwable cause)

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

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 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)

חלופה ל-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 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)

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

void testRunFailed(FailureDescription failure)

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

void testRunFailed(String errorMessage)

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

void testRunStarted(String name, 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)) למדידה מדויקת.

שיטות מוגנות

File[] getEventsLogs()

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

ResultAggregator

public ResultAggregator ( listeners, 
                RetryStrategy strategy)

פרמטרים
listeners

strategy RetryStrategy

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

cleanEventsFiles

public void cleanEventsFiles ()

forwardAggregatedInvocationLogs

public final void forwardAggregatedInvocationLogs ()

להעביר את כל היומנים ברמת ההפעלה לכלי הדיווח על תוצאות שלא תומכים בתוצאות המפורטות.

invocationEnded

public void invocationEnded (long elapsedTime)

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

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

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

invocationFailed

public void invocationFailed (FailureDescription failure)

פרמטרים
failure FailureDescription

invocationFailed

public void invocationFailed (Throwable cause)

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

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

פרמטרים
cause Throwable: Throwable הסיבה לכישלון

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

setLogSaver

public void setLogSaver (ILogSaver logSaver)

פרמטרים
logSaver ILogSaver

setUpdatedReporting

public void setUpdatedReporting (boolean updatedReporting)

הגדרת הדיווח החדש.

פרמטרים
updatedReporting boolean

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: מזהה את הבדיקה

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)

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

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

testRunEnded

public void testRunEnded (long elapsedTime, 
                 runMetrics)

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

פרמטרים
elapsedTime 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 name, 
                int testCount, 
                int attemptNumber, 
                long startTime)

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

פרמטרים
name 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()

שיטות מוגנות

getEventsLogs

protected File[] getEventsLogs ()

החזרות
File[]