InvocationExecution
public
class
InvocationExecution
extends Object
implements
IInvocationExecution
| java.lang.Object | |
| ↳ | com.android.tradefed.invoker.InvocationExecution |
คลาสที่อธิบายขั้นตอนการเรียกใช้ทั้งหมด ได้แก่ การดาวน์โหลดบิลด์, target_prep, การเรียกใช้การทดสอบ และการล้างข้อมูล
ขยายเพื่อลบล้างลักษณะการทำงานเริ่มต้นของบางขั้นตอนได้ ลำดับของขั้นตอนจะขึ้นอยู่กับ
TestInvocation
สรุป
ค่าคงที่ | |
|---|---|
String |
ADB_VERSION_KEY
|
String |
JAVA_CLASSPATH_KEY
|
String |
JAVA_VERSION_KEY
|
เครื่องมือสร้างสาธารณะ | |
|---|---|
InvocationExecution()
|
|
เมธอดสาธารณะ | |
|---|---|
void
|
cleanUpBuilds(IInvocationContext context, IConfiguration config)
ดำเนินการตามขั้นตอนการล้างข้อมูล build_provider |
void
|
doCleanUp(IInvocationContext context, IConfiguration config, Throwable exception)
เรียกใช้ขั้นตอนการล้างข้อมูล target_preparer และ multi_target_preparer |
void
|
doSetup(TestInformation testInfo, IConfiguration config, ITestLogger listener)
เรียกใช้ขั้นตอนการตั้งค่า target_preparer และ multi_target_preparer |
void
|
doTeardown(TestInformation testInfo, IConfiguration config, ITestLogger logger, Throwable exception)
ทําตามขั้นตอนการล้างข้อมูล target_preparer และ multi_target_preparer |
boolean
|
fetchBuild(TestInformation testInfo, IConfiguration config, IRescheduler rescheduler, ITestInvocationListener listener)
เรียกใช้ขั้นตอน build_provider ของการเรียกใช้ |
void
|
reportLogs(ITestDevice device, ITestLogger listener, TestInvocation.Stage stage)
รายงานบันทึกอุปกรณ์บางอย่างในขั้นตอนต่างๆ ของการเรียกใช้ |
void
|
runDevicePostInvocationTearDown(IInvocationContext context, IConfiguration config, Throwable exception)
เรียกใช้ |
void
|
runDevicePreInvocationSetup(IInvocationContext context, IConfiguration config, ITestLogger logger)
เรียกใช้ |
void
|
runTests(TestInformation info, IConfiguration config, ITestInvocationListener listener)
ทำการทดสอบ |
boolean
|
shardConfig(IConfiguration config, TestInformation testInfo, IRescheduler rescheduler, ITestLogger logger)
พยายามแบ่งการกำหนดค่าออกเป็นการกำหนดค่าย่อยเพื่อกำหนดเวลาใหม่ให้ทำงานใน ทรัพยากรหลายรายการแบบขนาน |
วิธีการที่ได้รับการป้องกัน | |
|---|---|
void
|
collectAutoInfo(IConfiguration config, TestInformation info)
รวบรวมข้อมูลบางอย่างโดยอัตโนมัติในอุปกรณ์หลักที่อยู่ระหว่างการทดสอบ |
IShardHelper
|
createShardHelper()
สร้างและส่งคืน |
void
|
customizeDevicePreInvocation(IConfiguration config, IInvocationContext context)
ให้โอกาสในการปรับแต่งอุปกรณ์บางอย่างก่อน preInvocationSetup |
String
|
getAdbVersion()
แสดงเวอร์ชัน adb ที่ใช้สำหรับการเรียกใช้ |
|
getLabPreparersToRun(IConfiguration config, String deviceName)
ดึงข้อมูลรายการผู้เตรียมห้องทดลองเพื่อเรียกใช้ในอุปกรณ์นี้ |
|
getTargetPreparersToRun(IConfiguration config, String deviceName)
ดึงข้อมูลรายการโปรแกรมเตรียมเป้าหมายเพื่อเรียกใช้ในอุปกรณ์นี้ |
void
|
linkExternalDirs(IBuildInfo info, TestInformation testInfo)
|
void
|
logHostAdb(IConfiguration config, ITestLogger logger)
รวบรวมบันทึกจาก $TMPDIR/adb.$UID.log |
Throwable
|
runPreparersTearDown(TestInformation testInfo, ITestDevice device, String deviceName, int deviceIndex, ITestLogger logger, Throwable exception,
|
void
|
setTestTag(IBuildInfo info, IConfiguration config)
จัดการการตั้งค่าแท็กทดสอบในข้อมูลการสร้าง |
ค่าคงที่
ADB_VERSION_KEY
public static final String ADB_VERSION_KEY
ค่าคงที่ "adb_version"
JAVA_CLASSPATH_KEY
public static final String JAVA_CLASSPATH_KEY
ค่าคงที่: "java_classpath"
JAVA_VERSION_KEY
public static final String JAVA_VERSION_KEY
ค่าคงที่: "java_version"
เครื่องมือสร้างสาธารณะ
InvocationExecution
public InvocationExecution ()
เมธอดสาธารณะ
cleanUpBuilds
public void cleanUpBuilds (IInvocationContext context, IConfiguration config)
ดำเนินการตามขั้นตอนการล้างข้อมูล build_provider เชื่อมโยงกับการดึงข้อมูลบิลด์
| พารามิเตอร์ | |
|---|---|
context |
IInvocationContext: IInvocationContext ของการเรียกใช้ |
config |
IConfiguration: IConfiguration ของการทดสอบนี้ |
doCleanUp
public void doCleanUp (IInvocationContext context, IConfiguration config, Throwable exception)
เรียกใช้ขั้นตอนการล้างข้อมูล target_preparer และ multi_target_preparer อุปกรณ์จะล้างข้อมูล
| พารามิเตอร์ | |
|---|---|
context |
IInvocationContext: IInvocationContext ของการเรียกใช้ |
config |
IConfiguration: IConfiguration ของการทดสอบนี้ |
exception |
Throwable: ข้อยกเว้นเดิมที่เกิดจากการทดสอบที่กำลังทำงาน |
doSetup
public void doSetup (TestInformation testInfo, IConfiguration config, ITestLogger listener)
เรียกใช้ขั้นตอนการตั้งค่า target_preparer และ multi_target_preparer ตั้งค่าอุปกรณ์ทั้งหมด ที่จำเป็นสำหรับการทดสอบ
| พารามิเตอร์ | |
|---|---|
testInfo |
TestInformation: TestInformation ของการเรียกใช้ |
config |
IConfiguration: IConfiguration ของการทดสอบนี้ |
listener |
ITestLogger: ITestLogger เพื่อรายงานบันทึกการตั้งค่าที่ไม่สำเร็จ |
| การขว้าง | |
|---|---|
BuildError |
|
DeviceNotAvailableException |
|
TargetSetupError |
|
doTeardown
public void doTeardown (TestInformation testInfo, IConfiguration config, ITestLogger logger, Throwable exception)
ทําตามขั้นตอนการล้างข้อมูล target_preparer และ multi_target_preparer อุปกรณ์ฉีก ลงที่เชื่อมโยงกับการตั้งค่า
| พารามิเตอร์ | |
|---|---|
testInfo |
TestInformation: TestInformation ของการเรียกใช้ |
config |
IConfiguration: IConfiguration ของการทดสอบนี้ |
logger |
ITestLogger: ITestLogger เพื่อรายงานบันทึก |
exception |
Throwable: ข้อยกเว้นเดิมที่เกิดจากการทดสอบที่กำลังทำงาน |
fetchBuild
public boolean fetchBuild (TestInformation testInfo, IConfiguration config, IRescheduler rescheduler, ITestInvocationListener listener)
เรียกใช้ขั้นตอน build_provider ของการเรียกใช้
| พารามิเตอร์ | |
|---|---|
testInfo |
TestInformation: TestInformation ของการเรียกใช้ |
config |
IConfiguration: IConfiguration ของการทดสอบนี้ |
rescheduler |
IRescheduler: IRescheduler สำหรับการกำหนดเวลาใหม่ของส่วนการเรียกใช้เพื่อ
ดำเนินการในทรัพยากรอื่น |
listener |
ITestInvocationListener: ITestInvocation เพื่อรายงานการดาวน์โหลดบิลด์ไม่สำเร็จ |
| คิกรีเทิร์น | |
|---|---|
boolean |
เป็นจริงหากเราดาวน์โหลดบิลด์สำเร็จ ไม่เช่นนั้นจะเป็นเท็จ |
| การขว้าง | |
|---|---|
BuildRetrievalError |
|
DeviceNotAvailableException |
|
reportLogs
public void reportLogs (ITestDevice device, ITestLogger listener, TestInvocation.Stage stage)
รายงานบันทึกอุปกรณ์บางอย่างในขั้นตอนต่างๆ ของการเรียกใช้ เช่น logcat
| พารามิเตอร์ | |
|---|---|
device |
ITestDevice: อุปกรณ์ที่จะรายงานบันทึก |
listener |
ITestLogger: เครื่องบันทึกสำหรับบันทึก |
stage |
TestInvocation.Stage: สถานะของการเรียกใช้ที่เราอยู่ |
runDevicePostInvocationTearDown
public void runDevicePostInvocationTearDown (IInvocationContext context, IConfiguration config, Throwable exception)
เรียกใช้ ITestDevice.postInvocationTearDown(Throwable) สำหรับแต่ละส่วนของอุปกรณ์
การเรียกใช้
| พารามิเตอร์ | |
|---|---|
context |
IInvocationContext: IInvocationContext ของการเรียกใช้ |
config |
IConfiguration: IConfiguration ของการทดสอบนี้ |
exception |
Throwable: ข้อยกเว้นเดิมที่การทดสอบเรียกใช้ หากมี |
runDevicePreInvocationSetup
public void runDevicePreInvocationSetup (IInvocationContext context, IConfiguration config, ITestLogger logger)
เรียกใช้ ERROR(ITestDevice.preInvocationSetup(IBuildInfo)/com.android.tradefed.device.ITestDevice#preInvocationSetup(com.android.tradefed.build.IBuildInfo) ITestDevice.preInvocationSetup(IBuildInfo)) สำหรับแต่ละส่วนของอุปกรณ์
การเรียกใช้
| พารามิเตอร์ | |
|---|---|
context |
IInvocationContext: IInvocationContext ของการเรียกใช้ |
config |
IConfiguration: IConfiguration ของการทดสอบนี้ |
logger |
ITestLogger: ITestLogger เพื่อรายงานบันทึก |
| การขว้าง | |
|---|---|
DeviceNotAvailableException |
|
TargetSetupError |
|
runTests
public void runTests (TestInformation info, IConfiguration config, ITestInvocationListener listener)
ทำการทดสอบ
| พารามิเตอร์ | |
|---|---|
info |
TestInformation: TestInformation ที่ใช้เรียกใช้การทดสอบ |
config |
IConfiguration: IConfiguration ที่จะเรียกใช้ |
listener |
ITestInvocationListener: ITestInvocationListener ของผลการทดสอบ |
shardConfig
public boolean shardConfig (IConfiguration config, TestInformation testInfo, IRescheduler rescheduler, ITestLogger logger)
พยายามแบ่งการกำหนดค่าออกเป็นการกำหนดค่าย่อยเพื่อกำหนดเวลาใหม่ให้ทำงานใน ทรัพยากรหลายรายการแบบขนาน
หากจำนวน Shard มากกว่า 1 ระบบจะสร้างการกำหนดค่าสำหรับแต่ละ Shard โดยการตั้งค่าดัชนี Shard และกำหนดเวลาใหม่ หากไม่ได้ตั้งค่าจำนวน Shard ระบบจะใช้ค่าสำรองเป็น
IShardHelper.shardConfig
| พารามิเตอร์ | |
|---|---|
config |
IConfiguration: IConfiguration ปัจจุบัน |
testInfo |
TestInformation: TestInformation ที่เก็บข้อมูลการทดสอบ |
rescheduler |
IRescheduler: IRescheduler |
logger |
ITestLogger: ITestLogger ที่ใช้ในการบันทึกไฟล์บันทึกระหว่างการแบ่งข้อมูล |
| คิกรีเทิร์น | |
|---|---|
boolean |
จริง หากมีการแบ่งการทดสอบ หรือส่งคืน false |
วิธีการที่ได้รับการป้องกัน
collectAutoInfo
protected void collectAutoInfo (IConfiguration config, TestInformation info)
รวบรวมข้อมูลบางอย่างโดยอัตโนมัติในอุปกรณ์หลักที่อยู่ระหว่างการทดสอบ
| พารามิเตอร์ | |
|---|---|
config |
IConfiguration |
info |
TestInformation |
| การขว้าง | |
|---|---|
DeviceNotAvailableException |
|
createShardHelper
protected IShardHelper createShardHelper ()
สร้างและส่งคืน IShardHelper ที่จะใช้
| คิกรีเทิร์น | |
|---|---|
IShardHelper |
|
customizeDevicePreInvocation
protected void customizeDevicePreInvocation (IConfiguration config, IInvocationContext context)
ให้โอกาสในการปรับแต่งอุปกรณ์บางอย่างก่อน preInvocationSetup
| พารามิเตอร์ | |
|---|---|
config |
IConfiguration: การกำหนดค่าของการเรียกใช้ |
context |
IInvocationContext: บริบทการเรียกใช้ปัจจุบัน |
getAdbVersion
protected String getAdbVersion ()
แสดงเวอร์ชัน adb ที่ใช้สำหรับการเรียกใช้
| คิกรีเทิร์น | |
|---|---|
String |
|
getLabPreparersToRun
protectedgetLabPreparersToRun (IConfiguration config, String deviceName)
ดึงข้อมูลรายชื่อผู้เตรียมห้องทดลองเพื่อเรียกใช้ในอุปกรณ์นี้
แทนที่ในคลาสแซนด์บ็อกซ์เพื่อจำกัดไม่ให้มีการเรียกใช้เครื่องมือเตรียมห้องทดลองภายในแซนด์บ็อกซ์ ย่อย
| พารามิเตอร์ | |
|---|---|
config |
IConfiguration |
deviceName |
String |
| คิกรีเทิร์น | |
|---|---|
|
|
getTargetPreparersToRun
protectedgetTargetPreparersToRun (IConfiguration config, String deviceName)
ดึงข้อมูลรายการโปรแกรมเตรียมเป้าหมายเพื่อเรียกใช้ในอุปกรณ์นี้
แทนที่ในคลาสแซนด์บ็อกซ์เพื่อจำกัดไม่ให้มีการเรียกใช้เครื่องมือเตรียมห้องทดลองภายในแซนด์บ็อกซ์ ย่อย
| พารามิเตอร์ | |
|---|---|
config |
IConfiguration |
deviceName |
String |
| คิกรีเทิร์น | |
|---|---|
|
|
linkExternalDirs
protected void linkExternalDirs (IBuildInfo info, TestInformation testInfo)
| พารามิเตอร์ | |
|---|---|
info |
IBuildInfo |
testInfo |
TestInformation |
logHostAdb
protected void logHostAdb (IConfiguration config, ITestLogger logger)
รวบรวมบันทึกจาก $TMPDIR/adb.$UID.log
| พารามิเตอร์ | |
|---|---|
config |
IConfiguration |
logger |
ITestLogger |
runPreparersTearDown
protected Throwable runPreparersTearDown (TestInformation testInfo, ITestDevice device, String deviceName, int deviceIndex, ITestLogger logger, Throwable exception,preparersToRun, trackPreparersMap)
| พารามิเตอร์ | |
|---|---|
testInfo |
TestInformation |
device |
ITestDevice |
deviceName |
String |
deviceIndex |
int |
logger |
ITestLogger |
exception |
Throwable |
preparersToRun |
|
trackPreparersMap |
|
| คิกรีเทิร์น | |
|---|---|
Throwable |
|
setTestTag
protected void setTestTag (IBuildInfo info, IConfiguration config)
จัดการการตั้งค่าแท็กทดสอบในข้อมูลการสร้าง
| พารามิเตอร์ | |
|---|---|
info |
IBuildInfo |
config |
IConfiguration |