int warnings = 0;
try {
in = this.getClass().getClassLoader().getResourceAsStream(warcFile);
WarcReader reader = WarcReaderFactory.getReader(in);
WarcRecord record;
while ((record = reader.getNextRecord()) != null) {
if (bDebugOutput) {
TestBaseUtils.printRecord(record);
TestBaseUtils.printRecordErrors(record);
}
record.close();
errors = 0;
warnings = 0;
if (record.diagnostics.hasErrors()) {
errors += record.diagnostics.getErrors().size();
}
if (record.diagnostics.hasWarnings()) {
warnings += record.diagnostics.getWarnings().size();
}
Assert.assertEquals(expected_errors[records], errors);
Assert.assertEquals(expected_warnings[records], warnings);
++records;
}
reader.close();
in.close();
if (bDebugOutput) {
TestBaseUtils.printStatus(records, errors, warnings);
}