PNGFilter filter = new PNGFilter(false, false, true);
for (Object[] test : testImages) {
String filename = (String) test[0];
boolean valid = (Boolean) test[1];
Bucket ib;
try {
ib = resourceToBucket(filename);
} catch (IOException e) {
System.out.println(filename + " not found, test skipped");
continue;
}
try {
filter.readFilter(ib.getInputStream(), new NullBucket().getOutputStream(), "", null, null);
assertTrue(filename + " should " + (valid ? "" : "not ") + "be valid", valid);
} catch (DataFilterException dfe) {
assertFalse(filename + " should " + (valid ? "" : "not ") + "be valid", valid);
}