WebAppDD webappdd = underTest.read(descriptorStream);
underTest.write(webappdd, out);
final InputStream expectedDescriptorStream = getExpectedDescriptorStream();
// Use DetailedDiff to list all differences
final DetailedDiff diff = new DetailedDiff(
new Diff(new InputStreamReader(expectedDescriptorStream), new FileReader(outputFile))
);
final List diffs = diff.getAllDifferences();
// diffs.size() will be 0 if no differences were found.
assertEquals( "Encountered differences in XML: " + System.getProperty( "line.separator" ) +
diff.toString(),
0, diffs.size() );
// now round-trip it
WebAppDD webappdd2 = underTest.read(new FileInputStream(outputFile));
assertNotNull(webappdd2);