public final class LastAssertions extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
TEST_DB_SUFFIX
Last.fm standard is to name all unit tests with the name of the original database and then this suffix.
|
| Modifier and Type | Method and Description |
|---|---|
static void |
assertFileEquals(File file1,
File file2)
Asserts that the *contents* of the passed files are equal.
|
static void |
assertFileEquals(String message,
File expectedFile,
Charset expectedFileEncoding,
File actualFile,
Charset actualFileEncoding)
Asserts that the *contents* of the passed files are equal.
|
static void |
assertFileEquals(String message,
File expectedFile,
File actualFile)
Asserts that the *contents* of the passed files are equal.
|
static void |
assertFilesEquivalent(File expected,
Charset expectedFileEncoding,
File actual,
Charset actualFileEncoding)
Asserts that the contents of the files are equivalent - i.e.
|
static void |
assertFilesEquivalent(File expected,
File actual)
Asserts that the contents of the files are equivalent - i.e.
|
static void |
assertFilesNotEqual(File expectedFile,
File actualFile)
Asserts that the *contents* of the passed files are not equal.
|
static void |
assertFilesNotEqual(String message,
File file1,
File file2)
Asserts that the *contents* of the passed files are not equal.
|
static void |
assertTestDatabase(DataSource dataSource)
Asserts that the database that the passed DataSource has been configured to use is a unit test database.
|
static void |
assertValues(String expectedValue,
Object[] values)
Assert that all Objects in the passed array match the expected value.
|
public static final String TEST_DB_SUFFIX
public static void assertTestDatabase(DataSource dataSource) throws SQLException
dataSource - Configured DataSource.SQLException - If an error occurs connecting to the database to retrieve the database name.public static void assertFileEquals(File file1, File file2) throws IOException
file1 - File to compare.file2 - File to compare.IOException - If an error occurs comparing the file contents.public static void assertFileEquals(String message, File expectedFile, File actualFile) throws IOException
message - Failure message.expectedFile - File containing expected data.actualFile - File to compare.IOException - If an error occurs comparing the file contents.public static void assertFileEquals(String message, File expectedFile, Charset expectedFileEncoding, File actualFile, Charset actualFileEncoding) throws IOException
message - Failure message.expectedFile - File containing expected data.expectedFileEncoding - Encoding of expected file.actualFile - File to compare.actualFileEncoding - Encoding of actual file.IOException - If an error occurs comparing the file contents.public static void assertFilesNotEqual(File expectedFile, File actualFile) throws IOException
expectedFile - File containing expected data.actualFile - File to compare.IOException - If an error occurs comparing the file contents.public static void assertFilesNotEqual(String message, File file1, File file2) throws IOException
message - Failure message.file1 - File to compare.file2 - File to compare.IOException - If an error occurs comparing the file contents.public static void assertValues(String expectedValue, Object[] values)
expectedValue - Expected value.values - Array of Objects to compare.public static void assertFilesEquivalent(File expected, File actual) throws IOException
expected - File containing expected data.actual - File to compare.IOException - If an error occurs comparing the file contents.public static void assertFilesEquivalent(File expected, Charset expectedFileEncoding, File actual, Charset actualFileEncoding) throws IOException
expected - File containing expected data.expectedFileEncoding - Encoding of expected file.actual - File to compare.actualFileEncoding - Encoding of actual file.IOException - If an error occurs comparing the file contents.Copyright © 2016 Last.fm. All Rights Reserved.