DeviceJUnit4ClassRunner

public class DeviceJUnit4ClassRunner
extends BlockJUnit4ClassRunner implements IAbiReceiver, ISetOptionReceiver, ITestInformationReceiver

java.lang.Object
   ↳ org.junit.runner.Runner
     ↳ org.junit.runners.ParentRunner<org.junit.runners.model.FrameworkMethod>
       ↳ org.junit.runners.BlockJUnit4ClassRunner
         ↳ com.android.tradefed.testtype.DeviceJUnit4ClassRunner


Trình chạy kiểm thử JUnit4 cũng hỗ trợ IDeviceTest. Bạn nên chỉ định trên JUnit4 Kiểm thử bằng chú thích RunWith.

Tóm tắt

Lớp lồng ghép

class DeviceJUnit4ClassRunner.LogAnnotation

Chú thích giả mạo nhằm chuyển nhật ký đến trình báo cáo. 

class DeviceJUnit4ClassRunner.MetricAnnotation

Chú thích giả mạo dùng để truyền các chỉ số đến trình báo cáo. 

class DeviceJUnit4ClassRunner.TestLogData

Triển khai ExternalResourceTestRule

class DeviceJUnit4ClassRunner.TestMetrics

Triển khai ExternalResourceTestRule

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

DeviceJUnit4ClassRunner(Class<?> klass)

Phương thức công khai

IAbi getAbi()
TestInformation getTestInformation()
void run(RunNotifier notifier)
void setAbi(IAbi abi)
void setTestInformation(TestInformation testInformation)

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

Object createTest()

Chúng ta ghi đè createTest để thiết lập thiết bị.

void runChild(FrameworkMethod method, RunNotifier notifier)
Statement withAfterClasses(Statement statement)
Statement withBeforeClasses(Statement statement)

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

DeviceJUnit4ClassRunner

public DeviceJUnit4ClassRunner (Class<?> klass)

Tham số
klass Class

Gửi
InitializationError

Phương thức công khai

getAbi

public IAbi getAbi ()

Giá trị trả về
IAbi

getTestInformation

public TestInformation getTestInformation ()

Giá trị trả về
TestInformation

chạy

public void run (RunNotifier notifier)

Tham số
notifier RunNotifier

setAbi

public void setAbi (IAbi abi)

Tham số
abi IAbi

setTestInformation

public void setTestInformation (TestInformation testInformation)

Tham số
testInformation TestInformation

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

createTest

protected Object createTest ()

Chúng ta ghi đè createTest để thiết lập thiết bị.

Giá trị trả về
Object

runChild

protected void runChild (FrameworkMethod method, 
                RunNotifier notifier)

Tham số
method FrameworkMethod

notifier RunNotifier

withAfterClasses

protected Statement withAfterClasses (Statement statement)

Tham số
statement Statement

Giá trị trả về
Statement

withBeforeClasses

protected Statement withBeforeClasses (Statement statement)

Tham số
statement Statement

Trả về
Statement