RemoteTestTimeOutEnforcer

public class RemoteTestTimeOutEnforcer
extends ResultAndLogForwarder

java.lang.Object
   ↳ com.android.tradefed.result.ResultForwarder
     ↳ com.android.tradefed.result.ResultAndLogForwarder
       ↳ com.android.tradefed.testtype.suite.RemoteTestTimeOutEnforcer


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

חשוב לזכור שהכלי הזה לא יפריע לבדיקות, אבל הוא יגרום לכך שהן ייכשלו.

סיכום

ערכים קבועים

String REMOTE_TEST_TIMEOUT_DESCRIPTION

String REMOTE_TEST_TIMEOUT_OPTION

‫constructors ציבוריים

RemoteTestTimeOutEnforcer(List<ITestInvocationListener> allListeners, ModuleDefinition moduleDefinition, IRemoteTest test, Duration timeOut)

יוצרים את RemoteTestTimeOutEnforcer עם פסק הזמן שצריך לאכוף.

‫methods ציבוריים

void setGranularListener(ModuleListener listener)
void testRunEnded(long elapsedTime, HashMap<String, MetricMeasurement.Metric> runMetrics)

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

ערכים קבועים

REMOTE_TEST_TIMEOUT_DESCRIPTION

public static final String REMOTE_TEST_TIMEOUT_DESCRIPTION

ערך קבוע: "The timeout that will be applied to each remote test object of the run."

REMOTE_TEST_TIMEOUT_OPTION

public static final String REMOTE_TEST_TIMEOUT_OPTION

ערך קבוע: "remote-test-timeout"

‫constructors ציבוריים

RemoteTestTimeOutEnforcer

public RemoteTestTimeOutEnforcer (List<ITestInvocationListener> allListeners, 
                ModuleDefinition moduleDefinition, 
                IRemoteTest test, 
                Duration timeOut)

יוצרים את RemoteTestTimeOutEnforcer עם פסק הזמן שצריך לאכוף.

פרמטרים
allListeners List

moduleDefinition ModuleDefinition: ה-ModuleDefinition של מודול הבדיקה שיופעל.

test IRemoteTest: הפקודה IRemoteTest להרצה.

timeOut Duration: Duration משך הזמן הקצוב לתפוגה לכל הרצת בדיקה.

‫methods ציבוריים

setGranularListener

public void setGranularListener (ModuleListener listener)

פרמטרים
listener ModuleListener

testRunEnded

public void testRunEnded (long elapsedTime, 
                HashMap<String, MetricMeasurement.Metric> runMetrics)

דוחות על סיום הרצת הבדיקה. FIXME: We cannot have two Map<> interfaces with different type, so we have to use HashMap here.

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

runMetrics HashMap: צמדי מפתח/ערך שמדווחים בסוף הרצת בדיקה עם Metric.