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 ExternalResource 和TestRule 的实现。 |
class | DeviceJUnit4ClassRunner.TestMetrics ExternalResource 和TestRule 的实现。 |
公共构造函数
DeviceJUnit4ClassRunner
public DeviceJUnit4ClassRunner (Class<?> klass)
公共方法
获取阿比
public IAbi getAbi ()
跑步
public void run (RunNotifier notifier)
设置阿比
public void setAbi (IAbi abi)
public void setTestInformation (TestInformation testInformation)
参数 |
---|
testInformation | TestInformation |
受保护的方法
创建测试
protected Object createTest ()
我们重写 createTest 以设置设备。
运行子进程
protected void runChild (FrameworkMethod method,
RunNotifier notifier)
参数 |
---|
method | FrameworkMethod |
notifier | RunNotifier |
与课后
protected Statement withAfterClasses (Statement statement)
和BeforeClasses
protected Statement withBeforeClasses (Statement statement)
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2023-12-01。
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"没有我需要的信息"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"太复杂/步骤太多"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"内容需要更新"
},{
"type": "thumb-down",
"id": "translationIssue",
"label":"翻译问题"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"示例/代码问题"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"其他"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"易于理解"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"解决了我的问题"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"其他"
}]