RemoteAndroidTestRunner

public class RemoteAndroidTestRunner
extends Object implements IRemoteAndroidTestRunner

java.lang.Object
   ↳ com.android.tradefed.result.ddmlib.RemoteAndroidTestRunner


Chạy lệnh kiểm thử Android từ xa và báo cáo kết quả.

Tóm tắt

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

RemoteAndroidTestRunner(String packageName, IShellEnabledDevice remoteDevice)

Hàm khởi tạo thay thế.

RemoteAndroidTestRunner(String packageName, String runnerName, IShellEnabledDevice remoteDevice)

Hàm khởi tạo thay thế.

RemoteAndroidTestRunner(String packageName, String runnerName, IShellEnabledDevice remoteDevice, RemoteAndroidTestRunner.StatusReporterMode statusReporterMode)

Tạo trình chạy kiểm thử Android từ xa.

Phương thức công khai

void addBooleanArg(String name, boolean value)
void addInstrumentationArg(String name, String value)
void cancel()
IInstrumentationResultParser createParser(String runName, listeners)

Tạo InstrumentationResultParser sẽ được dùng để phân tích cú pháp đầu ra đo lường.

String getAmInstrumentCommand()
IRemoteAndroidTestRunner.CoverageOutput getCoverageOutputType()
String getPackageName()
String getRunOptions()

Trả về các tuỳ chọn cho lệnh đo lường am.

String getRunnerName()
void removeInstrumentationArg(String name)
void run(ITestRunListener... listeners)
void run( listeners)
void setAdditionalTestOutputLocation(String additionalTestDataPath)
void setClassName(String className)
void setClassNames(String[] classNames)
void setCoverage(boolean coverage)
void setCoverageReportLocation(String reportPath)
void setDebug(boolean debug)
void setLogOnly(boolean logOnly)
void setMaxTimeToOutputResponse(long maxTimeToOutputResponse, TimeUnit maxTimeUnits)
void setMaxTimeout(long maxTimeout, TimeUnit maxTimeUnits)
void setMaxtimeToOutputResponse(int maxTimeToOutputResponse)
void setMethodName(String className, String testName)
void setRunName(String runName)
void setRunOptions(String options)

Đặt các tuỳ chọn cho lệnh đo lường am.

void setTestCollection(boolean collect)
void setTestPackageName(String packageName)
void setTestSize(IRemoteAndroidTestRunner.TestSize size)

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

String getArgsCommand()

Trả về cú pháp dòng lệnh đo lường đầy đủ cho các đối số đo lường được cung cấp.

String getRunnerPath()

Trả về đường dẫn thành phần đo lường đầy đủ.

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

RemoteAndroidTestRunner

public RemoteAndroidTestRunner (String packageName, 
                IShellEnabledDevice remoteDevice)

Hàm khởi tạo thay thế. Sử dụng trình chạy đo lường mặc định.

Tham số
packageName String: Gói ứng dụng Android có chứa các bài kiểm thử cần chạy

remoteDevice IShellEnabledDevice: thiết bị Android để thực thi kiểm thử

RemoteAndroidTestRunner

public RemoteAndroidTestRunner (String packageName, 
                String runnerName, 
                IShellEnabledDevice remoteDevice)

Hàm khởi tạo thay thế. Sử dụng statusReporterMode mặc định.

Tham số
packageName String: gói ứng dụng Android chứa các chương trình kiểm thử cần chạy

runnerName String: trình chạy kiểm thử đo lường để thực thi. Nếu rỗng, sẽ sử dụng trình chạy mặc định

remoteDevice IShellEnabledDevice: thiết bị Android để thực thi kiểm thử

RemoteAndroidTestRunner

public RemoteAndroidTestRunner (String packageName, 
                String runnerName, 
                IShellEnabledDevice remoteDevice, 
                RemoteAndroidTestRunner.StatusReporterMode statusReporterMode)

Tạo một trình chạy kiểm thử từ xa cho Android.

Tham số
packageName String: gói ứng dụng Android chứa các chương trình kiểm thử cần chạy

runnerName String: trình chạy kiểm thử đo lường để thực thi. Nếu rỗng, sẽ sử dụng trình chạy mặc định

remoteDevice IShellEnabledDevice: thiết bị Android để thực thi các kiểm thử trên

