}
public void testOrderJNDIEnvironmentRefsGroup() throws Exception {
URL srcXml = classLoader.getResource("j2ee_1_3dtd/JNDIEnvironmentRefsGroupTestSource.xml");
URL expectedOutputXml = classLoader.getResource("j2ee_1_3dtd/JNDIEnvironmentRefsGroupTestExpected.xml");
XmlObject srcObject = XmlObject.Factory.parse(srcXml);
XmlCursor srcCursor = srcObject.newCursor();
XmlCursor moveable = srcObject.newCursor();
try {
srcCursor.toFirstChild();
srcCursor.toFirstChild();
assertTrue(srcCursor.getName().toString(), "web-app".equals(srcCursor.getName().getLocalPart()));
do {
srcCursor.push();
srcCursor.toFirstChild();
srcCursor.toNextSibling();
srcCursor.toNextSibling();
moveable.toCursor(srcCursor);
SchemaConversionUtils.convertToJNDIEnvironmentRefsGroup(SchemaConversionUtils.J2EE_NAMESPACE, srcCursor, moveable);
srcCursor.pop();
} while (srcCursor.toNextSibling());
} finally {
srcCursor.dispose();
}
// log.debug(srcObject.toString());
XmlObject expected = XmlObject.Factory.parse(expectedOutputXml);
List problems = new ArrayList();
boolean ok = compareXmlObjects(srcObject, expected, problems);
assertTrue("Differences: " + problems, ok);
}