จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ

ModuleDefinition

public class ModuleDefinition
extends Object implements ITestCollector

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


คอนเทนเนอร์สำหรับการกำหนดค่าการทดสอบรัน คลาสนี้เป็นตัวช่วยในการเตรียมและดำเนินการทดสอบ

สรุป

ทุ่งนา

public static final String MODULE_ABI

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_ISOLATED

คุณสมบัตินี้ถูกตั้งค่าเป็น true หากโมดูลกำลังทำงานบนอุปกรณ์ที่จัดเตรียมใหม่

public static final String MODULE_NAME

ชื่อโมดูลคือชื่อฐานที่เชื่อมโยงกับโมดูล ซึ่งมักจะมาจากไฟล์กำหนดค่า Xml TF ที่โมดูลถูกโหลด

public static final String MODULE_PARAMETERIZATION

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 TEAR_DOWN_TIME

public static final String TEST_TIME

ผู้สร้างสาธารณะ

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

ตัวสร้าง

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

ตัวสร้าง

วิธีการสาธารณะ

int compareTo ( ModuleDefinition moduleDef)

String getId ()

ส่งคืนชื่อโมดูลที่ไม่ซ้ำ

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, TestFailureListener failureListener, int maxRunLimit) run ( TestInformation moduleInfo, ITestInvocationListener listener, moduleLevelListeners, TestFailureListener failureListener, int maxRunLimit)

เรียกใช้ IRemoteTest ทั้งหมดที่มีอยู่ในโมดูลและใช้ตัวจัดเตรียมทั้งหมดก่อนและหลังเพื่อตั้งค่าและทำความสะอาดอุปกรณ์

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

เรียกใช้ IRemoteTest ทั้งหมดที่มีอยู่ในโมดูลและใช้ตัวจัดเตรียมทั้งหมดก่อนและหลังเพื่อตั้งค่าและทำความสะอาดอุปกรณ์

final void run ( TestInformation moduleInfo, ITestInvocationListener listener)

เรียกใช้ IRemoteTest ทั้งหมดที่มีอยู่ในโมดูลและใช้ตัวจัดเตรียมทั้งหมดก่อนและหลังเพื่อตั้งค่าและทำความสะอาดอุปกรณ์

Throwable runPreparation (boolean includeSuitePreparers)

เรียกใช้ผู้จัดเตรียมการทดสอบ รวมถึงผู้จัดเตรียมระดับชุด หากระบุไว้

void setBuild ( IBuildInfo build)

ฉีด IBuildInfo เพื่อใช้ในระหว่างการทดสอบ

void setCollectTestsOnly (boolean collectTestsOnly)

เปิดหรือปิดโหมดการรวบรวมการทดสอบ

void setDevice ( ITestDevice device)

ฉีด ITestDevice ที่จะใช้ในระหว่างการทดสอบ

void setEnableDynamicDownload (boolean enableDynamicDownload)

เปิดใช้งานการดาวน์โหลดแบบไดนามิกที่ระดับโมดูลหรือไม่

void setLogSaver ( ILogSaver logSaver)

ส่งโปรแกรมรักษาบันทึกการเรียกใช้ไปยังโมดูลเพื่อให้สามารถใช้งานได้หากจำเป็น

final void setMergeAttemps (boolean mergeAttempts)

ตั้งค่าว่าเราควรรวมผลลัพธ์หรือไม่

void setMetricCollectors ( collectors) setMetricCollectors ( collectors)

ฉีดรายการ IMetricCollector ที่จะใช้โดยโมดูล

final void setRetryDecision ( IRetryDecision decision)

ตั้งค่า IRetryDecision ที่จะใช้สำหรับการลองใหม่ภายในโมดูล

String toString ()

void transferSuiteLevelOptions ( IConfiguration mSuiteConfiguration)

คัดลอกการกำหนดค่าระดับชุดบางส่วน

วิธีการป้องกัน

boolean hasTests ()

คืนค่า True หากโมดูลยังมี IRemoteTest ให้ทำงานในพูล

ทุ่งนา

MODULE_ABI

public static final String MODULE_ABI

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_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_TEST_COUNT

public static final String MODULE_TEST_COUNT

เวลาเตรียมการ

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

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 ของการกำหนดค่าโมดูลพื้นฐาน

วิธีการสาธารณะ

เปรียบเทียบกับ

public int compareTo (ModuleDefinition moduleDef)

