TestInvocation

public class TestInvocation
extends Object implements ITestInvocation

java.lang.Object
   ↳ com.android.tradefed.invoker.TestInvocation


Phương thức triển khai mặc định của ITestInvocation.

Tải các đối tượng chính dựa trên IConfiguration – truy xuất bản dựng – chuẩn bị mục tiêu – chạy kiểm thử – báo cáo kết quả

Tóm tắt

Hằng số

long AVAILABILITY_CHECK_TIMEOUT

Trường

public static final String COMMAND_ARGS_KEY

Khoá của thuộc tính đối số dòng lệnh

public static final String INVOCATION_EXTERNAL_DEPENDENCIES

public static final String TRADEFED_CONFIG_NAME

public static final String TRADEFED_END_HOST_LOG

public static final String TRADEFED_INVOC_COMPLETE_HOST_LOG

public static final String TRADEFED_LOG_NAME

Hàm khởi tạo công khai

TestInvocation()

Phương thức công khai

static IBuildInfo backFillBuildInfoForReporting(String commandLine)

Trình trợ giúp sử dụng dòng lệnh để điền lại IBuildInfo để báo cáo trong trường hợp tải xuống không thành công.

static FailureDescription createFailureFromException(Throwable exception, TestRecordProto.FailureStatus defaultStatus)

Tạo FailureDescription từ một ngoại lệ gọi.

IInvocationExecution createInvocationExec(TestInvocation.RunMode mode)

Tạo đường dẫn gọi cần tuân theo.

static String getDeviceLogName(TestInvocation.Stage stage)
static String getEmulatorLogName(TestInvocation.Stage stage)
ITestInvocation.ExitInformation getExitInfo()

Thông tin thoát của lệnh gọi đã cho.

void invoke(IInvocationContext context, IConfiguration config, IRescheduler rescheduler, ITestInvocationListener... extraListeners)

Thực hiện lệnh gọi kiểm thử.

static boolean isSubprocess(IConfiguration config)

Trả về true nếu lệnh gọi hiện nằm trong phạm vi quy trình con.

void notifyInvocationForceStopped(String message, ErrorIdentifier errorId)

Thông báo cho TestInvocation rằng TradeFed đã được yêu cầu dừng.

void notifyInvocationStopped(String message)

Thông báo cho TestInvocation rằng TradeFed sẽ ngừng hoạt động.

static void printStageDelimiter(TestInvocation.Stage phase, boolean end)

In dấu phân cách cho một Giai đoạn nhất định của lệnh gọi.

void registerExecutionFiles(ExecutionFiles executionFiles)
void setClearcutClient(ClearcutClient client)

Chuyển tiếp ứng dụng clearcut để báo cáo các chỉ số.

static boolean shouldSkipBugreportError(Throwable t)

Phương thức trợ giúp xác định lỗi khi cần bỏ qua báo cáo lỗi

String toString()

Phương thức được bảo vệ

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)

Trợ giúp để đặt mã thoát.

Hằng số

AVAILABILITY_CHECK_TIMEOUT

public static final long AVAILABILITY_CHECK_TIMEOUT

Giá trị không đổi: 180000 (0x000000000002bf20)

Trường

COMMAND_ARGS_KEY

public static final String COMMAND_ARGS_KEY

Khoá của thuộc tính đối số dòng lệnh

INVOCATION_EXTERNAL_DEPENDENCIES

public static final String INVOCATION_EXTERNAL_DEPENDENCIES

TRADEFED_CONFIG_NAME

public static final String TRADEFED_CONFIG_NAME

TRADEFED_END_HOST_LOG

public static final String TRADEFED_END_HOST_LOG

TRADEFED_INVOC_COMPLETE_HOST_LOG

public static final String TRADEFED_INVOC_COMPLETE_HOST_LOG

TRADEFED_LOG_NAME

public static final String TRADEFED_LOG_NAME

Hàm khởi tạo công khai

TestInvocation

public TestInvocation ()

Phương thức công khai

backFillBuildInfoForReporting

public static IBuildInfo backFillBuildInfoForReporting (String commandLine)

Trình trợ giúp sử dụng dòng lệnh để điền lại IBuildInfo để báo cáo trong trường hợp tải xuống không thành công.

Tham số
commandLine String

Giá trị trả về
IBuildInfo

createFailureFromException

public static FailureDescription createFailureFromException (Throwable exception, 
                TestRecordProto.FailureStatus defaultStatus)

