}
public void assertResultsSetEquals(ResultSet resultSet, File expected) {
assertNotNull(resultSet);
try {
writeResultSet(expected, new BufferedReader(new ResultSetReader(resultSet, DELIMITER)));
if (resultSet.getType() != ResultSet.TYPE_FORWARD_ONLY) {
resultSet.beforeFirst();
}
assertReaderEquals(new ResultSetReader(resultSet, DELIMITER), new FileReader(expected));
} catch (IOException e) {
throw new RuntimeException(e);
} catch (SQLException e) {
throw new RuntimeException(e);
}