InvocationExecution

public class InvocationExecution
extends Object implements IInvocationExecution

java.lang.Object
com.android.tradefed.invoker.InvocationExecution


מחלקה שמתארת ​​את כל שלבי ההתקשרות: הורדה לבנות, target_prep, להפעיל בדיקות, לנקות. ניתן להרחיב כדי לעקוף את התנהגות ברירת המחדל של כמה שלבים. סדר השלבים מונע על ידי TestInvocation .

סיכום

שדות

public static final String ADB_VERSION_KEY

public static final String JAVA_CLASSPATH_KEY

public static final String JAVA_VERSION_KEY

בנאים ציבוריים

InvocationExecution ()

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

void cleanUpBuilds ( IInvocationContext context, IConfiguration config)

בצע את שלב הניקוי build_provider.

void doCleanUp ( IInvocationContext context, IConfiguration config, Throwable exception)

בצע את שלב הניקוי של target_preparer ו- multi_target_preparer.

void doSetup ( TestInformation testInfo, IConfiguration config, ITestLogger listener)

בצע את שלב ההגדרה של target_preparer ו-multi_target_preparer.

void doTeardown ( TestInformation testInfo, IConfiguration config, ITestLogger logger, Throwable exception)

בצע את שלב ההסרה של target_preparer ו- multi_target_preparer.

boolean fetchBuild ( TestInformation testInfo, IConfiguration config, IRescheduler rescheduler, ITestInvocationListener listener)

בצע את שלב build_provider של ההזמנה.

void reportLogs ( ITestDevice device, ITestLogger listener, TestInvocation.Stage stage)

דווח על כמה יומני מכשירים בשלבים שונים של הפנייה.

void runDevicePostInvocationTearDown ( IInvocationContext context, IConfiguration config, Throwable exception)

הפעל את ITestDevice#postInvocationTearDown(Throwable) עבור כל חלק מהמכשיר של הפנייה.

void runDevicePreInvocationSetup ( IInvocationContext context, IConfiguration config, ITestLogger logger)