statusReporterMode RemoteAndroidTestRunner.StatusReporterMode: chế độ trình báo cáo trạng thái sẽ dùng cho lệnh amInstrument

Phương thức công khai

addBooleanArg

public void addBooleanArg (String name, 
                boolean value)

Tham số
name String

value boolean

addInstrumentationArg

public void addInstrumentationArg (String name, 
                String value)

Tham số
name String

value String

hủy

public void cancel ()

trình phân tích cú pháp

public IInstrumentationResultParser createParser (String runName, 
                 listeners)

Tạo InstrumentationResultParser sẽ được dùng để phân tích cú pháp đầu ra đo lường.

Tham số
runName String: Tên của lần chạy để sử dụng.

listeners : Trình nghe báo cáo kết quả.

Giá trị trả về
IInstrumentationResultParser Một thực thể của InstrumentationResultParser.

getAmInstrumentCommand

public String getAmInstrumentCommand ()

Giá trị trả về
String

getPhạm vi bao phủĐầu raType

public IRemoteAndroidTestRunner.CoverageOutput getCoverageOutputType ()

Giá trị trả về
IRemoteAndroidTestRunner.CoverageOutput

getPackageName

public String getPackageName ()

Giá trị trả về
String

getRunOptions

public String getRunOptions ()

Trả về các tuỳ chọn cho lệnh đo lường am.

Giá trị trả về
String

getRunnerName

public String getRunnerName ()

Giá trị trả về
String

removeInstrumentationArg

public void removeInstrumentationArg (String name)

Tham số
name String

chạy

public void run (ITestRunListener... listeners)

Tham số
listeners ITestRunListener

Gửi
AdbCommandRejectedException
ShellCommandUnresponsiveException
TimeoutException

chạy

public void run ( listeners)

Tham số
listeners

Gửi
AdbCommandRejectedException
ShellCommandUnresponsiveException
TimeoutException

setAdditionalTestOutputLocation

public void setAdditionalTestOutputLocation (String additionalTestDataPath)

Tham số
additionalTestDataPath String

setClassName

public void setClassName (String className)

Tham số
className String

setClassNames

public void setClassNames (String[] classNames)

Tham số
classNames String

setCoverage

public void setCoverage (boolean coverage)

Tham số
coverage boolean

setCoverageReportLocation

public void setCoverageReportLocation (String reportPath)

Tham số
reportPath String

setDebug

public void setDebug (boolean debug)

Tham số
debug boolean

Chỉ setLog

public void setLogOnly (boolean logOnly)

Tham số
logOnly boolean

setMaxTimeToOutputResponse

public void setMaxTimeToOutputResponse (long maxTimeToOutputResponse, 
                TimeUnit maxTimeUnits)

Tham số
maxTimeToOutputResponse long

maxTimeUnits TimeUnit

setMaxTimeout

public void setMaxTimeout (long maxTimeout, 
                TimeUnit maxTimeUnits)

Tham số
maxTimeout long

maxTimeUnits TimeUnit

setMaxtimeToOutputResponse

public void setMaxtimeToOutputResponse (int maxTimeToOutputResponse)

Tham số
maxTimeToOutputResponse int

setMethodName

public void setMethodName (String className, 
                String testName)

Tham số
className String

testName String

setRunName

public void setRunName (String runName)

Tham số
runName String

setRunOptions

public void setRunOptions (String options)

Đặt các tuỳ chọn cho lệnh amInstrument. Hãy truy cập com/android/commands/am/Am.java để biết danh sách đầy đủ tùy chọn.

Tham số
options String

setTestCollection

public void setTestCollection (boolean collect)

Tham số
collect boolean

setTestPackageName

public void setTestPackageName (String packageName)

Tham số
packageName String

setTestSize

public void setTestSize (IRemoteAndroidTestRunner.TestSize size)

Tham số
size IRemoteAndroidTestRunner.TestSize

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

getArgsCommand

protected String getArgsCommand ()

Trả về cú pháp dòng lệnh đo lường đầy đủ cho khả năng đo lường đã cung cấp đối số. Trả về một chuỗi trống nếu không có đối số nào được chỉ định.

Giá trị trả về
String

getRunnerPath

protected String getRunnerPath ()

Trả về đường dẫn thành phần đo lường đầy đủ.

Giá trị trả về
String