Skip to content

Most visited

Recently visited

navigation

LoggingBaseRule

public abstract class LoggingBaseRule
extends ExternalResource

java.lang.Object
   ↳ org.junit.rules.ExternalResource
     ↳ android.support.test.rule.logging.LoggingBaseRule
Known Direct Subclasses


Base class for logging rules to remove boiler-plate instance variables used by most logging rules.

Summary

Public constructors

LoggingBaseRule()
LoggingBaseRule(File logFileOutputDirectory, String fileName)

Request the log be written to a specific location.

Public methods

final void after()
final Statement apply(Statement base, Description description)
final void before()
void setTestRunNumber(int testRunNumber)

Indicate to the Rule that this is the testRunNumberth time the test method is being called in a test instrumentation.

Protected methods

String getLogFileName()
File getLogFileOutputDirectory()
String getPackageNameUnderTest()
String getTestClass()
String getTestName()
int getTestRunNumber()

Inherited methods

From class org.junit.rules.ExternalResource
From class java.lang.Object
From interface org.junit.rules.TestRule

Public constructors

LoggingBaseRule

LoggingBaseRule ()

LoggingBaseRule

LoggingBaseRule (File logFileOutputDirectory, 
                String fileName)

Request the log be written to a specific location.

File logFileOutputDirectory directory to log output to String fileName to override the default file name, if desired

Parameters
logFileOutputDirectory File
fileName String

Public methods

after

void after ()

apply

Statement apply (Statement base, 
                Description description)

Parameters
base Statement
description Description
Returns
Statement

before

void before ()

setTestRunNumber

void setTestRunNumber (int testRunNumber)

Indicate to the Rule that this is the testRunNumberth time the test method is being called in a test instrumentation. This method only needs to be called when a test method is being called multiple times in a test instrumentation.

Parameters
testRunNumber int: indicates the nth run for the test method in zero-index form

Protected methods

getLogFileName

String getLogFileName ()

Returns
String

getLogFileOutputDirectory

File getLogFileOutputDirectory ()

Returns
File

getPackageNameUnderTest

String getPackageNameUnderTest ()

Returns
String

getTestClass

String getTestClass ()

Returns
String

getTestName

String getTestName ()

Returns
String

getTestRunNumber

int getTestRunNumber ()

Returns
int
This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.