הפעל את ERROR(ITestDevice#preInvocationSetup(IBuildInfo)/com.android.tradefed.device.ITestDevice#preInvocationSetup(com.android.tradefed.build.IBuildInfo) ITestDevice#preInvocationSetup(IBuildInfo)) בכל חלק של התקן.

void runTests ( TestInformation info, IConfiguration config, ITestInvocationListener listener)

מפעיל את הבדיקה.

boolean shardConfig ( IConfiguration config, TestInformation testInfo, IRescheduler rescheduler, ITestLogger logger)

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

שיטות מוגנות

void collectAutoInfo ( IConfiguration config, TestInformation info)

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

IShardHelper createShardHelper ()

צור החזר את IShardHelper לשימוש.

void customizeDevicePreInvocation ( IConfiguration config, IInvocationContext context)

תן הזדמנות להתאים אישית חלק מהמכשיר לפני PreInvocationSetup.

String getAdbVersion ()

מחזירה את גרסת ה-ADB שנמצאת בשימוש עבור ההזמנה.

getLabPreparersToRun ( IConfiguration config, String deviceName)

אחזר רשימה של מכיני מעבדה להפעלה במכשיר זה.

getTargetPreparersToRun ( IConfiguration config, String deviceName)

אחזר רשימה של מכיני יעדים להפעלה במכשיר זה.

void logHostAdb ( IConfiguration config, ITestLogger logger)

אסוף את היומנים מ-$TMPDIR/adb.$UID.log.

Throwable runPreparersTearDown ( TestInformation testInfo, ITestDevice device, String deviceName, int deviceIndex, ITestLogger logger, Throwable exception, preparersToRun, trackPreparersMap) runPreparersTearDown ( TestInformation testInfo, ITestDevice device, String deviceName, int deviceIndex, ITestLogger logger, Throwable exception, preparersToRun, trackPreparersMap) runPreparersTearDown ( TestInformation testInfo, ITestDevice device, String deviceName, int deviceIndex, ITestLogger logger, Throwable exception, preparersToRun, trackPreparersMap)
void setTestTag ( IBuildInfo info, IConfiguration config)

טפל בהגדרת תג הבדיקה על פרטי הבנייה.

שדות

ADB_VERSION_KEY

public static final String ADB_VERSION_KEY

JAVA_CLASSPATH_KEY

public static final String JAVA_CLASSPATH_KEY

JAVA_VERSION_KEY

public static final String JAVA_VERSION_KEY

בנאים ציבוריים

InvocationExecution

public InvocationExecution ()

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

cleanUpBuilds

public void cleanUpBuilds (IInvocationContext context, 
                IConfiguration config)

בצע את שלב הניקוי build_provider. משויך להבאת ה-build.

פרמטרים
context IInvocationContext : IInvocationContext של הקריאה.

config IConfiguration : IConfiguration של הפעלת בדיקה זו.

doCleanUp

public void doCleanUp (IInvocationContext context, 
                IConfiguration config, 
                Throwable exception)

בצע את שלב הניקוי של target_preparer ו- multi_target_preparer. האם המכשירים מנקים.

פרמטרים
context IInvocationContext : IInvocationContext של הקריאה.

config IConfiguration : IConfiguration של הפעלת בדיקה זו.

exception Throwable : החריג המקורי שנגרם על ידי ריצת הבדיקה.

doSetup

public void doSetup (TestInformation testInfo, 
                IConfiguration config, 
                ITestLogger listener)

בצע את שלב ההגדרה של target_preparer ו-multi_target_preparer. האם כל הגדרות ההתקנים הנדרשות להפעלת הבדיקה.

פרמטרים
testInfo TestInformation : ה- TestInformation של ההזמנה.

config IConfiguration : IConfiguration של הפעלת בדיקה זו.

listener ITestLogger : ה- ITestLogger לדיווח על יומני כשלים בהתקנה.

זורק
BuildError
DeviceNotAvailableException
TargetSetupError

doTeardown

public void doTeardown (TestInformation testInfo, 
                IConfiguration config, 
                ITestLogger logger, 
                Throwable exception)

בצע את שלב ההסרה של target_preparer ו- multi_target_preparer. האם המכשירים מתקלקלים הקשורים להגדרה.

פרמטרים
testInfo TestInformation : ה- TestInformation של ההזמנה.

config IConfiguration : IConfiguration של הפעלת בדיקה זו.

logger ITestLogger : ה- ITestLogger לדיווח על יומנים.

exception Throwable : החריג המקורי שנגרם על ידי ריצת הבדיקה.

fetchBuild

public boolean fetchBuild (TestInformation testInfo, 
                IConfiguration config, 
                IRescheduler rescheduler, 
                ITestInvocationListener listener)

בצע את שלב build_provider של ההזמנה.

פרמטרים
testInfo TestInformation : ה- TestInformation של ההזמנה.

config IConfiguration : IConfiguration של הפעלת בדיקה זו.

rescheduler IRescheduler : IRescheduler , לתזמון מחדש של חלקים מההזמנה לביצוע במשאב(ים) אחר

listener ITestInvocationListener : ה- ITestInvocation לדווח על כשלים בהורדה של build.

החזרות
boolean נכון אם הורדנו בהצלחה את ה-build, לא נכון אחרת.

זורק
BuildRetrievalError
DeviceNotAvailableException

דוח יומני

public void reportLogs (ITestDevice device, 
                ITestLogger listener, 
                TestInvocation.Stage stage)

דווח על כמה יומני מכשירים בשלבים שונים של הפנייה. לדוגמה: logcat.

פרמטרים
device ITestDevice : המכשיר שממנו יש לדווח על יומנים.

listener ITestLogger : לוגר היומנים.

stage TestInvocation.Stage : שלב ההזמנה בה אנו נמצאים.

runDevicePostInvocationTearDown

public void runDevicePostInvocationTearDown (IInvocationContext context, 
                IConfiguration config, 
                Throwable exception)

הפעל את ITestDevice#postInvocationTearDown(Throwable) עבור כל חלק מהמכשיר של הפנייה.

פרמטרים
context IInvocationContext : IInvocationContext של הקריאה.

config IConfiguration : IConfiguration של הפעלת בדיקה זו.

exception Throwable : החריג המקורי שנזרק על ידי הבדיקה שפועלת, אם בכלל.

הפעל DevicePreInvocationSetup

public void runDevicePreInvocationSetup (IInvocationContext context, 
                IConfiguration config, 
                ITestLogger logger)

הפעל את ERROR(ITestDevice#preInvocationSetup(IBuildInfo)/com.android.tradefed.device.ITestDevice#preInvocationSetup(com.android.tradefed.build.IBuildInfo) ITestDevice#preInvocationSetup(IBuildInfo)) בכל חלק של התקן.

פרמטרים
context IInvocationContext : IInvocationContext של הקריאה.

config IConfiguration : IConfiguration של הפעלת בדיקה זו.

logger ITestLogger : ה- ITestLogger לדיווח על יומנים.

זורק
DeviceNotAvailableException
TargetSetupError

runTests

public void runTests (TestInformation info, 
                IConfiguration config, 
                ITestInvocationListener listener)

מפעיל את הבדיקה.

פרמטרים
info TestInformation : ה- TestInformation שאפשר להריץ איתו בדיקות.

config IConfiguration : IConfiguration להפעלה

listener ITestInvocationListener : ה- ITestInvocationListener של תוצאות הבדיקה

shardConfig

public boolean shardConfig (IConfiguration config, 
                TestInformation testInfo, 
                IRescheduler rescheduler, 
                ITestLogger logger)

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

אם ספירת הרסיסים גדולה מ-1, היא פשוט תיצור הגדרות עבור כל רסיס על ידי הגדרת מדדי רסיס ותזמון מחדש שלהם. אם לא מוגדרת ספירת רסיסים, היא תחזור ל- IShardHelper#shardConfig .

פרמטרים
config IConfiguration : ה- IConfiguration הנוכחית.

testInfo TestInformation : ה- TestInformation שמכיל את המידע של הבדיקות.

rescheduler IRescheduler : ה- IRescheduler .

logger ITestLogger : ITestLogger משמש לרישום קבצים במהלך ריסוק.

החזרות
boolean נכון אם הבדיקה נחתכה. אחרת החזר false

שיטות מוגנות

אוסףAutoInfo

protected void collectAutoInfo (IConfiguration config, 
                TestInformation info)

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

פרמטרים
config IConfiguration

info TestInformation

זורק
DeviceNotAvailableException

createShardHelper

protected IShardHelper createShardHelper ()

צור החזר את IShardHelper לשימוש.

החזרות
IShardHelper

customizeDevicePreInvocation

protected void customizeDevicePreInvocation (IConfiguration config, 
                IInvocationContext context)

תן הזדמנות להתאים אישית חלק מהמכשיר לפני PreInvocationSetup.

פרמטרים
config IConfiguration : התצורה של ההזמנה.

context IInvocationContext : הקשר ההתקשרות הנוכחי.

getAdbVersion

protected String getAdbVersion ()

מחזירה את גרסת ה-ADB שנמצאת בשימוש עבור ההזמנה.

החזרות
String

getLabPreparersToRun

protected  getLabPreparersToRun (IConfiguration config, 
                String deviceName)

אחזר רשימה של מכיני מעבדה להפעלה במכשיר זה.

נדחק בשיעורי ארגז חול כדי להגביל את הפעלת מכיני המעבדה בתוך ילד ארגז החול

פרמטרים
config IConfiguration

deviceName String

החזרות

getTargetPreparersToRun

protected  getTargetPreparersToRun (IConfiguration config, 
                String deviceName)

אחזר רשימה של מכיני יעדים להפעלה במכשיר זה.

נדחק בשיעורי ארגז חול כדי להגביל את הפעלת מכיני המעבדה בתוך ילד ארגז החול

פרמטרים
config IConfiguration

deviceName String

החזרות

logHostAdb

protected void logHostAdb (IConfiguration config, 
                ITestLogger logger)

אסוף את היומנים מ-$TMPDIR/adb.$UID.log.

פרמטרים
config IConfiguration

logger ITestLogger

runPreparersTearDown

protected Throwable runPreparersTearDown (TestInformation testInfo, 
                ITestDevice device, 
                String deviceName, 
                int deviceIndex, 
                ITestLogger logger, 
                Throwable exception, 
                 preparersToRun, 
                 trackPreparersMap)

פרמטרים
testInfo TestInformation

device ITestDevice

deviceName String

deviceIndex int

logger ITestLogger

exception Throwable

preparersToRun

trackPreparersMap

החזרות
Throwable

setTestTag

protected void setTestTag (IBuildInfo info, 
                IConfiguration config)

טפל בהגדרת תג הבדיקה על פרטי הבנייה.

פרמטרים
info IBuildInfo

config IConfiguration