public void testQNameConverter1() throws Exception {
URL srcXml = classLoader.getResource("geronimo/qname1-pre.xml");
URL expectedOutputXml = classLoader.getResource("geronimo/qname1-post.xml");
XmlObject xmlObject = XmlObject.Factory.parse(srcXml);
ElementConverter elementConverter = new QNameConverter("import", "http://geronimo.apache.org/xml/ns/deployment-1.0", "parent");
XmlCursor cursor = xmlObject.newCursor();
XmlCursor end = cursor.newCursor();
try {
elementConverter.convertElement(cursor, end);
// log.debug(xmlObject.toString());
XmlObject expected = XmlObject.Factory.parse(expectedOutputXml);
List problems = new ArrayList();
boolean ok = compareXmlObjects(xmlObject, expected, problems);
assertTrue("Differences: " + problems, ok);
SchemaConversionUtils.convertToGeronimoSubSchemas(cursor);
boolean ok2 = compareXmlObjects(xmlObject, expected, problems);
assertTrue("Differences: " + problems, ok2);
} finally {
cursor.dispose();
end.dispose();
}
}