}
public void testOrderJNDIEnvironmentRefsGroup() throws Exception {
File srcXml = new File(basedir, "src/test-data/j2ee_1_3dtd/JNDIEnvironmentRefsGroupTestSource.xml");
File expectedOutputXml = new File(basedir, "src/test-data/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(srcCursor, moveable);
srcCursor.pop();
} while (srcCursor.toNextSibling());
} finally {
srcCursor.dispose();
}
// System.out.println(srcObject.toString());
XmlObject expected = XmlObject.Factory.parse(expectedOutputXml);
List problems = new ArrayList();
boolean ok = compareXmlObjects(srcObject, expected, problems);
assertTrue("Differences: " + problems, ok);
}