BaseDeviceMetricCollector

public class BaseDeviceMetricCollector
extends Object implements IMetricCollector

java.lang.Object
   ↳ com.android.tradefed.device.metric.BaseDeviceMetricCollector


הטמעה בסיסית של IMetricCollector שמאפשרת להתחיל ולהפסיק את האיסוף ב-onTestRunStart(com.android.tradefed.device.metric.DeviceMetricData) וב-ERROR(/#onTestRunEnd(com.android.tradefed.device.metric.DeviceMetricData,Map)).

סיכום

שדות

public static final String TEST_CASE_EXCLUDE_GROUP_OPTION

public static final String TEST_CASE_INCLUDE_GROUP_OPTION

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

BaseDeviceMetricCollector()

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

final getBuildInfos()

הפונקציה מחזירה את רשימת פרטי ה-build שזמינים בקריאה.

final getDevices()

הפונקציה מחזירה את רשימת המכשירים שזמינים בקריאה.

File getFileFromTestArtifacts(String fileName)

אחזור הקובץ מהארטיפקטים של הבדיקה או מהארטיפקטים של המודול ושמירתו במטמון במפה לשיחות הבאות.

final ITestInvocationListener getInvocationListener()

הפונקציה מחזירה את ITestInvocationListener המקורי שאליו אנחנו מעבירים את התוצאות.

final getRealDevices()

הפונקציה מחזירה את כל המכשירים שאינם stubs מהרשימה getDevices().

String getRunName()

הפונקציה מחזירה את השם של הרצה של הבדיקה mRunName שמפעילה את האוסף.

ITestInvocationListener init(IInvocationContext context, ITestInvocationListener listener)

אתחול האוסף עם ההקשר הנוכחי ואיפה להעביר את התוצאות.

final void invocationEnded(long elapsedTime)
final void invocationFailed(FailureDescription failure)
final void invocationFailed(Throwable cause)
final void invocationStarted(IInvocationContext context)

Listeners להפעלה להעברה

final boolean isDisabled()

הפונקציה מחזירה את הערך True אם האובייקט כולו מושבת (מחמיצים את ההגדרה וההסרה).

final void logAssociation(String dataName, LogFile logFile)

אין להשתמש בתוך הטמעת האוסף של המדדים.

void onTestAssumptionFailure(DeviceMetricData testData, TestDescription test)

קריאה חוזרת (callback) כשתרגיל בדיקה נכשל בגלל כישלון של הנחת יסוד.

void onTestEnd(DeviceMetricData testData, currentTestCaseMetrics, TestDescription test)

קריאה חוזרת (call back) בסיום בדיקת מקרה.

void onTestEnd(DeviceMetricData testData, currentTestCaseMetrics)

קריאה חוזרת (call back) בסיום בדיקת מקרה.

void onTestFail(DeviceMetricData testData, TestDescription test)

קריאה חוזרת (callback) כשמקרה בדיקה נכשל.

void onTestRunEnd(DeviceMetricData runData, currentRunMetrics)

קריאה חוזרת (call back) בסיום הרצה של בדיקה.

void onTestRunFailed(DeviceMetricData testData, FailureDescription failure)
void onTestRunStart(DeviceMetricData runData)

קריאה חוזרת (callback) כשהרצת הבדיקה מתחילה.

void onTestStart(DeviceMetricData testData)

קריאה חוזרת (callback) כשמקרה בדיקה מתחיל.

final void setDisable(boolean isDisabled)

מגדיר אם האובייקט יושבת.

final void setLogSaver(ILogSaver logSaver)

אין להשתמש בתוך הטמעת האוסף של המדדים.

final void testAssumptionFailure(TestDescription test, String trace)
final void testAssumptionFailure(TestDescription test, FailureDescription failure)
final void testEnded(TestDescription test, long endTime, testMetrics)
final void testEnded(TestDescription test, testMetrics)
final void testFailed(TestDescription test, FailureDescription failure)
final void testFailed(TestDescription test, String trace)
final void testIgnored(TestDescription test)
final void testLog(String dataName, LogDataType dataType, InputStreamSource dataStream)
final void testLogSaved(String dataName, LogDataType dataType, InputStreamSource dataStream, LogFile logFile)

אין להשתמש בתוך הטמעת האוסף של המדדים.

final void testModuleEnded()
final void testModuleStarted(IInvocationContext moduleContext)
final void testRunEnded(long elapsedTime, runMetrics)
final void testRunFailed(FailureDescription failure)
final void testRunFailed(String errorMessage)
final void testRunStarted(String runName, int testCount, int attemptNumber)
final void testRunStarted(String runName, int testCount)

בדיקה של קריאות חזרה (callbacks) להרצה

final void testRunStarted(String runName, int testCount, int attemptNumber, long startTime)
final void testRunStopped(long elapsedTime)
final void testStarted(TestDescription test, long startTime)
final void testStarted(TestDescription test)

קריאות חזרה למקרי בדיקה

שדות

TEST_CASE_EXCLUDE_GROUP_OPTION

public static final String TEST_CASE_EXCLUDE_GROUP_OPTION

TEST_CASE_INCLUDE_GROUP_OPTION

public static final String TEST_CASE_INCLUDE_GROUP_OPTION

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

BaseDeviceMetricCollector

public BaseDeviceMetricCollector ()

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

getBuildInfos

public final  getBuildInfos ()

הפונקציה מחזירה את רשימת פרטי ה-build שזמינים בקריאה.

החזרות

getDevices

public final  getDevices ()

הפונקציה מחזירה את רשימת המכשירים שזמינים בקריאה.

החזרות

getFileFromTestArtifacts

public File getFileFromTestArtifacts (String fileName)

אחזור הקובץ מהארטיפקטים של הבדיקה או מהארטיפקטים של המודול ושמירתו במטמון במפה לשיחות הבאות.

פרמטרים
fileName String: שם הקובץ לחיפוש בפריטים.

החזרות
File קובץ מהארטיפקט של הבדיקה או מהארטיפקט של המודול. הפונקציה מחזירה ערך null אם הקובץ לא נמצא.

getInvocationListener

public final ITestInvocationListener getInvocationListener ()

הפונקציה מחזירה את ITestInvocationListener המקורי שאליו אנחנו מעבירים את התוצאות.

החזרות
ITestInvocationListener

getRealDevices

public final  getRealDevices ()

הפונקציה מחזירה את כל המכשירים שאינם stubs מהרשימה getDevices().

החזרות

getRunName

public String getRunName ()

הפונקציה מחזירה את השם של הרצה של הבדיקה mRunName שמפעילה את האוסף.

החזרות
String mRunName, השם הנוכחי של הרצה של הבדיקה.

init

public ITestInvocationListener init (IInvocationContext context, 
                ITestInvocationListener listener)

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

אל תשנו את ההגדרות אלא אם אתם יודעים מה אתם עושים.

פרמטרים
context IInvocationContext: ה-IInvocationContext של הקריאה הנוכחית.

listener ITestInvocationListener: ה-ITestInvocationListener שבו צריך להציב את התוצאות.

החזרות
ITestInvocationListener המאזין החדש עוטף את המאזין המקורי.

invocationEnded

public final void invocationEnded (long elapsedTime)

פרמטרים
elapsedTime long

invocationFailed

public final void invocationFailed (FailureDescription failure)

פרמטרים
failure FailureDescription

invocationFailed

public final void invocationFailed (Throwable cause)

פרמטרים
cause Throwable

invocationStarted

public final void invocationStarted (IInvocationContext context)

Listeners להפעלה להעברה

פרמטרים
context IInvocationContext

isDisabled

public final boolean isDisabled ()

הפונקציה מחזירה את הערך True אם האובייקט כולו מושבת (מחמיצים את ההגדרה וההסרה). אחרת, הערך יהיה false.

החזרות
boolean

logAssociation

public final void logAssociation (String dataName, 
                LogFile logFile)

אין להשתמש בתוך הטמעת האוסף של המדדים. זוהי העברה טהורה.

פרמטרים
dataName String

logFile LogFile

onTestAssumptionFailure

public void onTestAssumptionFailure (DeviceMetricData testData, 
                TestDescription test)

קריאה חוזרת (callback) כשתרגיל בדיקה נכשל בגלל כישלון של הנחת יסוד.

פרמטרים
testData DeviceMetricData: ה-DeviceMetricData שמכיל את הנתונים של תרחיש הבדיקה.

test TestDescription: ה-TestDescription של מקרה הבדיקה הפעיל.

onTestEnd

public void onTestEnd (DeviceMetricData testData, 
                 currentTestCaseMetrics, 
                TestDescription test)

קריאה חוזרת (call back) בסיום בדיקת מקרה. זה הזמן לנקות.

פרמטרים
testData DeviceMetricData: ה-DeviceMetricData שמכיל את הנתונים של תרחיש הבדיקה. יהיה אותו אובייקט כמו במהלך onTestStart(com.android.tradefed.device.metric.DeviceMetricData).

currentTestCaseMetrics : המפה הנוכחית של המדדים שהועברו אל ITestLifeCycleReceiver.testEnded(com.android.tradefed.result.TestDescription, Map).

test TestDescription: ה-TestDescription של מקרה הבדיקה הפעיל.

onTestEnd

public void onTestEnd (DeviceMetricData testData, 
                 currentTestCaseMetrics)

קריאה חוזרת (call back) בסיום בדיקת מקרה. זה הזמן לנקות.

פרמטרים
testData DeviceMetricData: ה-DeviceMetricData שמכיל את הנתונים של תרחיש הבדיקה. יהיה אותו אובייקט כמו במהלך onTestStart(com.android.tradefed.device.metric.DeviceMetricData).

currentTestCaseMetrics : המפה הנוכחית של המדדים שהועברו אל ITestLifeCycleReceiver.testEnded(com.android.tradefed.result.TestDescription, Map).

onTestFail

public void onTestFail (DeviceMetricData testData, 
                TestDescription test)

קריאה חוזרת (callback) כשמקרה בדיקה נכשל.

פרמטרים
testData DeviceMetricData: ה-DeviceMetricData שמכיל את הנתונים של תרחיש הבדיקה.

test TestDescription: ה-TestDescription של מקרה הבדיקה הפעיל.

onTestRunEnd

public void onTestRunEnd (DeviceMetricData runData, 
                 currentRunMetrics)

קריאה חוזרת (call back) בסיום הרצה של בדיקה. זה הזמן לנקות.

פרמטרים
runData DeviceMetricData: ה-DeviceMetricData שמכיל את הנתונים של ההרצה. יהיה זהה לאובייקט שהיה במהלך onTestRunStart(com.android.tradefed.device.metric.DeviceMetricData).

currentRunMetrics : המפה הנוכחית של המדדים שהועברו אל ITestLifeCycleReceiver.testRunEnded(long, Map).

onTestRunFailed

public void onTestRunFailed (DeviceMetricData testData, 
                FailureDescription failure)

פרמטרים
testData DeviceMetricData

failure FailureDescription

onTestRunStart

public void onTestRunStart (DeviceMetricData runData)

קריאה חוזרת (callback) כשהרצת הבדיקה מתחילה.

פרמטרים
runData DeviceMetricData: ה-DeviceMetricData שמכיל את הנתונים של ההרצה.

onTestStart

public void onTestStart (DeviceMetricData testData)

קריאה חוזרת (callback) כשמקרה בדיקה מתחיל.

פרמטרים
testData DeviceMetricData: ה-DeviceMetricData שמכיל את הנתונים של תרחיש הבדיקה.

setDisable

public final void setDisable (boolean isDisabled)

מגדיר אם האובייקט יושבת. אם האפשרות מושבתת, צריך לדלג על שני השלבים של ההגדרה והפירוק. אפשר להשתמש בה כדי להשבית אובייקט כברירת מחדל ב-constructor של ברירת המחדל.

פרמטרים
isDisabled boolean: המצב שאליו צריך להעביר את האובייקט.

setLogSaver

public final void setLogSaver (ILogSaver logSaver)

אין להשתמש בתוך הטמעת האוסף של המדדים. זוהי העברה טהורה.

פרמטרים
logSaver ILogSaver

testAssumptionFailure

public final void testAssumptionFailure (TestDescription test, 
                String trace)

פרמטרים
test TestDescription

trace String

testAssumptionFailure

public final void testAssumptionFailure (TestDescription test, 
                FailureDescription failure)

פרמטרים
test TestDescription

failure FailureDescription

testEnded

public final void testEnded (TestDescription test, 
                long endTime, 
                 testMetrics)

פרמטרים
test TestDescription

endTime long

testMetrics

testEnded

public final void testEnded (TestDescription test, 
                 testMetrics)

פרמטרים
test TestDescription

testMetrics

testFailed

public final void testFailed (TestDescription test, 
                FailureDescription failure)

פרמטרים
test TestDescription

failure FailureDescription

testFailed

public final void testFailed (TestDescription test, 
                String trace)

פרמטרים
test TestDescription

trace String

testIgnored

public final void testIgnored (TestDescription test)

פרמטרים
test TestDescription

testLog

public final void testLog (String dataName, 
                LogDataType dataType, 
                InputStreamSource dataStream)

פרמטרים
dataName String

dataType LogDataType

dataStream InputStreamSource

testLogSaved

public final void testLogSaved (String dataName, 
                LogDataType dataType, 
                InputStreamSource dataStream, 
                LogFile logFile)

אין להשתמש בתוך הטמעת האוסף של המדדים. זוהי העברה טהורה.

פרמטרים
dataName String

dataType LogDataType

dataStream InputStreamSource

logFile LogFile

testModuleEnded

public final void testModuleEnded ()

testModuleStarted

public final void testModuleStarted (IInvocationContext moduleContext)

פרמטרים
moduleContext IInvocationContext

testRunEnded

public final void testRunEnded (long elapsedTime, 
                 runMetrics)

פרמטרים
elapsedTime long

runMetrics

testRunFailed

public final void testRunFailed (FailureDescription failure)

פרמטרים
failure FailureDescription

testRunFailed

public final void testRunFailed (String errorMessage)

פרמטרים
errorMessage String

testRunStarted

public final void testRunStarted (String runName, 
                int testCount, 
                int attemptNumber)

פרמטרים
runName String

testCount int

attemptNumber int

testRunStarted

public final void testRunStarted (String runName, 
                int testCount)

בדיקה של קריאות חזרה (callbacks) להרצה

פרמטרים
runName String

testCount int

testRunStarted

public final void testRunStarted (String runName, 
                int testCount, 
                int attemptNumber, 
                long startTime)

פרמטרים
runName String

testCount int

attemptNumber int

startTime long

testRunStopped

public final void testRunStopped (long elapsedTime)

פרמטרים
elapsedTime long

testStarted

public final void testStarted (TestDescription test, 
                long startTime)

פרמטרים
test TestDescription

startTime long

testStarted

public final void testStarted (TestDescription test)

קריאות חזרה למקרי בדיקה

פרמטרים
test TestDescription