* @param failMessage the message to display if the DOMs are not equal
* @param expectedDOM the expected DOM
* @param xmlObject the XMLObject to be marshalled and compared against the expected DOM
*/
public void assertEquals(String failMessage, Document expectedDOM, XMLObject xmlObject) {
Marshaller marshaller = marshallerFactory.getMarshaller(xmlObject);
if(marshaller == null){
fail("Unable to locate marshaller for " + xmlObject.getElementQName() + " can not perform equality check assertion");
}
try {
Element generatedDOM = marshaller.marshall(xmlObject, parser.newDocument());
if(log.isDebugEnabled()) {
log.debug("Marshalled DOM was " + XMLHelper.nodeToString(generatedDOM));
}
assertXMLEqual(failMessage, expectedDOM, generatedDOM.getOwnerDocument());
} catch (Exception e) {