// The test suite needs to be installed separately. If we can't
// find the catalog, we just don't run these tests.
if (catalog.exists()) {
Document doc = builder.build(catalog);
Element testsuite = doc.getRootElement();
Elements testCatalogs = testsuite.getChildElements("test-catalog");
for (int i = 0; i < testCatalogs.size(); i++) {
Elements testcases = testCatalogs.get(i).getChildElements("test-case");
for (int j = 0; j < testcases.size(); j++) {
Element testcase = testcases.get(j);
String features = testcase.getAttributeValue("features");
if (features != null && features.indexOf("xml11") >= 0) {
continue; // skip test
}
File root = new File(base, testcase.getFirstChildElement("file-path").getValue());
File inputFile = null;
Element scenario = testcase.getFirstChildElement("scenario");
Element input = scenario.getFirstChildElement("input");
inputFile = new File(root, input.getValue());
Elements expectedIDs = scenario.getChildElements("id");
try {
Document inputDoc = builder.build(inputFile);
Nodes recognizedIDs = getIDs(inputDoc);
assertEquals(expectedIDs.size(), recognizedIDs.size());
for (int k = 0; k < expectedIDs.size(); k++) {
assertEquals(expectedIDs.get(i).getValue(), recognizedIDs.get(i).getValue());
}
}
catch (ParsingException ex) {
System.err.println(inputFile);
ex.printStackTrace();