InvocationExecution

public class InvocationExecution
extends Object implements IInvocationExecution

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


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

סיכום

ערכים קבועים

String ADB_VERSION_KEY

String JAVA_CLASSPATH_KEY

String JAVA_VERSION_KEY

Constructors ציבוריים

InvocationExecution()

‫methods ציבוריים

void cleanUpBuilds(IInvocationContext context, IConfiguration config)

מריצים את השלב build_provider clean up.

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 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)

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

ערכים קבועים

ADB_VERSION_KEY

public static final String ADB_VERSION_KEY

ערך קבוע: ‎"adb_version"‎

JAVA_CLASSPATH_KEY

public static final String JAVA_CLASSPATH_KEY

ערך קבוע: ‎"java_classpath"‎

JAVA_VERSION_KEY

public static final String JAVA_VERSION_KEY

ערך קבוע: "java_version"

Constructors ציבוריים

InvocationExecution

public InvocationExecution ()

‫methods ציבוריים

cleanUpBuilds

public void cleanUpBuilds (IInvocationContext context, 
                IConfiguration config)

מריצים את השלב build_provider clean up. משויך לאחזור של הגרסה.

פרמטרים
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 אם ההורדה של הגרסה הצליחה, אחרת 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)

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

מוחלף בכיתות של ארגז חול כדי להגביל את ההרצה של קבצים להכנת בדיקות מעבדה בתוך ארגז החול (sandbox) של הצאצא

פרמטרים
config IConfiguration

deviceName String

החזרות

getTargetPreparersToRun

protected  getTargetPreparersToRun (IConfiguration config, 
                String deviceName)

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

מוחלף בכיתות של ארגז חול כדי להגביל את ההרצה של קבצים להכנת בדיקות מעבדה בתוך ארגז החול (sandbox) של הצאצא

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

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

פרמטרים
info IBuildInfo

config IConfiguration