| java.lang.Object | |
| ↳ | android.support.test.rule.logging.RuleLoggingUtils |
Convenience methods to ensure logging rules perform certain actions in the same manner.
| Constants | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| String | LOGGING_SUB_DIR_NAME | ||||||||||
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Test utility method to check if a file is empty.
| |||||||||||
Test utility method to check if a file contains the specified content.
| |||||||||||
Test utility method to check if a file doesn't contain the specified content.
| |||||||||||
Test utility method to quickly check if a file begins with the specified content.
| |||||||||||
Retrieve the directory where logging rules logs should be written to.
| |||||||||||
Retrieve a file handle that is within the testing directory where tests should be written to.
| |||||||||||
Retrieve the test run directory where tests should be written to.
| |||||||||||
Retrieve a file handle within the testing directory where test data can be written for the
complete test run.
| |||||||||||
Utility method to print file to logcat for debugging purposes.
| |||||||||||
Start a
Process on the system using a process compatible with all Android runtimes.
| |||||||||||
Start a
Process with the command and arguments specified in commandParts.
| |||||||||||
Start a
Process on the system using either
startCmdAndLogOutputPostL(String[], File) or
startProcessAndWriteOutputToFilePreL(String[], File) according to the Android
version number passed in.
| |||||||||||
Start a
Process on the system using a process compatible with all Android runtimes.
| |||||||||||
Utility method to write an error message to a file and logcat as an error.
| |||||||||||
Utility method to read a
Process's output and write it to a file.
| |||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
Test utility method to check if a file is empty.
| message | to be used when throwing an Assertion error if the content is not empty |
|---|---|
| file | to inspect |
| AssertionError | is thrown when the file isn't empty |
|---|---|
| IOException | when the there are issues accessing the file parameter
|
Test utility method to check if a file contains the specified content.
| message | to be used when throwing an Assertion error if the content does not match |
|---|---|
| file | to inspect |
| contentString | to compare against the content of the file |
| AssertionError | is thrown when the content is not found |
|---|---|
| IOException | when the there are issues accessing the file parameter
|
Test utility method to check if a file doesn't contain the specified content.
| message | to be used when throwing an Assertion error if the content does not match |
|---|---|
| file | to inspect |
| contentString | to compare against the content of the file |
| AssertionError | is thrown when the content is not found |
|---|---|
| IOException | when the there are issues accessing the file parameter
|
Test utility method to quickly check if a file begins with the specified content.
| message | to be used if the content does not match |
|---|---|
| file | to inspect |
| contentString | to compare against the content of the file |
| AssertionError | is thrown when the content is not found |
|---|---|
| IOException | when the there are issues accessing the file parameter
|
Retrieve the directory where logging rules logs should be written to.
This directory is on external storage so it is not removed when the app is uninstalled. This
allows the files to be retrieved despite fatal (think OutOfMemory) exceptions.
testRunNumber should be set whenever a test method is run more than one time in a
single test run to indicate which iteration the logging is for. Use zero as a default.
Retrieve a file handle that is within the testing directory where tests should be written to.
Retrieve the test run directory where tests should be written to.
Retrieve a file handle within the testing directory where test data can be written for the complete test run.
Utility method to print file to logcat for debugging purposes.
| IOException |
|---|
Start a Process on the system using a process compatible with all Android runtimes.
Standard and error output is redirected to the specified file.
This command runs within the testing instrumentation and has some development permissions already granted.
| commandParts | the command and parameters to execute on the system |
|---|---|
| logFile | where comamnd output is written, or in the case of an error, the exception output is written |
Start a Process with the command and arguments specified in commandParts.
You must call Process.destroy() on the object returned.
| IOException |
|---|
Start a Process on the system using either
startCmdAndLogOutputPostL(String[], File) or
startProcessAndWriteOutputToFilePreL(String[], File) according to the Android
version number passed in.
| commandParts | the command and parameters to execute on the system |
|---|---|
| logFile | where comamnd output is written, or in the case of an error, where the exception output is written |
| androidVersion | overrides the system Android version which is used to decide the best method to invoke the command with. This is useful for code that needs to write Android version specific tests. |
Start a Process on the system using a process compatible with all Android runtimes.
Standard and error output is redirected to the specified file.
startCmdAndLogOutputPostL(String[], File) instead to run as with instrumentation
permissions.| commandParts | the command and parameters to execute on the system |
|---|---|
| logFile | where comamnd output is written, or in the case of an error, the exception output is written |
Utility method to write an error message to a file and logcat as an error.
Utility method to read a Process's output and write it to a file.
| IOException |
|---|