LogNetStatsRule

public class LogNetStatsRule
extends LoggingBaseRule

java.lang.Object
   ↳ org.junit.rules.ExternalResource
     ↳ android.support.test.rule.logging.LoggingBaseRule
       ↳ android.support.test.rule.logging.LogNetStatsRule


当应用于测试类时,此Rule在测试方法执行之前执行网络系统信息重置。 Rule然后在测试方法执行后收集网络系统信息并将其记录到外部存储器上的文件中。 默认文件位置保持在getTestDir(String, String, int) 该规则通过执行netstats服务上的netstats来执行这些操作。

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

Public constructors

LogNetStatsRule()
LogNetStatsRule(File logFileOutputDirectory, String fileName)

Public methods

void afterTest()
void beforeTest()

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

Public constructors

LogNetStatsRule

LogNetStatsRule ()

LogNetStatsRule

LogNetStatsRule (File logFileOutputDirectory, 
                String fileName)

Parameters
logFileOutputDirectory File
fileName String

Public methods

afterTest

void afterTest ()

beforeTest

void beforeTest ()