ModuleDefinition

public class ModuleDefinition
extends Object implements ITestCollector

java.lang.Object
   ↳ com.android.tradefed.testtype.suite.ModuleDefinition


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

סיכום

שדות

public static final String ISOLATION_COST

public static final String MODULE_ABI

public static final String MODULE_CACHED

המאפיין הזה מוגדר כ-true אם תוצאות מודול הבדיקה אוחסנו במטמון.

public static final String MODULE_CONTROLLER

public static final String MODULE_EXTERNAL_DEPENDENCIES

public static final String MODULE_ID

מזהה המודול – השם שישמש לזיהוי ייחודי של המודול במהלך testRunStart.

public static final String MODULE_INVOCATION_ATTRIBUTE_FLAG_OVERRIDES_KEY

public static final String MODULE_ISOLATED

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

public static final String MODULE_NAME

שם המודול הוא שם הבסיס שמשויך למודול, בדרך כלל מגיע מקובץ התצורה של Xml TF שממנו המודול נטען.

public static final String MODULE_PARAMETERIZATION

public static final String MODULE_SKIPPED

המאפיין הזה מוגדר כ-true אם מודול הבדיקה דלג על הבדיקה

public static final String MODULE_TEST_COUNT

public static final String PREPARATION_TIME

public static final String RETRY_FAIL_COUNT

public static final String RETRY_SUCCESS_COUNT

public static final String RETRY_TIME

public static final String SPARSE_MODULE

הנכס הזה מוגדר כ-true אם מדווחים רק על אירועים ברמת המודול.

public static final String TEAR_DOWN_TIME

public static final String TEST_TIME

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

ModuleDefinition()
ModuleDefinition(String name, tests, preparersPerDevice, multiPreparers, IConfiguration moduleConfig)

יוצר

ModuleDefinition(String name, tests, preparersPerDevice, suitePreparersPerDevice, multiPreparers, IConfiguration moduleConfig)

יוצר

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

int compareTo(ModuleDefinition moduleDef)

String getId()

החזרת שם המודול הייחודי.

Integer getIntraModuleShardCount()
Integer getIntraModuleShardIndex()
IConfiguration getModuleConfiguration()
IInvocationContext getModuleInvocationContext()

הפונקציה מחזירה את הערך של IInvocationContext שמשויך למודול.

getRequiredTokens(TestInformation testInfo)
long getRuntimeHint()

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

boolean hasModuleFailed()

הפונקציה מחזירה את הערך True אם נקראת פונקציית testRunFailure במודול *

int neededDevices()

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

int numTests()

הפונקציה מחזירה את המספר הנוכחי של IRemoteTest שממתינים להרצה.

final void reportNotExecuted(ITestInvocationListener listener, String message)

דיווח על מודולים שלא בוצעו בכלל.

final void run(TestInformation moduleInfo, ITestInvocationListener listener, moduleLevelListeners)

מריצים את כל IRemoteTest שמכיל המודול ומשתמשים בכל ה-preparers לפני ואחרי כדי להגדיר ולנקות את המכשיר.

final void run(TestInformation moduleInfo, ITestInvocationListener listener, moduleLevelListeners, int maxRunLimit)

מריצים את כל IRemoteTest שמכיל המודול ומשתמשים בכל ה-preparers לפני ואחרי כדי להגדיר ולנקות את המכשיר.

final void run(TestInformation moduleInfo, ITestInvocationListener listener)

מריצים את כל IRemoteTest שמכיל המודול ומשתמשים בכל ה-preparers לפני ואחרי כדי להגדיר ולנקות את המכשיר.

Throwable runPreparation(boolean includeSuitePreparers)

הרצת כלי ההכנה של הבדיקה, כולל כלי הכנה ברמת הסוויטה אם צוין.

void setBuild(IBuildInfo build)

מזינים את IBuildInfo לשימוש במהלך הבדיקות.

void setCollectTestsOnly(boolean collectTestsOnly)

הפעלה או השבתה של מצב אוסף הבדיקות

void setDevice(ITestDevice device)

מזינים את ITestDevice לשימוש במהלך הבדיקות.

void setEnableDynamicDownload(boolean enableDynamicDownload)

האם להפעיל הורדה דינמית ברמת המודול.

void setIntraModuleInformation(int shardCount, int shardIndex)
void setLogSaver(ILogSaver logSaver)

מעבירים את שומר יומן ההפעלה למודול כדי שיוכל להשתמש בו במקרה הצורך.

final void setMergeAttemps(boolean mergeAttempts)

מגדיר אם צריך למזג את התוצאות.

void setMetricCollectors( collectors)

להחדיר את הרשימה של IMetricCollector לשימוש של המודול.

void setRecoverVirtualDevice(boolean recoverVirtualDevice)

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

final void setRetryDecision(IRetryDecision decision)

הגדרת IRetryDecision לשימוש בניסיון חוזר בתוך המודול.

boolean shouldRecoverVirtualDevice()

הפונקציה מחזירה את הערך 'כן' אם צריך לשחזר מכשיר וירטואלי.

String toString()

