sw = new StringWriter();
serializer.output(expectedXml, sw);
String expectedStr = sw.toString();
//get the file name in case of a failure
FitsMetadataElement item = fitsOut.getMetadataElement("filename");
DifferenceListener myDifferenceListener = new IgnoreAttributeValuesDifferenceListener();
Diff diff = new Diff(expectedStr,actualStr);
diff.overrideDifferenceListener(myDifferenceListener);
if(diff.similar()) {
System.out.println("PASS: "+item.getValue());
passed++;
}
else {
System.err.println("FAIL: "+item.getValue());
failed++;
}
}
System.out.println("All Done");
System.out.println(passed + " tests passed");