assertTimeLogHashcodes(expectedHashcodes, iter);
}
public void testOldStyleBoundaryCases() throws Exception {
// nonexistent file
EnumerIterator iter = new OldStyleTimeLogReader(new File("foo"),
new DummyIDSource());
assertFalse(iter.hasNext());
assertFalse(iter.hasMoreElements());
try {
iter.next();
fail("Expected NoSuchElementException");
} catch (NoSuchElementException nsee) {
}
try {
iter.nextElement();
fail("Expected NoSuchElementException");
} catch (NoSuchElementException nsee) {
}
try {
iter.remove();
fail("Expected UnsupportedOperationException");
} catch (UnsupportedOperationException nsee) {
}
try {
iter = new OldStyleTimeLogReader(new IOExceptionInputStream(
openFile(TIMELOG1_TXT), 200));
fail("Expected IOException");
} catch (IOException ioe) {
}
try {
iter = new OldStyleTimeLogReader(new IOExceptionInputStream(
openFile(TIMELOG1_TXT), 10000));
while (iter.hasNext())
iter.next();
fail("Expected IONoSuchElementException");
} catch (IONoSuchElementException ionsee) {
// expected behavior
} catch (IOException ioe) {
fail("Expected IONoSuchElementException");