Class DumpFileAsserts
- java.lang.Object
-
- com.google.android.exoplayer2.testutil.DumpFileAsserts
-
public class DumpFileAsserts extends Object
Helper class to enable assertions based on golden-data dump files.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.
-
-
Method Summary
All Methods Static Methods Concrete Methods 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 thatactual
is equal to the contents ofdumpFile
.
-
-
-
Method Detail
-
assertOutput
public static void assertOutput(Context context, Dumper.Dumpable actual, String dumpFile) throws IOException
- Throws:
IOException
-
assertOutput
public static void assertOutput(Context context, String actual, String dumpFile) throws IOException
Asserts thatactual
is equal to the contents ofdumpFile
.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
toWRITE_TO_LOCAL
for local tests and toWRITE_TO_DEVICE
for instrumentation tests, and run the test again. Instead of assertion,actual
will be written todumpFile
. For instrumentation tests, this new dump file needs to be copied to the projecttestdata/src/test
folder manually.- Throws:
IOException
-
-