public class EspAppDataTool
extends java.lang.Object
Tool for application data “file storage/cache, shared preferences, database”.
Best situation is to clear all data is when activity is not started.
You can delay activity start with:
new ActivityTestRule(Activity.class, false, false)
clearApplicationData()
ActivityTestRule.lunchActivity()
| Constructor and Description |
|---|
EspAppDataTool() |
| Modifier and Type | Method and Description |
|---|---|
static void |
clearApplicationData()
Clear all application data except screenshots taken with
EspScreenshotTool. |
static void |
clearCache()
Clear cached files.
|
static void |
clearDatabase()
Clear all databases.
|
static void |
clearSharedPreferences()
Clear all shared preferences.
|
static void |
clearStorage(java.lang.String... excludes)
Clear stored files.
|
static void |
clearStorageExceptScreenshots()
Clear stored files except test screenshots folder.
|
protected static java.io.File |
getSharedPreferencesFilesLocation() |
public static void clearApplicationData()
Clear all application data except screenshots taken with EspScreenshotTool.
public static void clearSharedPreferences()
Clear all shared preferences.
@NonNull protected static java.io.File getSharedPreferencesFilesLocation()
public static void clearDatabase()
Clear all databases.
Only works if all database connections are closed. Does not produce error if connection still open.
public static void clearCache()
Clear cached files.
public static void clearStorage(java.lang.String... excludes)
Clear stored files.
excludes - directory names which will be skippedpublic static void clearStorageExceptScreenshots()
Clear stored files except test screenshots folder.