public class DumpFileAsserts extends Object
Allows the golden files to be easily updated with new data (see more info in the docs on
DUMP_FILE_ACTION).
Compatible with Dumper.Dumpable but can also be used directly with Strings generated
through different means.
| Modifier and Type | Method | Description |
|---|---|---|
static void |
assertOutput(Context context,
Dumper.Dumpable actual,
String dumpFile) |
|
static void |
assertOutput(Context context,
String actual,
String dumpFile) |
Asserts that
actual is equal to the contents of dumpFile. |
public static void assertOutput(Context context, Dumper.Dumpable actual, String dumpFile) throws IOException
IOExceptionpublic static void assertOutput(Context context, String actual, String dumpFile) throws IOException
actual is equal to the contents of dumpFile.
If the assertion fails because of an intended change in the output or a new dump file needs
to be created, set DUMP_FILE_ACTION to WRITE_TO_LOCAL for local tests and to
WRITE_TO_DEVICE for instrumentation tests, and run the test again. Instead of
assertion, actual will be written to dumpFile. For instrumentation tests, this
new dump file needs to be copied to the project testdata/src/test folder manually.
IOException