JAXBElement root = new JAXBElement(new QName("http://geronimo.apache.org/xml/ns/j2ee/ejb/openejb-2.0","ejb-jar"), GeronimoEjbJarType.class, g2);
String result = JaxbOpenejbJar2.marshal(GeronimoEjbJarType.class, root);
String expected = readContent(getInputStream("geronimo-openejb-converted.xml"));
Diff myDiff = new DetailedDiff(new Diff(expected, result));
final AtomicInteger differenceNumber = new AtomicInteger(0); // just to get an int wrapper for the test
myDiff.overrideDifferenceListener(new DifferenceListener() {
@Override
public int differenceFound(Difference difference) {
if (!difference.isRecoverable()) {
differenceNumber.incrementAndGet();
System.err.println(">>> " + difference.toString());
}
return 0;
}
@Override
public void skippedComparison(Node node, Node node1) {
// no-op
}
});
assertTrue("Files are not similar", myDiff.similar());
}