ExecutableBaseTest
public
abstract
class
ExecutableBaseTest
extends Object
implements
IAbiReceiver,
IConfigurationReceiver,
IDiscoverDependencies,
IRemoteTest,
IRuntimeHintProvider,
IShardableTest,
ITestCollector,
ITestFilterReceiver
| java.lang.Object | |
| ↳ | com.android.tradefed.testtype.binary.ExecutableBaseTest |
คลาสพื้นฐานสําหรับการทดสอบรูปแบบที่เรียกใช้ได้ เช่น ไฟล์ไบนารี สคริปต์เชลล์
สรุป
ช่อง | |
|---|---|
public
static
final
String |
NO_BINARY_ERROR
|
ตัวสร้างแบบสาธารณะ | |
|---|---|
ExecutableBaseTest()
|
|
เมธอดสาธารณะ | |
|---|---|
void
|
addAllExcludeFilters(
เพิ่ม |
void
|
addAllIncludeFilters(
เพิ่ม |
void
|
addExcludeFilter(String filter)
เพิ่มตัวกรองการทดสอบที่จะยกเว้น |
void
|
addIncludeFilter(String filter)
เพิ่มตัวกรองการทดสอบที่จะรวม |
void
|
clearExcludeFilters()
ลบตัวกรองการยกเว้นทั้งหมดที่ติดตามอยู่ในขณะนี้ |
void
|
clearIncludeFilters()
ลบตัวกรองรวมทั้งหมดที่ติดตามอยู่ในปัจจุบัน |
abstract
String
|
findBinary(String binary)
ค้นหาไบนารีเพื่อเรียกใช้ |
IAbi
|
getAbi()
|
boolean
|
getCollectTestsOnly()
|
|
getExcludeFilters()
แสดงผล |
|
getIncludeFilters()
แสดงผล |
final
long
|
getRuntimeHint()
แสดงรันไทม์ที่คาดไว้ของการทดสอบเป็นมิลลิวินาที |
|
reportDependencies()
|
void
|
run(TestInformation testInfo, ITestInvocationListener listener)
เรียกใช้การทดสอบและรายงานผลลัพธ์ไปยังผู้ฟัง |
abstract
void
|
runBinary(String binaryPath, ITestInvocationListener listener, TestDescription description)
เรียกใช้ไบนารีที่เส้นทางที่ระบุ |
final
void
|
setAbi(IAbi abi)
|
final
void
|
setCollectTestsOnly(boolean shouldCollectTest)
เปิดหรือปิดใช้โหมดการเก็บรวบรวมการทดสอบ |
void
|
setConfiguration(IConfiguration configuration)
แทรก |
FailureDescription
|
shouldAbortRun(TestDescription description)
ตรวจสอบว่าควรสิ้นสุดการทดสอบก่อนกำหนดหรือไม่ |
final
|
split(int shardHint)
|
วิธีการที่มีการป้องกัน | |
|---|---|
boolean
|
doesRunBinaryGenerateTestResults()
|
boolean
|
doesRunBinaryGenerateTestRuns()
|
|
getAllTestCommands()
แปลง mBinaryPaths เป็น mTestCommands เพื่อความสอดคล้อง |
IConfiguration
|
getConfiguration()
แสดงการกำหนดค่าการทดสอบ |
TestDescription[]
|
getFilterDescriptions(
|
String
|
getModuleId(IInvocationContext context)
|
long
|
getTimeoutPerBinaryMs()
|
boolean
|
isTestFailed(String testName)
|
ช่อง
NO_BINARY_ERROR
public static final String NO_BINARY_ERROR
ตัวสร้างแบบสาธารณะ
ExecutableBaseTest
public ExecutableBaseTest ()
เมธอดสาธารณะ
addAllExcludeFilters
public void addAllExcludeFilters (filters)
เพิ่ม ERROR(/Set) ของตัวกรองการทดสอบที่จะยกเว้น
| พารามิเตอร์ | |
|---|---|
filters |
|
addAllIncludeFilters
public void addAllIncludeFilters (filters)
เพิ่ม ERROR(/Set) ของตัวกรองการทดสอบที่จะรวม
| พารามิเตอร์ | |
|---|---|
filters |
|
addExcludeFilter
public void addExcludeFilter (String filter)
เพิ่มตัวกรองการทดสอบที่จะยกเว้น
| พารามิเตอร์ | |
|---|---|
filter |
String |
addIncludeFilter
public void addIncludeFilter (String filter)
เพิ่มตัวกรองการทดสอบที่จะรวม
| พารามิเตอร์ | |
|---|---|
filter |
String |
clearExcludeFilters
public void clearExcludeFilters ()
ลบตัวกรองการยกเว้นทั้งหมดที่ติดตามอยู่ในขณะนี้
clearIncludeFilters
public void clearIncludeFilters ()
ลบตัวกรองรวมทั้งหมดที่ติดตามอยู่ในปัจจุบัน
findBinary
public abstract String findBinary (String binary)
ค้นหาไบนารีเพื่อเรียกใช้
| พารามิเตอร์ | |
|---|---|
binary |
String: เส้นทางของไฟล์ไบนารีหรือเพียงแค่ชื่อไฟล์ไบนารี |
| คิกรีเทิร์น | |
|---|---|
String |
เส้นทางไปยังไบนารี หรือค่าว่างหากไม่พบ |
| การโยน | |
|---|---|
DeviceNotAvailableException |
|
getCollectTestsOnly
public boolean getCollectTestsOnly ()
| คิกรีเทิร์น | |
|---|---|
boolean |
|
getExcludeFilters
publicgetExcludeFilters ()
แสดงผล ERROR(/Set) ของตัวกรองการยกเว้นปัจจุบัน
| คิกรีเทิร์น | |
|---|---|
|
|
getRuntimeHint
public final long getRuntimeHint ()
แสดงรันไทม์ที่คาดไว้ของการทดสอบเป็นมิลลิวินาที ระบบจะใช้เวลานี้เพื่อจัดสรรภาระงานให้กับการดำเนินการแบบแยกกลุ่ม
| คิกรีเทิร์น | |
|---|---|
long |
|
reportDependencies
publicreportDependencies ()
| คิกรีเทิร์น | |
|---|---|
|
|
โฮมรัน
public void run (TestInformation testInfo, ITestInvocationListener listener)
เรียกใช้การทดสอบและรายงานผลลัพธ์ไปยังผู้ฟัง
| พารามิเตอร์ | |
|---|---|
testInfo |
TestInformation: ออบเจ็กต์ TestInformation ที่มีข้อมูลที่เป็นประโยชน์ต่อการทดสอบ |
listener |
ITestInvocationListener: ITestInvocationListener ของผลการทดสอบ |
| การโยน | |
|---|---|
DeviceNotAvailableException |
|
runBinary
public abstract void runBinary (String binaryPath,
ITestInvocationListener listener,
TestDescription description)เรียกใช้ไบนารีที่เส้นทางที่ระบุ
| พารามิเตอร์ | |
|---|---|
binaryPath |
String: เส้นทางของไบนารี |
listener |
ITestInvocationListener: ตำแหน่งที่ควรรายงานผลลัพธ์ |
description |
TestDescription: อยู่ระหว่างการทดสอบ |
| การโยน | |
|---|---|
DeviceNotAvailableException |
|
setCollectTestsOnly
public final void setCollectTestsOnly (boolean shouldCollectTest)
เปิดหรือปิดใช้โหมดการเก็บรวบรวมการทดสอบ
setConfiguration
public void setConfiguration (IConfiguration configuration)
แทรก IConfiguration ที่ใช้อยู่
| พารามิเตอร์ | |
|---|---|
configuration |
IConfiguration |
shouldAbortRun
public FailureDescription shouldAbortRun (TestDescription description)
ตรวจสอบว่าควรสิ้นสุดการทดสอบก่อนกำหนดหรือไม่
| พารามิเตอร์ | |
|---|---|
description |
TestDescription: อยู่ระหว่างการทดสอบ |
| คิกรีเทิร์น | |
|---|---|
FailureDescription |
FailureDescription หากการเรียกใช้ลูปควรสิ้นสุด |
แยก
public finalsplit (int shardHint)
split() เวอร์ชันอื่น ซึ่งระบุ shardCount ที่พยายามเรียกใช้ด้วย ซึ่งมีประโยชน์สำหรับโปรแกรมทดสอบบางรายการที่ตัดสินใจแบบตามอำเภอใจไม่ได้ในบางครั้ง
| พารามิเตอร์ | |
|---|---|
shardHint |
int: จํานวนชาร์ดที่พยายาม |
| คิกรีเทิร์น | |
|---|---|
|
ชุดการทดสอบย่อยที่จะเรียกใช้แยกกัน หรือ null หากการทดสอบไม่สามารถแบ่งกลุ่มได้ในขณะนี้ |
วิธีการที่มีการป้องกัน
doesRunBinaryGenerateTestResults
protected boolean doesRunBinaryGenerateTestResults ()
| คิกรีเทิร์น | |
|---|---|
boolean |
|
doesRunBinaryGenerateTestRuns
protected boolean doesRunBinaryGenerateTestRuns ()
| คิกรีเทิร์น | |
|---|---|
boolean |
|
getAllTestCommands
protectedgetAllTestCommands ()
แปลง mBinaryPaths เป็น mTestCommands เพื่อความสอดคล้อง
| คิกรีเทิร์น | |
|---|---|
|
MapERROR(/LinkedHashMap)<string, string=""> ของ testCommands</string,> |
getConfiguration
protected IConfiguration getConfiguration ()
แสดงการกำหนดค่าการทดสอบ
| คิกรีเทิร์น | |
|---|---|
IConfiguration |
IConfiguration |
getFilterDescriptions
protected TestDescription[] getFilterDescriptions (testCommands)
| พารามิเตอร์ | |
|---|---|
testCommands |
|
| คิกรีเทิร์น | |
|---|---|
TestDescription[] |
|
getModuleId
protected String getModuleId (IInvocationContext context)
| พารามิเตอร์ | |
|---|---|
context |
IInvocationContext |
| คิกรีเทิร์น | |
|---|---|
String |
|
getTimeoutPerBinaryMs
protected long getTimeoutPerBinaryMs ()
| คิกรีเทิร์น | |
|---|---|
long |
การหมดเวลาที่มีผลกับไบนารีแต่ละรายการสําหรับการดําเนินการ |
isTestFailed
protected boolean isTestFailed (String testName)
| พารามิเตอร์ | |
|---|---|
testName |
String |
| คิกรีเทิร์น | |
|---|---|
boolean |
|