พารามิเตอร์
moduleDef ModuleDefinition

คืนสินค้า
int

getId

public String getId ()

ส่งคืนชื่อโมดูลที่ไม่ซ้ำ

คืนสินค้า
String

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

อุปกรณ์ที่จำเป็น

public int neededDevices ()

ส่งกลับจำนวนอุปกรณ์ที่คาดว่าจะเรียกใช้การทดสอบนี้

คืนสินค้า
int

numTests

public int numTests ()

ส่งกลับจำนวนปัจจุบันของ IRemoteTest ที่รอดำเนินการ

คืนสินค้า
int

รายงานไม่ดำเนินการ

public final void reportNotExecuted (ITestInvocationListener listener, 
                String message)

รายงานโมดูลที่ไม่ได้ดำเนินการอย่างสมบูรณ์

พารามิเตอร์
listener ITestInvocationListener

message String

วิ่ง

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

เรียกใช้ IRemoteTest ทั้งหมดที่มีอยู่ในโมดูลและใช้ตัวจัดเตรียมทั้งหมดก่อนและหลังเพื่อตั้งค่าและทำความสะอาดอุปกรณ์

พารามิเตอร์
moduleInfo TestInformation : ข้อมูลการ TestInformation สำหรับโมดูล

listener ITestInvocationListener : ITestInvocationListener ที่จะรายงานผลลัพธ์

moduleLevelListeners : รายชื่อผู้ฟังในระดับโมดูล

failureListener TestFailureListener : ผู้ฟังเฉพาะเพื่อรวบรวมบันทึกใน testFail เป็นโมฆะได้

maxRunLimit int : จำนวนการรันสูงสุดสำหรับแต่ละเคส

ขว้าง
DeviceNotAvailableException ในกรณีที่เครื่องออฟไลน์

วิ่ง

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

เรียกใช้ IRemoteTest ทั้งหมดที่มีอยู่ในโมดูลและใช้ตัวจัดเตรียมทั้งหมดก่อนและหลังเพื่อตั้งค่าและทำความสะอาดอุปกรณ์

พารามิเตอร์
moduleInfo TestInformation

listener ITestInvocationListener : ITestInvocationListener ที่จะรายงานผลลัพธ์

moduleLevelListeners : รายชื่อผู้ฟังในระดับโมดูล

failureListener TestFailureListener : ผู้ฟังเฉพาะเพื่อรวบรวมบันทึกใน testFail เป็นโมฆะได้

ขว้าง
DeviceNotAvailableException ในกรณีที่เครื่องออฟไลน์

วิ่ง

public final void run (TestInformation moduleInfo, 
                ITestInvocationListener listener)

เรียกใช้ IRemoteTest ทั้งหมดที่มีอยู่ในโมดูลและใช้ตัวจัดเตรียมทั้งหมดก่อนและหลังเพื่อตั้งค่าและทำความสะอาดอุปกรณ์

พารามิเตอร์
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

setLogSaver

public void setLogSaver (ILogSaver logSaver)

ส่งโปรแกรมรักษาบันทึกการเรียกใช้ไปยังโมดูลเพื่อให้สามารถใช้งานได้หากจำเป็น

พารามิเตอร์
logSaver ILogSaver

setMergeAttemps

public final void setMergeAttemps (boolean mergeAttempts)

ตั้งค่าว่าเราควรรวมผลลัพธ์หรือไม่

พารามิเตอร์
mergeAttempts boolean

setMetricCollectors

public void setMetricCollectors ( collectors)

ฉีดรายการ IMetricCollector ที่จะใช้โดยโมดูล

พารามิเตอร์
collectors

setRetryDecision

public final void setRetryDecision (IRetryDecision decision)

ตั้งค่า IRetryDecision ที่จะใช้สำหรับการลองใหม่ภายในโมดูล

พารามิเตอร์
decision IRetryDecision

toString

public String toString ()

คืนสินค้า
String

โอนSuiteLevelOptions

public void transferSuiteLevelOptions (IConfiguration mSuiteConfiguration)

คัดลอกการกำหนดค่าระดับชุดบางส่วน

พารามิเตอร์
mSuiteConfiguration IConfiguration

วิธีการป้องกัน

มีการทดสอบ

protected boolean hasTests ()

คืนค่า True หากโมดูลยังมี IRemoteTest ให้ทำงานในพูล เท็จเป็นอย่างอื่น

คืนสินค้า
boolean