คำนิยามโมดูล

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_CONTROLLER

public static final String MODULE_EXTERNAL_DEPENDENCIES

public static final String MODULE_ID

ID โมดูล ชื่อที่จะใช้เพื่อระบุโมดูลเฉพาะในระหว่างการทดสอบ RunStart

public static final String MODULE_ISOLATED

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

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 ให้รันในกลุ่มของมัน

เขตข้อมูล

ISOLATION_COST

public static final String ISOLATION_COST

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

ID โมดูล ชื่อที่จะใช้เพื่อระบุโมดูลเฉพาะในระหว่างการทดสอบ RunStart โดยปกติจะเป็นการรวม MODULE_ABI + MODULE_NAME

MODULE_ISOLATED

public static final String MODULE_ISOLATED

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

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

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

คำนิยามโมดูล

public ModuleDefinition ()

คำนิยามโมดูล

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

ตัวสร้าง

พารามิเตอร์
name String : ชื่อเฉพาะของการกำหนดค่าการทดสอบ

tests : รายการของ IRemoteTest ที่ต้องเรียกใช้

preparersPerDevice : รายการ ITargetPreparer ที่จะใช้ในการตั้งค่าอุปกรณ์

multiPreparers

moduleConfig IConfiguration : IConfiguration ของการกำหนดค่าโมดูลพื้นฐาน

คำนิยามโมดูล

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

รับรหัส

public String getId ()

ส่งคืนชื่อโมดูลเฉพาะ

ส่งคืน
String

รับการกำหนดค่าโมดูล

public IConfiguration getModuleConfiguration ()

ส่งคืน
IConfiguration

getModuleInvocationContext

public IInvocationContext getModuleInvocationContext ()

ส่งคืน IInvocationContext ที่เชื่อมโยงกับโมดูล

ส่งคืน
IInvocationContext

รับโทเค็นที่จำเป็น

public  getRequiredTokens (TestInformation testInfo)

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

ส่งคืน

รับคำแนะนำรันไทม์

public long getRuntimeHint ()

ส่งกลับเวลาโดยประมาณเพื่อเรียกใช้การทดสอบทั้งหมดในโมดูล

ส่งคืน
long

มีโมดูลล้มเหลว

public boolean hasModuleFailed ()

คืนค่า True หากมีการเรียก testRunFailure บนโมดูล *

ส่งคืน
boolean

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

public int neededDevices ()

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

ส่งคืน
int

จำนวนการทดสอบ

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 ในกรณีที่อุปกรณ์ออฟไลน์

วิ่งเตรียมการ

public Throwable runPreparation (boolean includeSuitePreparers)

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

พารามิเตอร์
includeSuitePreparers boolean : ตั้งค่าเป็น true เพื่อเรียกใช้ตัวเตรียมระดับชุด

ส่งคืน
Throwable ERROR(/Throwable) ของข้อยกเว้นใด ๆ ที่เกิดขึ้นเมื่อเรียกใช้ตัวเตรียม

ชุดสร้าง

public void setBuild (IBuildInfo build)

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

พารามิเตอร์
build IBuildInfo

setCollectTestsOnly

public void setCollectTestsOnly (boolean collectTestsOnly)

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

ชุดอุปกรณ์

public void setDevice (ITestDevice device)

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

พารามิเตอร์
device ITestDevice

setEnableDynamicดาวน์โหลด

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

TransferSuiteLevelOptions

public void transferSuiteLevelOptions (IConfiguration mSuiteConfiguration)

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

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

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

มีการทดสอบ

protected boolean hasTests ()

คืนค่า True หากโมดูลยังมี IRemoteTest ให้รันในกลุ่มของมัน เป็นอย่างอื่น

ส่งคืน
boolean