Tạo FailureDescription từ một ngoại lệ gọi.

Tham số
exception Throwable: Trường hợp ngoại lệ cần chuyển đổi

defaultStatus TestRecordProto.FailureStatus: Trạng thái sẽ sử dụng theo mặc định nếu ngoại lệ không phải là IHarnessException.

Giá trị trả về
FailureDescription

createInvocationExec

public IInvocationExecution createInvocationExec (TestInvocation.RunMode mode)

Tạo đường dẫn gọi cần tuân theo.

Tham số
mode TestInvocation.RunMode: Chế độ mà chúng ta đang chạy.

Giá trị trả về
IInvocationExecution IInvocationExecution mô tả lệnh gọi.

getDeviceLogName

public static String getDeviceLogName (TestInvocation.Stage stage)

Tham số
stage TestInvocation.Stage

Giá trị trả về
String

getEmulatorLogName

public static String getEmulatorLogName (TestInvocation.Stage stage)

Tham số
stage TestInvocation.Stage

Giá trị trả về
String

getExitInfo

public ITestInvocation.ExitInformation getExitInfo ()

Thông tin thoát của lệnh gọi đã cho.

Giá trị trả về
ITestInvocation.ExitInformation

gọi

public void invoke (IInvocationContext context, 
                IConfiguration config, 
                IRescheduler rescheduler, 
                ITestInvocationListener... extraListeners)

Thực hiện lệnh gọi kiểm thử.

Tham số
context IInvocationContext: IInvocationContext để thực hiện kiểm thử.

config IConfiguration: IConfiguration của lần chạy kiểm thử này.

rescheduler IRescheduler: IRescheduler, để lên lịch lại các phần của lệnh gọi để thực thi trên(các) tài nguyên khác

extraListeners ITestInvocationListener: Các ITestInvocationListener cần thông báo, ngoài các ITestInvocationListener trong config

Gửi
DeviceNotAvailableException

isSubprocess

public static boolean isSubprocess (IConfiguration config)

Trả về true nếu lệnh gọi hiện nằm trong phạm vi quy trình con.

Tham số
config IConfiguration

Giá trị trả về
boolean

notifyInvocationForceStopped

public void notifyInvocationForceStopped (String message, 
                ErrorIdentifier errorId)

Thông báo cho TestInvocation rằng TradeFed đã được yêu cầu dừng.

Tham số
message String: Thông báo liên kết với việc dừng lệnh gọi

errorId ErrorIdentifier: Giá trị nhận dạng liên kết với lệnh dừng bắt buộc

notifyInvocationStopped

public void notifyInvocationStopped (String message)

Thông báo cho TestInvocation rằng TradeFed sẽ ngừng hoạt động.

Tham số
message String: Thông báo liên kết với việc dừng lệnh gọi

printStageDelimiter

public static void printStageDelimiter (TestInvocation.Stage phase, 
                boolean end)

In dấu phân cách cho một Giai đoạn nhất định của lệnh gọi.

Tham số
phase TestInvocation.Stage

end boolean

registerExecutionFiles

public void registerExecutionFiles (ExecutionFiles executionFiles)

Tham số
executionFiles ExecutionFiles

setClearcutClient

public void setClearcutClient (ClearcutClient client)

Chuyển tiếp ứng dụng clearcut để báo cáo các chỉ số.

Tham số
client ClearcutClient

shouldSkipBugreportError

public static boolean shouldSkipBugreportError (Throwable t)

Phương thức trợ giúp xác định lỗi khi cần bỏ qua báo cáo lỗi

Tham số
t Throwable

Giá trị trả về
boolean

toString

public String toString ()

Giá trị trả về
String

Phương thức được bảo vệ

addInvocationMetric

protected void addInvocationMetric (InvocationMetricLogger.InvocationMetricKey key, 
                String value)

Tham số
key InvocationMetricLogger.InvocationMetricKey

value String

addInvocationMetric

protected void addInvocationMetric (InvocationMetricLogger.InvocationMetricKey key, 
                long value)

Tham số
key InvocationMetricLogger.InvocationMetricKey

value long

applyAutomatedReporters

protected void applyAutomatedReporters (IConfiguration config)

Tham số
config IConfiguration

setExitCode

protected void setExitCode (CommandRunner.ExitCode code, 
                Throwable stack)

Trợ giúp để đặt mã thoát. Được hiển thị để kiểm thử.

Tham số
code CommandRunner.ExitCode

stack Throwable