InvocationExecution

public class InvocationExecution
extends Object implements IInvocationExecution

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


כיתה שמתארת את כל שלבי ההפעלה: build download, ‏ target_prep, ‏ run tests, ‏ clean up. אפשר להרחיב אותו כדי לשנות את התנהגות ברירת המחדל של שלבים מסוימים. סדר השלבים נקבע לפי 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)

אחזור רשימה של מכשירי Lab Prep לצורך הפעלה במכשיר הזה.

getTargetPreparersToRun(IConfiguration config, String deviceName)

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

void linkExternalDirs(IBuildInfo info, TestInformation testInfo)
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)
void setTestTag(IBuildInfo info, IConfiguration config)

טיפול בהגדרת תג הבדיקה בפרטי ה-build.

שדות

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 הערך True אם הורדנו את ה-build בהצלחה, אחרת הערך False.

זריקות
BuildRetrievalError
DeviceNotAvailableException

reportLogs

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: חריגה מקורית שהופקה על ידי הבדיקה שפועלת, אם יש כזו.

runDevicePreInvocationSetup

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 הערך true אם הבדיקה חולקה למקטעים. אחרת, מחזירים את הערך false

שיטות מוגנות

collectAutoInfo

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)

אחזור רשימה של מכשירי Lab Prep לצורך הפעלה במכשיר הזה.

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

פרמטרים
config IConfiguration

deviceName String

החזרות

getTargetPreparersToRun

protected  getTargetPreparersToRun (IConfiguration config, 
                String deviceName)

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

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

פרמטרים
config IConfiguration

deviceName String

החזרות

linkExternalDirs

protected void linkExternalDirs (IBuildInfo info, 
                TestInformation testInfo)

פרמטרים
info IBuildInfo

testInfo TestInformation

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)

טיפול בהגדרת תג הבדיקה בפרטי ה-build.

פרמטרים
info IBuildInfo

config IConfiguration