LogDeviceGetPropInfoRule
public class LogDeviceGetPropInfoRule
extends LoggingBaseRule
当应用于测试类时,此Rule
执行测试方法后执行“getprop”设备命令并将其记录到外部存储器上的文件中。 默认文件位置通过getTestDir(String, String, int)
检索。
The
Rule
logs the runtime build number, device name, build type, lcd density, cpu type, among many other device state attributes. When used in conjunction with a device lab it might assist in identifying trends in test failures for a subset of Android devices.
The pertinent information output by this rule typically doesn't change between tests, therefore, it is typically used manually by using the
before()
and
after()
methods in a
RunListener
.
Usage:
\@Rule public LogDeviceGetPropInfoRule mLogDeviceGetPropInfoRule = new LogDeviceGetPropInfoRule();
Summary
Inherited methods |
From class android.support.test.rule.logging.LoggingBaseRule
|
From class org.junit.rules.ExternalResource
void |
after() |
Statement |
apply(Statement arg0, Description arg1) |
void |
before() |
|
From class java.lang.Object
Object |
clone() |
boolean |
equals(Object arg0) |
void |
finalize() |
final Class<?> |
getClass() |
int |
hashCode() |
final void |
notify() |
final void |
notifyAll() |
String |
toString() |
final void |
wait(long arg0, int arg1) |
final void |
wait(long arg0) |
final void |
wait() |
|
From interface org.junit.rules.TestRule
abstract Statement |
apply(Statement arg0, Description arg1) |
|
Public constructors
LogDeviceGetPropInfoRule
LogDeviceGetPropInfoRule ()
LogDeviceGetPropInfoRule
LogDeviceGetPropInfoRule (File logFileOutputDirectory,
String fileName)
Parameters |
logFileOutputDirectory |
File
|
fileName |
String
|
Public methods
afterTest
void afterTest ()
beforeTest
void beforeTest ()