/**
* Tests whether the instance hash of the findbugs library is correctly used.
*/
@Test
public void testInstanceHash() {
AnnotationStream xstream = new AnnotationStream();
xstream.alias("bug", Bug.class);
InputStream stream = BugsDifferencerTest.class.getResourceAsStream("issue-6669-1.xml");
FileAnnotation[] current;
try {
current = (FileAnnotation[])xstream.fromXML(stream);
assertEquals("Wrong number of bugs", 2, current.length);
}
finally {
IOUtils.closeQuietly(stream);
}
stream = BugsDifferencerTest.class.getResourceAsStream("issue-6669-2.xml");
FileAnnotation[] previous;
try {
previous = (FileAnnotation[])xstream.fromXML(stream);
assertEquals("Wrong number of bugs", 2, previous.length);
}
finally {
IOUtils.closeQuietly(stream);
}