Enumeration enumeration;
String list = "";
ClassLoader c = ClasspathUtils.getUniqueClassLoaderForPath(p, (Path) null, false);
try {
enumeration = c.getResources(
"org/apache/tools/ant/taskdefs/defaults.properties");
} catch (IOException e) {
throw new BuildException(
"Could not get the defaults.properties resource");
}
int count = 0;
while (enumeration.hasMoreElements()) {
list = list + " " + enumeration.nextElement();
count++;
}
assertTrue("Should be only one and not " + count + " " + list, count == 1);