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 () החזר את המידע הלבן העיקרי נמסר באמצעות |
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, 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) |
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 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()
.
מחזירה את פרטי הבנייה.
החזרות | |
---|---|
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 ()
החזר את המידע הלבן העיקרי נמסר באמצעות invocationStarted(com.android.tradefed.invoker.IInvocationContext)
. ה build העיקרי הוא המבנה שהוחזר על ידי ספק הבנייה הראשון של תצורת הריצה. מחזירה null אם אין הקשר (אין מקרה לבנייה לבדיקה).
החזרות | |
---|---|
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 |
invocation נכשל
public void invocationFailed (Throwable cause)
פרמטרים | |
---|---|
cause | Throwable |
invocationStarted
public void invocationStarted (IInvocationContext context)
פרמטרים | |
---|---|
context | IInvocationContext |
אגודה log
public void logAssociation (String dataName, LogFile logFile)
פרמטרים | |
---|---|
dataName | String |
logFile | LogFile |
setBuildInfo
public void setBuildInfo (IBuildInfo buildInfo)
שיטה זו הופסקה.
כבר לא נחוץ לבדיקה.
הגדר את פרטי הבנייה. יש להשתמש רק לבדיקה.
פרמטרים | |
---|---|
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 |
מבחן נכשל
public void testFailed (TestDescription test, FailureDescription failure)
פרמטרים | |
---|---|
test | TestDescription |
failure | FailureDescription |
מבחן נכשל
public void testFailed (TestDescription test, String trace)
פרמטרים | |
---|---|
test | TestDescription |
trace | String |
מבחן התעלם
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 |
testRun עצר
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 |