CollectingTestListener
public
class
CollectingTestListener
extends Object
implements
ITestInvocationListener,
ILogSaverListener
java.lang.Object | |
↳ | com.android.tradefed.result.CollectingTestListener |
ITestInvocationListener
שיאסוף את כל תוצאות הבדיקה.
אמנם מבני הנתונים שבהם נעשה שימוש באובייקט הזה בטוחים לשרשור, אבל צריך להפעיל את הפונקציות החוזרות של ITestInvocationListener
בסדר הנכון.
סיכום
קונסטרוקטורים גלויים לכולם | |
---|---|
CollectingTestListener()
|
שיטות ציבוריות | |
---|---|
IBuildInfo
|
getBuildInfo()
השיטה הזו הוצאה משימוש.
להסתמך על |
TestRunResult
|
getCurrentRunResults()
הפונקציה מקבלת את התוצאות של הריצ'ה הנוכחית של הבדיקה. |
int
|
getExpectedTests()
הפונקציה מחזירה את מספר הבדיקות הצפויות. |
IInvocationContext
|
getInvocationContext()
החזרת הקשר ההפעלה שדווח דרך |
|
getMergedTestRunResults()
החזרת האוסף הממוזג של התוצאות מכל ההרצות בניסיונות שונים. |
IInvocationContext
|
getModuleContextForRunResult(String testRunName)
הפונקציה מחזירה את הערך של |
MultiMap<String, LogFile>
|
getModuleLogFiles()
הפונקציה מחזירה עותק של המפה שמכילה את כל הקבצים ביומן שמשויכים למודול. |
MultiMap<String, LogFile>
|
getNonAssociatedLogFiles()
הפונקציה מחזירה עותק של המפה שמכיל את כל הקבצים ביומן שלא משויכים להרצת בדיקה או למודול. |
int
|
getNumAllFailedTestRuns()
הפונקציה מחזירה את המספר הכולל של הפעלות הבדיקה במצב כשל |
int
|
getNumAllFailedTests()
הפונקציה מחזירה את המספר הכולל של בדיקות שנכשלו (רק בדיקות שנכשלו, כישלונות של הנחות לא נספרים). |
int
|
getNumTestsInState(TestResult.TestStatus status)
הפונקציה מחזירה את מספר הבדיקות במצב נתון להרצה הזו. |
int
|
getNumTotalTests()
הפונקציה מחזירה את המספר הכולל של הבדיקות שהושלמו בכל ההרצות. |
IBuildInfo
|
getPrimaryBuildInfo()
הפונקציה מחזירה את פרטי ה-build הראשיים שדווחו באמצעות |
|
getRunResults()
השיטה הזו הוצאה משימוש.
שימוש ב- |
TestRunResult
|
getTestRunAtAttempt(String testRunName, int attempt)
מחזירים את |
int
|
getTestRunAttemptCount(String testRunName)
הפונקציה מחזירה את מספר הניסיונות של הרצה נתונה של בדיקה. |
|
getTestRunAttempts(String testRunName)
הפונקציה מקבלת את כל הניסיונות של |
|
getTestRunForAttempts(int attempt)
הפונקציה מקבלת את כל התוצאות של ניסיון נתון. |
|
getTestRunNames()
החזרת כל השמות של כל הרצות הבדיקה. |
boolean
|
hasFailedTests()
הפונקציה מחזירה אם בקריאה היו בדיקות שנכשלו או הנחות שנכשלו. |
boolean
|
hasTestRunResultsForName(String testRunName)
הפונקציה מחזירה תשובה אם יש תוצאות בשם של הרצה נתונה של בדיקה. |
void
|
invocationEnded(long elapsedTime)
|
void
|
invocationFailed(Throwable cause)
|
void
|
invocationStarted(IInvocationContext context)
|
void
|
logAssociation(String dataName, LogFile logFile)
|
void
|
setBuildInfo(IBuildInfo buildInfo)
השיטה הזו הוצאה משימוש. אין יותר צורך בבדיקה. |
void
|
setMergeStrategy(MergeStrategy strategy)
הגדרת |
void
|
testAssumptionFailure(TestDescription test, String trace)
|
void
|
testAssumptionFailure(TestDescription test, FailureDescription failure)
|
void
|
testEnded(TestDescription test, long endTime,
|
void
|
testEnded(TestDescription test,
|
void
|
testFailed(TestDescription test, FailureDescription failure)
|
void
|
testFailed(TestDescription test, String trace)
|
void
|
testIgnored(TestDescription test)
|
void
|
testModuleEnded()
|
void
|
testModuleStarted(IInvocationContext moduleContext)
|
void
|
testRunEnded(long elapsedTime,
|
void
|
testRunFailed(FailureDescription failure)
|
void
|
testRunFailed(String errorMessage)
|
void
|
testRunStarted(String name, int numTests, int attemptNumber)
|
void
|
testRunStarted(String name, int numTests)
|
void
|
testRunStarted(String name, int numTests, int attemptNumber, long startTime)
|
void
|
testRunStopped(long elapsedTime)
|
void
|
testStarted(TestDescription test, long startTime)
|
void
|
testStarted(TestDescription test)
|
שיטות מוגנות | |
---|---|
final
void
|
clearModuleLogFiles()
מאפשרת לנקות את קובץ המודול כדי שלא נשא אותם יותר מדי זמן. |
final
void
|
clearResultsForName(String testRunName)
מאפשרת לנקות את התוצאות של שם הרצה נתון. |
void
|
setIsAggregrateMetrics(boolean aggregate)
מפעילים או משביתים את האפשרות 'מדדים מצטברים'. |
קונסטרוקטורים גלויים לכולם
CollectingTestListener
public CollectingTestListener ()
שיטות ציבוריות
getBuildInfo
public IBuildInfo getBuildInfo ()
השיטה הזו הוצאה משימוש.
סומכים על IBuildInfo
מ-getInvocationContext()
.
הפונקציה מחזירה את פרטי ה-build.
החזרות | |
---|---|
IBuildInfo |
getCurrentRunResults
public TestRunResult getCurrentRunResults ()
הפונקציה מקבלת את התוצאות של הריצ'ה הנוכחית של הבדיקה.
שימו לב שהתוצאות עשויות להיות חלקיות. מומלץ לבדוק את הערך של TestRunResult.isRunComplete()
ו/או את הערך של (@link TestRunResult#isRunFailure()} בהתאם, לפני עיבוד התוצאות.
החזרות | |
---|---|
TestRunResult |
TestRunResult שמייצג נתונים שנאספו במהלך ההרצה האחרונה של הבדיקה
|
getExpectedTests
public int getExpectedTests ()
הפונקציה מחזירה את מספר הבדיקות הצפויות. יכול להיות שהערך יהיה שונה מ-getNumTotalTests()
אם חלק מהבדיקות לא הופעלו.
החזרות | |
---|---|
int |
getInvocationContext
public IInvocationContext getInvocationContext ()
החזרת הקשר ההפעלה שדווח דרך invocationStarted(com.android.tradefed.invoker.IInvocationContext)
החזרות | |
---|---|
IInvocationContext |
getMergedTestRunResults
publicgetMergedTestRunResults ()
החזרת האוסף הממוזג של התוצאות מכל ההרצות בניסיונות שונים.
אם יש כמה תוצאות, כל הרצות הבדיקה מוזגו, ותוצאת הבדיקה האחרונה מחליפה את תוצאות הבדיקה של ההרצות הקודמות. הרצות הבדיקה ממוינות לפי מספר הניסיון.
המדדים של אותה ניסיון ימוזגו על סמך ההעדפה שהוגדרה ב-aggregate-metrics
. המדדים הסופיים יהיו המדדים מהניסיון האחרון.
החזרות | |
---|---|
|
getModuleContextForRunResult
public IInvocationContext getModuleContextForRunResult (String testRunName)
הפונקציה מחזירה את הערך של IInvocationContext
של המודול שמשויך לתוצאות.
פרמטרים | |
---|---|
testRunName |
String : השם שצוין על ידי {testRunStarted(String, int) . |
החזרות | |
---|---|
IInvocationContext |
IInvocationContext של המודול לשם נתון של הרצה של בדיקה null
אם אין תוצאות לשם הזה.
|
getModuleLogFiles
public MultiMap<String, LogFile> getModuleLogFiles ()
הפונקציה מחזירה עותק של המפה שמכילה את כל הקבצים ביומן שמשויכים למודול.
החזרות | |
---|---|
MultiMap<String, LogFile> |
getNonAssociatedLogFiles
public MultiMap<String, LogFile> getNonAssociatedLogFiles ()
הפונקציה מחזירה עותק של המפה שמכיל את כל הקבצים ביומן שלא משויכים להרצת בדיקה או למודול.
החזרות | |
---|---|
MultiMap<String, LogFile> |
getNumAllFailedTestRuns
public int getNumAllFailedTestRuns ()
הפונקציה מחזירה את המספר הכולל של הפעלות הבדיקה במצב כשל
החזרות | |
---|---|
int |
getNumAllFailedTests
public int getNumAllFailedTests ()
הפונקציה מחזירה את המספר הכולל של בדיקות שנכשלו (רק בדיקות שנכשלו, כישלונות של הנחות לא נספרים).
החזרות | |
---|---|
int |
getNumTestsInState
public int getNumTestsInState (TestResult.TestStatus status)
הפונקציה מחזירה את מספר הבדיקות במצב נתון להרצה הזו.
פרמטרים | |
---|---|
status |
TestResult.TestStatus |
החזרות | |
---|---|
int |
getNumTotalTests
public int getNumTotalTests ()
הפונקציה מחזירה את המספר הכולל של הבדיקות שהושלמו בכל ההרצות.
החזרות | |
---|---|
int |
getPrimaryBuildInfo
public IBuildInfo getPrimaryBuildInfo ()
הפונקציה מחזירה את פרטי ה-build הראשיים שדווחו באמצעות invocationStarted(com.android.tradefed.invoker.IInvocationContext)
. ה-build הראשי הוא ה-build שמוחזר על ידי ספק ה-build הראשון של התצורה שפועלת. הפונקציה מחזירה ערך null אם אין הקשר (אין build ל-test case).
החזרות | |
---|---|
IBuildInfo |
getRunResults
publicgetRunResults ()
השיטה הזו הוצאה משימוש.
שימוש ב-getMergedTestRunResults()
הפונקציה מחזירה את התוצאות של כל הרצות הבדיקה.
החזרות | |
---|---|
|
getTestRunAtAttempt
public TestRunResult getTestRunAtAttempt (String testRunName, int attempt)
מחזירים את TestRunResult
לניסיון יחיד.
פרמטרים | |
---|---|
testRunName |
String : השם שצוין על ידי {testRunStarted(String, int) . |
attempt |
int : מזהה הניסיון. |
החזרות | |
---|---|
TestRunResult |
הערך של TestRunResult בשם ובמזהה הניסיון שצוינו, או הערך null אם הוא לא קיים.
|
getTestRunAttemptCount
public int getTestRunAttemptCount (String testRunName)
הפונקציה מחזירה את מספר הניסיונות של הרצה נתונה של בדיקה.
פרמטרים | |
---|---|
testRunName |
String : השם שצוין על ידי {testRunStarted(String, int) .
|
החזרות | |
---|---|
int |
getTestRunAttempts
publicgetTestRunAttempts (String testRunName)
הפונקציה מקבלת את כל הניסיונות של TestRunResult
של הרצה נתונה של הבדיקה.
פרמטרים | |
---|---|
testRunName |
String : השם שצוין על ידי {testRunStarted(String, int) . |
החזרות | |
---|---|
|
כל TestRunResult של הרצה נתונה של הבדיקה, לפי סדר הניסיונות.
|
getTestRunForAttempts
publicgetTestRunForAttempts (int attempt)
הפונקציה מקבלת את כל התוצאות של ניסיון נתון.
פרמטרים | |
---|---|
attempt |
int : הניסיון שעבורו רוצים לקבל תוצאות. |
החזרות | |
---|---|
|
כל TestRunResult בניסיון נתון.
|
getTestRunNames
publicgetTestRunNames ()
החזרת כל השמות של כל הרצות הבדיקה.
יכול להיות שהרצות הבדיקה האלה בוצעו כמה פעמים עם ניסיונות שונים.
החזרות | |
---|---|
|
hasFailedTests
public boolean hasFailedTests ()
הפונקציה מחזירה אם בקריאה היו בדיקות שנכשלו או הנחות שנכשלו.
החזרות | |
---|---|
boolean |
hasTestRunResultsForName
public boolean hasTestRunResultsForName (String testRunName)
הפונקציה מחזירה תשובה אם יש תוצאות בשם של הרצה נתונה של בדיקה.
פרמטרים | |
---|---|
testRunName |
String : השם שצוין על ידי {testRunStarted(String, int) .
|
החזרות | |
---|---|
boolean |
invocationEnded
public void invocationEnded (long elapsedTime)
פרמטרים | |
---|---|
elapsedTime |
long |
invocationFailed
public void invocationFailed (Throwable cause)
פרמטרים | |
---|---|
cause |
Throwable |
invocationStarted
public void invocationStarted (IInvocationContext context)
פרמטרים | |
---|---|
context |
IInvocationContext |
logAssociation
public void logAssociation (String dataName, LogFile logFile)
פרמטרים | |
---|---|
dataName |
String |
logFile |
LogFile |
setBuildInfo
public void setBuildInfo (IBuildInfo buildInfo)
השיטה הזו הוצאה משימוש.
כבר לא נחוץ לבדיקה.
הגדרת פרטי ה-build. יש להשתמש בה רק לצורכי בדיקה.
פרמטרים | |
---|---|
buildInfo |
IBuildInfo |
setMergeStrategy
public void setMergeStrategy (MergeStrategy strategy)
הגדרת MergeStrategy
לשימוש במיזוג התוצאות.
פרמטרים | |
---|---|
strategy |
MergeStrategy |
testAssumptionFailure
public void testAssumptionFailure (TestDescription test, String trace)
פרמטרים | |
---|---|
test |
TestDescription |
trace |
String |
testAssumptionFailure
public void testAssumptionFailure (TestDescription test, FailureDescription failure)
פרמטרים | |
---|---|
test |
TestDescription |
failure |
FailureDescription |
testEnded
public void testEnded (TestDescription test, long endTime,testMetrics)
פרמטרים | |
---|---|
test |
TestDescription |
endTime |
long |
testMetrics |
|
testEnded
public void testEnded (TestDescription test,testMetrics)
פרמטרים | |
---|---|
test |
TestDescription |
testMetrics |
|
testFailed
public void testFailed (TestDescription test, FailureDescription failure)
פרמטרים | |
---|---|
test |
TestDescription |
failure |
FailureDescription |
testFailed
public void testFailed (TestDescription test, String trace)
פרמטרים | |
---|---|
test |
TestDescription |
trace |
String |
testIgnored
public void testIgnored (TestDescription test)
פרמטרים | |
---|---|
test |
TestDescription |
testModuleEnded
public void testModuleEnded ()
testModuleStarted
public void testModuleStarted (IInvocationContext moduleContext)
פרמטרים | |
---|---|
moduleContext |
IInvocationContext |
testRunEnded
public void testRunEnded (long elapsedTime,runMetrics)
פרמטרים | |
---|---|
elapsedTime |
long |
runMetrics |
|
testRunFailed
public void testRunFailed (FailureDescription failure)
פרמטרים | |
---|---|
failure |
FailureDescription |
testRunFailed
public void testRunFailed (String errorMessage)
פרמטרים | |
---|---|
errorMessage |
String |
testRunStarted
public void testRunStarted (String name, int numTests, int attemptNumber)
פרמטרים | |
---|---|
name |
String |
numTests |
int |
attemptNumber |
int |
testRunStarted
public void testRunStarted (String name, int numTests)
פרמטרים | |
---|---|
name |
String |
numTests |
int |
testRunStarted
public void testRunStarted (String name, int numTests, int attemptNumber, long startTime)
פרמטרים | |
---|---|
name |
String |
numTests |
int |
attemptNumber |
int |
startTime |
long |
testRunStopped
public void testRunStopped (long elapsedTime)
פרמטרים | |
---|---|
elapsedTime |
long |
testStarted
public void testStarted (TestDescription test, long startTime)
פרמטרים | |
---|---|
test |
TestDescription |
startTime |
long |
testStarted
public void testStarted (TestDescription test)
פרמטרים | |
---|---|
test |
TestDescription |
שיטות מוגנות
clearModuleLogFiles
protected final void clearModuleLogFiles ()
מאפשרת לנקות את קובץ המודול כדי שלא נשא אותם יותר מדי זמן.
clearResultsForName
protected final void clearResultsForName (String testRunName)
מאפשרת לנקות את התוצאות של שם הרצה נתון. צריך להשתמש בה רק במקרים מסוימים, כמו במאגר של התוצאות.
פרמטרים | |
---|---|
testRunName |
String |
setIsAggregrateMetrics
protected void setIsAggregrateMetrics (boolean aggregate)
מפעילים או משביתים את האפשרות 'מדדים מצטברים'.
פרמטרים | |
---|---|
aggregate |
boolean |