XMLUnit.setIgnoreAttributeOrder(true);
XMLAssert.assertXMLEqual("Failed to compare XMLs for " + segmentCode, new StringReader(expected), new StringReader(out.outputString(node)));
}
private void test(String messageName, EdiSpecificationReader ediSpecificationReader) throws IOException {
Edimap edimap = ediSpecificationReader.getMappingModel(messageName);
StringWriter stringWriter = new StringWriter();
edimap.write(stringWriter);
// String expected = new String(StreamUtils.readStream(getClass().getResourceAsStream("d08a/message/expected-" + messageName.toLowerCase() + ".xml"))).trim();
//
// String result = removeCRLF(stringWriter.toString());
// expected = removeCRLF(expected);
//
// if(!result.equals(expected)) {
// System.out.println("Expected: \n[" + expected + "]");
// System.out.println("Actual: \n[" + result + "]");
// assertEquals("Message [" + messageName + "] failed.", expected, result);
// }
StringWriter result = new StringWriter();
edimap.write(result);
String expected = new String(StreamUtils.readStream(getClass().getResourceAsStream("d08a/message/expected-" + messageName.toLowerCase() + ".xml"))).trim();
// System.out.println(result);
XMLUnit.setIgnoreWhitespace( true );