LogNetStatsRule
public
class
LogNetStatsRule
extends LoggingBaseRule
When applied to a test class this Rule
performs a network system information reset
before test method execution. The Rule
then collects network system
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 netstats
service.
The
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
RunListener
.
Usage:
\@Rule
public LogNetStatsRule mLogNetStatsRule = new LogNetStatsRule();
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
LogNetStatsRule
LogNetStatsRule ()
LogNetStatsRule
LogNetStatsRule (File logFileOutputDirectory,
String fileName)
Parameters |
logFileOutputDirectory |
File
|
fileName |
String
|
Public methods
afterTest
void afterTest ()
beforeTest
void beforeTest ()