}
public void testValidateDocument(String fileName, List<MessageId> errors, List<MessageId> warnings, List<MessageId> fatalErrors,
boolean verbose)
{
ValidationReport testReport = new ValidationReport(fileName, String.format(
Messages.get("single_file"), "nav", "3.0"));
GenericResourceProvider resourceProvider;
if (fileName.startsWith("http://") || fileName.startsWith("https://"))
{
resourceProvider = new URLResourceProvider(fileName);
}
else
{
URL fileURL = this.getClass().getResource(basepath + fileName);
String filePath = fileURL != null ? fileURL.getPath() : basepath + fileName;
resourceProvider = new FileResourceProvider(filePath);
}
NavChecker navChecker = new NavChecker(resourceProvider, testReport, basepath
+ fileName, "application/xhtml+xml", EPUBVersion.VERSION_3);
navChecker.validate();
if (verbose)
{
outWriter.println(testReport);
}
assertEquals("The error results do not match", errors, testReport.getErrorIds());
assertEquals("The warning results do not match", warnings, testReport.getWarningIds());
assertEquals("The fatal error results do not match", fatalErrors, testReport.getFatalErrorIds());
}