void transferSuiteLevelOptions(IConfiguration mSuiteConfiguration)

העתקת חלק מההגדרות ברמת חבילת הערוצים

שיטות מוגנות

boolean hasTests()

הפונקציה מחזירה את הערך True אם עדיין יש ב-Module IRemoteTest לרוץ במאגר שלו.

שדות

ISOLATION_COST

public static final String ISOLATION_COST

MODULE_ABI

public static final String MODULE_ABI

MODULE_CACHED

public static final String MODULE_CACHED

המאפיין הזה מוגדר כ-true אם תוצאות מודול הבדיקה אוחסנו במטמון.

MODULE_CONTROLLER

public static final String MODULE_CONTROLLER

MODULE_EXTERNAL_DEPENDENCIES

public static final String MODULE_EXTERNAL_DEPENDENCIES

MODULE_ID

public static final String MODULE_ID

מזהה המודול – השם שישמש לזיהוי ייחודי של המודול במהלך testRunStart. בדרך כלל הוא יהיה שילוב של MODULE_ABI + MODULE_NAME.

MODULE_INVOCATION_ATTRIBUTE_FLAG_OVERRIDES_KEY

public static final String MODULE_INVOCATION_ATTRIBUTE_FLAG_OVERRIDES_KEY

MODULE_ISOLATED

public static final String MODULE_ISOLATED

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

MODULE_NAME

public static final String MODULE_NAME

שם המודול הוא שם הבסיס שמשויך למודול, בדרך כלל מגיע מקובץ התצורה של Xml TF שממנו המודול נטען.

MODULE_PARAMETERIZATION

public static final String MODULE_PARAMETERIZATION

MODULE_SKIPPED

public static final String MODULE_SKIPPED

המאפיין הזה מוגדר כ-true אם מודול הבדיקה דלג על הבדיקה

MODULE_TEST_COUNT

public static final String MODULE_TEST_COUNT

PREPARATION_TIME

public static final String PREPARATION_TIME

RETRY_FAIL_COUNT

public static final String RETRY_FAIL_COUNT

RETRY_SUCCESS_COUNT

public static final String RETRY_SUCCESS_COUNT

RETRY_TIME

public static final String RETRY_TIME

SPARSE_MODULE

public static final String SPARSE_MODULE

הנכס הזה מוגדר כ-true אם מדווחים רק על אירועים ברמת המודול.

TEAR_DOWN_TIME

public static final String TEAR_DOWN_TIME

TEST_TIME

public static final String TEST_TIME

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

ModuleDefinition

public ModuleDefinition ()

ModuleDefinition

public ModuleDefinition (String name, 
                 tests, 
                 preparersPerDevice, 
                 multiPreparers, 
                IConfiguration moduleConfig)

יוצר

פרמטרים
name String: השם הייחודי של הגדרות הבדיקה.

tests : רשימה של IRemoteTest שצריך להריץ.

preparersPerDevice : רשימה של ITargetPreparer שישמשו להגדרת המכשיר.

multiPreparers

moduleConfig IConfiguration: ה-IConfiguration של תצורת המודול הבסיסי.

ModuleDefinition

public ModuleDefinition (String name, 
                 tests, 
                 preparersPerDevice, 
                 suitePreparersPerDevice, 
                 multiPreparers, 
                IConfiguration moduleConfig)

יוצר

פרמטרים
name String: השם הייחודי של הגדרות הבדיקה.

tests : רשימה של IRemoteTest שצריך להריץ.

preparersPerDevice : רשימה של ITargetPreparer שישמשו להגדרת המכשיר.

suitePreparersPerDevice

multiPreparers

moduleConfig IConfiguration: ה-IConfiguration של תצורת המודול הבסיסי.

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

compareTo

public int compareTo (ModuleDefinition moduleDef)

פרמטרים
moduleDef ModuleDefinition

החזרות
int

getId

public String getId ()

החזרת שם המודול הייחודי.

החזרות
String

getIntraModuleShardCount

public Integer getIntraModuleShardCount ()

החזרות
Integer

getIntraModuleShardIndex

public Integer getIntraModuleShardIndex ()

החזרות
Integer

getModuleConfiguration

public IConfiguration getModuleConfiguration ()

החזרות
IConfiguration

getModuleInvocationContext

public IInvocationContext getModuleInvocationContext ()

הפונקציה מחזירה את הערך של IInvocationContext שמשויך למודול.

החזרות
IInvocationContext

getRequiredTokens

public  getRequiredTokens (TestInformation testInfo)

פרמטרים
testInfo TestInformation

החזרות

getRuntimeHint

public long getRuntimeHint ()

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

החזרות
long

hasModuleFailed

public boolean hasModuleFailed ()

הפונקציה מחזירה את הערך True אם נקראת פונקציית testRunFailure במודול *

החזרות
boolean

neededDevices

public int neededDevices ()

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

החזרות
int

numTests

public int numTests ()

הפונקציה מחזירה את המספר הנוכחי של IRemoteTest שממתינים להרצה.

החזרות
int

reportNotExecuted

