TestInvocation
public
class
TestInvocation
extends Object
implements
ITestInvocation
| java.lang.Object | |
| ↳ | com.android.tradefed.invoker.TestInvocation |
การติดตั้งใช้งาน ITestInvocation โดยค่าเริ่มต้น
โหลดออบเจ็กต์หลักตาม IConfiguration
- เรียกข้อมูลบิลด์
- เตรียมเป้าหมาย
- เรียกใช้การทดสอบ
- รายงานผลลัพธ์
สรุป
ค่าคงที่ | |
|---|---|
long |
AVAILABILITY_CHECK_TIMEOUT
|
String |
COMMAND_ARGS_KEY
คีย์ของแอตทริบิวต์อาร์กิวเมนต์บรรทัดคำสั่ง |
String |
INVOCATION_EXTERNAL_DEPENDENCIES
|
String |
TRADEFED_CONFIG_NAME
|
String |
TRADEFED_END_HOST_LOG
|
String |
TRADEFED_INVOC_COMPLETE_HOST_LOG
|
String |
TRADEFED_LOG_NAME
|
เครื่องมือสร้างสาธารณะ | |
|---|---|
TestInvocation()
|
|
เมธอดสาธารณะ | |
|---|---|
static
IBuildInfo
|
backFillBuildInfoForReporting(String commandLine)
โปรแกรมช่วยที่ใช้บรรทัดคำสั่งเพื่อกรอกข้อมูลย้อนหลังสำหรับ |
static
FailureDescription
|
createFailureFromException(Throwable exception, TestRecordProto.FailureStatus defaultStatus)
สร้าง |
IInvocationExecution
|
createInvocationExec(TestInvocation.RunMode mode)
สร้างเส้นทางการเรียกใช้ที่ควรปฏิบัติตาม |
static
String
|
getDeviceLogName(TestInvocation.Stage stage)
|
static
String
|
getEmulatorLogName(TestInvocation.Stage stage)
|
ITestInvocation.ExitInformation
|
getExitInfo()
ข้อมูลการออกจากการเรียกใช้ที่ระบุ |
void
|
invoke(IInvocationContext context, IConfiguration config, IRescheduler rescheduler, ITestInvocationListener... extraListeners)
เรียกใช้การทดสอบ |
static
boolean
|
isSubprocess(IConfiguration config)
แสดงค่าเป็นจริงหากการเรียกใช้ปัจจุบันอยู่ในขอบเขตของกระบวนการย่อย |
void
|
notifyInvocationForceStopped(String message, ErrorIdentifier errorId)
แจ้งให้ |
void
|
notifyInvocationStopped(String message)
แจ้งให้ |
static
void
|
printStageDelimiter(TestInvocation.Stage phase, boolean end)
พิมพ์ตัวคั่นสำหรับขั้นตอนที่กำหนดของการเรียกใช้ |
void
|
registerExecutionFiles(ExecutionFiles executionFiles)
|
void
|
setClearcutClient(ClearcutClient client)
ส่งต่อไคลเอ็นต์ Clearcut เพื่อรายงานเมตริก |
static
boolean
|
shouldSkipBugreportError(Throwable t)
เมธอด Helper ที่ระบุข้อผิดพลาดเมื่อควรข้ามรายงานข้อบกพร่อง |
String
|
toString()
|
วิธีการที่ได้รับการป้องกัน | |
|---|---|
void
|
addInvocationMetric(InvocationMetricLogger.InvocationMetricKey key, String value)
|
void
|
addInvocationMetric(InvocationMetricLogger.InvocationMetricKey key, long value)
|
void
|
applyAutomatedReporters(IConfiguration config)
|
void
|
setExitCode(CommandRunner.ExitCode code, Throwable stack)
Helper to set the exit code. |
ค่าคงที่
AVAILABILITY_CHECK_TIMEOUT
public static final long AVAILABILITY_CHECK_TIMEOUT
ค่าคงที่ 180000 (0x000000000002bf20)
COMMAND_ARGS_KEY
public static final String COMMAND_ARGS_KEY
คีย์ของแอตทริบิวต์อาร์กิวเมนต์บรรทัดคำสั่ง
ค่าคงที่: "command_line_args"
INVOCATION_EXTERNAL_DEPENDENCIES
public static final String INVOCATION_EXTERNAL_DEPENDENCIES
ค่าคงที่: "invocation-external-dependencies"
TRADEFED_CONFIG_NAME
public static final String TRADEFED_CONFIG_NAME
ค่าคงที่ "tradefed-expanded-config"
TRADEFED_END_HOST_LOG
public static final String TRADEFED_END_HOST_LOG
ค่าคงที่: "end_host_log"
TRADEFED_INVOC_COMPLETE_HOST_LOG
public static final String TRADEFED_INVOC_COMPLETE_HOST_LOG
ค่าคงที่ "invoc_complete_host_log"
TRADEFED_LOG_NAME
public static final String TRADEFED_LOG_NAME
ค่าคงที่: "host_log"
เครื่องมือสร้างสาธารณะ
TestInvocation
public TestInvocation ()
เมธอดสาธารณะ
backFillBuildInfoForReporting
public static IBuildInfo backFillBuildInfoForReporting (String commandLine)
โปรแกรมช่วยที่ใช้บรรทัดคำสั่งเพื่อกรอกข้อมูลย้อนหลังสำหรับ IBuildInfo เพื่อการรายงานในกรณีที่
ดาวน์โหลดไม่สำเร็จ
| พารามิเตอร์ | |
|---|---|
commandLine |
String |
| คิกรีเทิร์น | |
|---|---|
IBuildInfo |
|
createFailureFromException
public static FailureDescription createFailureFromException (Throwable exception, TestRecordProto.FailureStatus defaultStatus)
สร้าง FailureDescription จากข้อยกเว้นการเรียกใช้
| พารามิเตอร์ | |
|---|---|
exception |
Throwable: ข้อยกเว้นในการแปลง |
defaultStatus |
TestRecordProto.FailureStatus: สถานะที่จะใช้โดยค่าเริ่มต้นหากข้อยกเว้นไม่ใช่ IHarnessException |
| คิกรีเทิร์น | |
|---|---|
FailureDescription |
|
createInvocationExec
public IInvocationExecution createInvocationExec (TestInvocation.RunMode mode)
สร้างเส้นทางการเรียกใช้ที่ควรปฏิบัติตาม
| พารามิเตอร์ | |
|---|---|
mode |
TestInvocation.RunMode: โหมดที่เรากำลังใช้งานอยู่ |
| คิกรีเทิร์น | |
|---|---|
IInvocationExecution |
IInvocationExecution ที่อธิบายการเรียกใช้ |
getDeviceLogName
public static String getDeviceLogName (TestInvocation.Stage stage)
| พารามิเตอร์ | |
|---|---|
stage |
TestInvocation.Stage |
| คิกรีเทิร์น | |
|---|---|
String |
|
getEmulatorLogName
public static String getEmulatorLogName (TestInvocation.Stage stage)
| พารามิเตอร์ | |
|---|---|
stage |
TestInvocation.Stage |
| คิกรีเทิร์น | |
|---|---|
String |
|
getExitInfo
public ITestInvocation.ExitInformation getExitInfo ()
ข้อมูลการออกจากการเรียกใช้ที่ระบุ
| คิกรีเทิร์น | |
|---|---|
ITestInvocation.ExitInformation |
|
เรียกใช้
public void invoke (IInvocationContext context, IConfiguration config, IRescheduler rescheduler, ITestInvocationListener... extraListeners)
เรียกใช้การทดสอบ
| พารามิเตอร์ | |
|---|---|
context |
IInvocationContext: IInvocationContext เพื่อทำการทดสอบ |
config |
IConfiguration: IConfiguration ของการทดสอบนี้ |
rescheduler |
IRescheduler: IRescheduler สำหรับการกำหนดเวลาใหม่ของส่วนการเรียกใช้เพื่อ
ดำเนินการในทรัพยากรอื่น |
extraListeners |
ITestInvocationListener: ITestInvocationListener ที่จะแจ้งเตือน นอกเหนือจากที่อยู่ใน
config |
| การขว้าง | |
|---|---|
DeviceNotAvailableException |
|
isSubprocess
public static boolean isSubprocess (IConfiguration config)
แสดงค่าเป็นจริงหากการเรียกใช้ปัจจุบันอยู่ในขอบเขตของกระบวนการย่อย
| พารามิเตอร์ | |
|---|---|
config |
IConfiguration |
| คิกรีเทิร์น | |
|---|---|
boolean |
|
notifyInvocationForceStopped
public void notifyInvocationForceStopped (String message,
ErrorIdentifier errorId)แจ้งให้ TestInvocation ทราบว่ามีการขอให้ TradeFed หยุดทำงาน
| พารามิเตอร์ | |
|---|---|
message |
String: ข้อความที่เชื่อมโยงกับการหยุดการเรียกใช้ |
errorId |
ErrorIdentifier: ตัวระบุที่เชื่อมโยงกับการหยุดทำงานโดยบังคับ |
notifyInvocationStopped
public void notifyInvocationStopped (String message)
แจ้งให้ TestInvocation ทราบว่า TradeFed จะปิดตัวในที่สุด
| พารามิเตอร์ | |
|---|---|
message |
String: ข้อความที่เชื่อมโยงกับการหยุดการเรียกใช้ |
printStageDelimiter
public static void printStageDelimiter (TestInvocation.Stage phase, boolean end)
พิมพ์ตัวคั่นสำหรับขั้นตอนที่กำหนดของการเรียกใช้
| พารามิเตอร์ | |
|---|---|
phase |
TestInvocation.Stage |
end |
boolean |
registerExecutionFiles
public void registerExecutionFiles (ExecutionFiles executionFiles)
| พารามิเตอร์ | |
|---|---|
executionFiles |
ExecutionFiles |
setClearcutClient
public void setClearcutClient (ClearcutClient client)
ส่งต่อไคลเอ็นต์ Clearcut เพื่อรายงานเมตริก
| พารามิเตอร์ | |
|---|---|
client |
ClearcutClient |
shouldSkipBugreportError
public static boolean shouldSkipBugreportError (Throwable t)
เมธอด Helper ที่ระบุข้อผิดพลาดเมื่อควรข้ามรายงานข้อบกพร่อง
| พารามิเตอร์ | |
|---|---|
t |
Throwable |
| คิกรีเทิร์น | |
|---|---|
boolean |
|
toString
public String toString ()
| คิกรีเทิร์น | |
|---|---|
String |
|
วิธีการที่ได้รับการป้องกัน
addInvocationMetric
protected void addInvocationMetric (InvocationMetricLogger.InvocationMetricKey key, String value)
| พารามิเตอร์ | |
|---|---|
key |
InvocationMetricLogger.InvocationMetricKey |
value |
String |
addInvocationMetric
protected void addInvocationMetric (InvocationMetricLogger.InvocationMetricKey key, long value)
| พารามิเตอร์ | |
|---|---|
key |
InvocationMetricLogger.InvocationMetricKey |
value |
long |
applyAutomatedReporters
protected void applyAutomatedReporters (IConfiguration config)
| พารามิเตอร์ | |
|---|---|
config |
IConfiguration |
setExitCode
protected void setExitCode (CommandRunner.ExitCode code, Throwable stack)
Helper to set the exit code. เปิดเผยเพื่อการทดสอบ
| พารามิเตอร์ | |
|---|---|
code |
CommandRunner.ExitCode |
stack |
Throwable |