void checkEnumerations(Hashtable hash, HashDirectory dir)
throws IOException {
// enumeration test
FastIterator iter;
Hashtable clone;
int count;
// test keys
clone = (Hashtable) hash.clone();
count = 0;
iter = dir.keys();
String s = (String) iter.next();
while ( s != null ) {
count++;
clone.remove( s );
s = (String) iter.next();
}
assertEquals(hash.size(), count);
// test values
clone = (Hashtable)hash.clone();
count = 0;
iter = dir.values();
s = (String) iter.next();
while ( s != null ) {
count++;
clone.remove( s );
s = (String) iter.next();
}
assertEquals(hash.size(), count);
}