BasePostProcessor

public abstract class BasePostProcessor
extends Object implements IPostProcessor

java.lang.Object
   ↳ com.android.tradefed.postprocessor.BasePostProcessor


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

סיכום

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

BasePostProcessor()

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

final ITestInvocationListener init(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)

עדכון השיוך של היומן לבדיקה.

processAllTestMetricsAndLogs(ListMultimap<String, MetricMeasurement.Metric> allTestMetrics, allTestLogs)

מטמיעים את השיטה הזו כדי לצבור מדדים ולוגים מכל הבדיקות.

abstract processRunMetricsAndLogs( rawMetrics, runLogs)

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

processTestMetricsAndLogs(TestDescription testDescription, testMetrics, testLogs)

מטמיעים את השיטה הזו כדי לעבד את המדדים והיומנים מכל בדיקה.

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)

משתמשים בשיטה הזו כדי לתעד קובץ מההטמעה של PostProcessor.

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 testRunStopped(long elapsedTime)
final void testStarted(TestDescription test, long startTime)
final void testStarted(TestDescription test)

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

שיטות מוגנות

MetricMeasurement.DataType getMetricType()

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

String getRunName()

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

BasePostProcessor

public BasePostProcessor ()

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

init

public final ITestInvocationListener init (ITestInvocationListener listener)

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

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

עדכון השיוך של היומן לבדיקה. אם שולחים קריאה ל-method הזה במהלך בדיקה, היומן שייחשב לבדיקה. אחרת, היומן יהיה יומן ריצה.

פרמטרים
dataName String

logFile LogFile

processAllTestMetricsAndLogs

public  processAllTestMetricsAndLogs (ListMultimap<String, MetricMeasurement.Metric> allTestMetrics, 
                 allTestLogs)

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

פרמטרים
allTestMetrics ListMultimap: HashMultimap שמאחסן את המדדים מכל בדיקה, מקובצים לפי שמות המדדים.

allTestLogs : מפה שמאחסנת את המפה של כל בדיקה של קובצי יומנים לפי מפתחות של שמות הנתונים שלהם, באמצעות TestDescription של כל בדיקה כמפתחות.

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

processRunMetricsAndLogs

public abstract  processRunMetricsAndLogs ( rawMetrics, 
                 runLogs)

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

פרמטרים
rawMetrics : קבוצת המדדים הגולמיים שזמינים להרצה.

runLogs : קבוצת קובצי היומנים של הרצה של הבדיקה.

החזרות
קבוצת המדדים החדשים שנוצרו ממדדי הריצה.

processTestMetricsAndLogs

public  processTestMetricsAndLogs (TestDescription testDescription, 
                 testMetrics, 
                 testLogs)

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

פרמטרים
testDescription TestDescription: האובייקט TestDescription שמתאר את הבדיקה.

testMetrics : קבוצת המדדים מהבדיקה.

testLogs : קבוצת הקבצים שתועדו ביומן במהלך הבדיקה.

החזרות
קבוצת המדדים החדשים שנוצרו ממדדי הבדיקה.

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)

משתמשים בשיטה הזו כדי לתעד קובץ מההטמעה של PostProcessor.

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

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

שיטות מוגנות

getMetricType

protected MetricMeasurement.DataType getMetricType ()

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

החזרות
MetricMeasurement.DataType

getRunName

protected String getRunName ()

החזרות
String