คำจำกัดความของโมดูล

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

คุณสมบัตินี้ถูกตั้งค่าเป็นจริงหากผลลัพธ์ของโมดูลทดสอบถูกแคชไว้

public static final String MODULE_CONTROLLER

public static final String MODULE_EXTERNAL_DEPENDENCIES

public static final String MODULE_ID

ID โมดูล ชื่อที่จะใช้เพื่อระบุโมดูลที่ไม่ซ้ำระหว่าง testRunStart

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 SPARSE_MODULE

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

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 ที่จะใช้โดยโมดูล

void setRecoverVirtualDevice (boolean recoverVirtualDevice)

ชุดควรกู้คืนอุปกรณ์เสมือน

final void setRetryDecision ( IRetryDecision decision)

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

boolean shouldRecoverVirtualDevice ()

ส่งคืนหากเราควรกู้คืนอุปกรณ์เสมือน

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_CACHED

public static final String MODULE_CACHED

คุณสมบัตินี้ถูกตั้งค่าเป็นจริงหากผลลัพธ์ของโมดูลทดสอบถูกแคชไว้

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 โมดูล ชื่อที่จะใช้เพื่อระบุโมดูลที่ไม่ซ้ำระหว่าง testRunStart โดยปกติจะเป็นการรวมกันของ 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

ลองอีกครั้ง_TIME

public static final String RETRY_TIME

SPARSE_MODULE

public static final String SPARSE_MODULE

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

TEAR_DOWN_TIME

public static final String TEAR_DOWN_TIME

ทดสอบ_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

getId

public String getId ()

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

การส่งคืน
String

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

public IConfiguration getModuleConfiguration ()

การส่งคืน
IConfiguration

getModuleInvocationContext

public IInvocationContext getModuleInvocationContext ()

ส่งกลับ IInvocationContext ที่เกี่ยวข้องกับโมดูล

การส่งคืน
IInvocationContext

getRequiredTokens

public  getRequiredTokens (TestInformation testInfo)

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

การส่งคืน

รับ RuntimeHint

public long getRuntimeHint ()

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

การส่งคืน
long

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

public boolean hasModuleFailed ()

คืนค่า True ถ้ามีการเรียกใช้ testRunFailure บนโมดูล *

การส่งคืน
boolean

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

public int neededDevices ()

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

การส่งคืน
int

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

public int numTests ()

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

การส่งคืน
int

รายงาน NotExecuted

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 : Listener เฉพาะเพื่อรวบรวมบันทึกเกี่ยวกับ testFail สามารถเป็นโมฆะได้

maxRunLimit int : จำนวนการรันสูงสุดสำหรับแต่ละกรณีทดสอบ

ขว้าง
DeviceNotAvailableException ในกรณีที่อุปกรณ์ออฟไลน์

วิ่ง

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

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

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

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

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

failureListener TestFailureListener : Listener เฉพาะเพื่อรวบรวมบันทึกเกี่ยวกับ 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 Throwable ข้อยกเว้นใดๆ ที่เกิดขึ้นได้เมื่อเรียกใช้ตัวจัดเตรียม

ชุดสร้าง

public void setBuild (IBuildInfo build)

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

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

setCollectTestsOnly

public void setCollectTestsOnly (boolean collectTestsOnly)

เปิดใช้งานหรือปิดใช้งานโหมดการรวบรวมการทดสอบ

ตั้งค่าอุปกรณ์

public void setDevice (ITestDevice device)

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

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

ตั้งค่าเปิดใช้งานไดนามิกดาวน์โหลด

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

setRecoverVirtualDevice

public void setRecoverVirtualDevice (boolean recoverVirtualDevice)

ชุดควรกู้คืนอุปกรณ์เสมือน

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

ตั้งค่า RetryDecision

public final void setRetryDecision (IRetryDecision decision)

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

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

ควรกู้คืนอุปกรณ์เสมือน

public boolean shouldRecoverVirtualDevice ()

ส่งคืนหากเราควรกู้คืนอุปกรณ์เสมือน

การส่งคืน
boolean

toString

public String toString ()

การส่งคืน
String

TransferSuiteLevelOptions

public void transferSuiteLevelOptions (IConfiguration mSuiteConfiguration)

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

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

วิธีการที่ได้รับการป้องกัน

มีการทดสอบ

protected boolean hasTests ()

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

การส่งคืน
boolean