public final void reportNotExecuted (ITestInvocationListener listener, 
                String message)

דיווח על מודולים שלא בוצעו בכלל.

פרמטרים
listener ITestInvocationListener

message String

ראן

public final void run (TestInformation moduleInfo, 
                ITestInvocationListener listener, 
                 moduleLevelListeners)

מריצים את כל IRemoteTest שמכיל המודול ומשתמשים בכל ה-preparers לפני ואחרי כדי להגדיר ולנקות את המכשיר.

פרמטרים
moduleInfo TestInformation

listener ITestInvocationListener: ה-ITestInvocationListener שבו מדווחים על התוצאות.

moduleLevelListeners : רשימת המאזינים ברמת המודול.

זריקות
DeviceNotAvailableException במקרה שהמכשיר עובר למצב אופליין.

ראן

public final void run (TestInformation moduleInfo, 
                ITestInvocationListener listener, 
                 moduleLevelListeners, 
                int maxRunLimit)

מריצים את כל IRemoteTest שמכיל המודול ומשתמשים בכל ה-preparers לפני ואחרי כדי להגדיר ולנקות את המכשיר.

פרמטרים
moduleInfo TestInformation: ה-TestInformation של המודול.

listener ITestInvocationListener: ה-ITestInvocationListener שבו מדווחים על התוצאות.

moduleLevelListeners : רשימת המאזינים ברמת המודול.

maxRunLimit int: מספר ההפעלות המקסימלי של כל בדיקת תוכנה.

זריקות
DeviceNotAvailableException במקרה שהמכשיר עובר למצב אופליין.

ראן

public final void run (TestInformation moduleInfo, 
                ITestInvocationListener listener)

מריצים את כל IRemoteTest שמכיל המודול ומשתמשים בכל ה-preparers לפני ואחרי כדי להגדיר ולנקות את המכשיר.

פרמטרים
moduleInfo TestInformation

listener ITestInvocationListener: ה-ITestInvocationListener שבו מדווחים על התוצאות.

זריקות
DeviceNotAvailableException במקרה שהמכשיר עובר למצב אופליין.

runPreparation

public Throwable runPreparation (boolean includeSuitePreparers)

הרצת כלי ההכנה של הבדיקה, כולל כלי הכנה ברמת הסוויטה אם צוין.

פרמטרים
includeSuitePreparers boolean: מגדירים את הערך true כדי להריץ גם כלי הכנה ברמת הסוויטה.

החזרות
Throwable Throwable של כל החרגה שהופיעה במהלך הפעלת הכלי להכנת הנתונים.

setBuild

public void setBuild (IBuildInfo build)

מזינים את IBuildInfo לשימוש במהלך הבדיקות.

פרמטרים
build IBuildInfo

setCollectTestsOnly

public void setCollectTestsOnly (boolean collectTestsOnly)

הפעלה או השבתה של מצב אוסף הבדיקות

setDevice

public void setDevice (ITestDevice device)

מזינים את ITestDevice לשימוש במהלך הבדיקות.

פרמטרים
device ITestDevice

setEnableDynamicDownload

public void setEnableDynamicDownload (boolean enableDynamicDownload)

האם להפעיל הורדה דינמית ברמת המודול.

פרמטרים
enableDynamicDownload boolean

setIntraModuleInformation

public void setIntraModuleInformation (int shardCount, 
                int shardIndex)

פרמטרים
shardCount int

shardIndex int

setLogSaver

public void setLogSaver (ILogSaver logSaver)

מעבירים את שומר יומן ההפעלה למודול כדי שיוכל להשתמש בו במקרה הצורך.

פרמטרים
logSaver ILogSaver

setMergeAttemps

public final void setMergeAttemps (boolean mergeAttempts)

מגדיר אם צריך למזג את התוצאות.

פרמטרים
mergeAttempts boolean

setMetricCollectors

public void setMetricCollectors ( collectors)

להחדיר את הרשימה של IMetricCollector לשימוש של המודול.

פרמטרים
collectors

setRecoverVirtualDevice

public void setRecoverVirtualDevice (boolean recoverVirtualDevice)

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

פרמטרים
recoverVirtualDevice boolean

setRetryDecision

public final void setRetryDecision (IRetryDecision decision)

הגדרת IRetryDecision לשימוש בניסיון חוזר בתוך המודול.

פרמטרים
decision IRetryDecision

shouldRecoverVirtualDevice

public boolean shouldRecoverVirtualDevice ()

הפונקציה מחזירה את הערך 'כן' אם צריך לשחזר מכשיר וירטואלי.

החזרות
boolean

toString

public String toString ()

החזרות
String

transferSuiteLevelOptions

public void transferSuiteLevelOptions (IConfiguration mSuiteConfiguration)

העתקת חלק מההגדרות ברמת חבילת הערוצים

פרמטרים
mSuiteConfiguration IConfiguration

שיטות מוגנות

hasTests

protected boolean hasTests ()

הפונקציה מחזירה את הערך True אם עדיין יש ב-Module IRemoteTest לרוץ במאגר שלו. אחרת, הערך יהיה false.

החזרות
boolean