public void parse(File reportFile) throws IOException {
try {
for (SuiteResult suiteResult : SuiteResult.parse(reportFile, keepLongStdio))
add(suiteResult);
} catch (InterruptedException e) {
throw new IOException2("Failed to read "+reportFile,e);
} catch (RuntimeException e) {
throw new IOException2("Failed to read "+reportFile,e);
} catch (DocumentException e) {
if (!reportFile.getPath().endsWith(".xml")) {
throw new IOException2("Failed to read "+reportFile+"\n"+
"Is this really a JUnit report file? Your configuration must be matching too many files",e);
} else {
SuiteResult sr = new SuiteResult(reportFile.getName(), "", "");
StringWriter writer = new StringWriter();
e.printStackTrace(new PrintWriter(writer));
String error = "Failed to read test report file "+reportFile.getAbsolutePath()+"\n"+writer.toString();
sr.addCase(new CaseResult(sr,"<init>",error));
add(sr);
throw new IOException2("Failed to read "+reportFile,e);
}
}
}