File[] list = rdfDir.listFiles();
for (int i = 0; i < list.length; i++) {
// skip over eg. CVS subdirectories
if (list[i].isDirectory() || !list[i].getName().endsWith("rdf")) continue;
Gloze gloze = new Gloze(SILENT);
try {
Model m = ModelFactory.createDefaultModel();
Gloze.logger.info("drop " + list[i].getName());
String name = list[i].getName();
// load the target XML and initialise gloze with its schema
String targetName = name.substring(0,name.lastIndexOf('.') + 1) + "xml";
File targetXML = new File(xmlDir, targetName);
Document targetDoc = XMLUtility.read(new FileInputStream(targetXML));
Gloze.initSchemaXSI(targetDoc.getDocumentElement(),xmlDir.toURL(),ns,gloze.schemaMap);
Document target = XMLUtility.read(new FileInputStream(targetXML));
// drop the rdf and compare with the target
Document output = gloze.rdf_to_xml(list[i], null, XMLBean.resolveBase(uri,targetXML), m);
assertTrue(Utility.equalXML(output,target, true));
} catch (Exception error) {
fail(list[i].getName()+" : "+error.getMessage());
}
}