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 |
JUnit4 測試運行器也容納IDeviceTest
。應該在 JUnit4 Test 上面指定一個 RunWith 註解。
概括
嵌套類 | |
---|---|
class | DeviceJUnit4ClassRunner.LogAnnotation 虛假註釋的目的是向記者攜帶日誌。 |
class | DeviceJUnit4ClassRunner.MetricAnnotation 虛假註釋旨在向記者傳達指標。 |
class | DeviceJUnit4ClassRunner.TestLogData |
class | DeviceJUnit4ClassRunner.TestMetrics |
公共構造函數 | |
---|---|
DeviceJUnit4ClassRunner (Class<?> klass) |
公共方法 | |
---|---|
IAbi | getAbi () |
TestInformation | getTestInformation () |
void | run (RunNotifier notifier) |
void | setAbi ( IAbi abi) |
void | setTestInformation ( TestInformation testInformation) |
受保護的方法 | |
---|---|
Object | createTest () 我們重寫 createTest 以設定設備。 |
void | runChild (FrameworkMethod method, RunNotifier notifier) |
Statement | withAfterClasses (Statement statement) |
Statement | withBeforeClasses (Statement statement) |
公共構造函數
DeviceJUnit4ClassRunner
public DeviceJUnit4ClassRunner (Class<?> klass)
參數 | |
---|---|
klass | Class |
投擲 | |
---|---|
InitializationError |
公共方法
跑步
public void run (RunNotifier notifier)
參數 | |
---|---|
notifier | RunNotifier |
設定測試訊息
public void setTestInformation (TestInformation testInformation)
參數 | |
---|---|
testInformation | TestInformation |
受保護的方法
建立測試
protected Object createTest ()
我們重寫 createTest 以設定設備。
退貨 | |
---|---|
Object |
運行子進程
protected void runChild (FrameworkMethod method, RunNotifier notifier)
參數 | |
---|---|
method | FrameworkMethod |
notifier | RunNotifier |
與課後
protected Statement withAfterClasses (Statement statement)
參數 | |
---|---|
statement | Statement |
退貨 | |
---|---|
Statement |
和BeforeClasses
protected Statement withBeforeClasses (Statement statement)
參數 | |
---|---|
statement | Statement |
退貨 | |
---|---|
Statement |
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。Java 與 OpenJDK 是 Oracle 和/或其關係企業的商標或註冊商標。
上次更新時間:2023-12-01 (世界標準時間)。
[]
[]