| java.lang.Object | |||
| ↳ | org.junit.rules.ExternalResource | ||
| ↳ | android.support.test.rule.logging.LoggingBaseRule | ||
| ↳ | android.support.test.rule.logging.LogBatteryInformationRule | ||
When applied to a test class this Rule resets battery information ("stats") before
test method execution. The Rule then collects battery information after test
method execution and logs it to a file on external storage. The default file location is
maintained at getTestDir(String, String, int). The Rule performs
these actions through the execution of a dumpsys on the batterystats service.
Rule's before() and after() methods can also be used for logging
battery information across a test suite by manually invoking the methods in a
ERROR(RunListener/org.junit.runner.notification.RunListener RunListener).
Usage:
\@Rule
public LogBatteryInformationRule mLogBatteryInformationRule = new LogBatteryInformationRule();
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Return the default log file name for this rule class.
| |||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
android.support.test.rule.logging.LoggingBaseRule
| |||||||||||
From class
org.junit.rules.ExternalResource
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
org.junit.rules.TestRule
| |||||||||||
Return the default log file name for this rule class. A null return value indicates the rule doesn't log to a file.