File.createTempFile("TestValidatorProcessParameter",
"dummyFile");
dummyFile.deleteOnExit();
loadPidFile(dummyFile, lines);
PidfileIterator iterator = new PidfileIterator(dummyFile);
assertTrue("has first line", iterator.hasNext());
assertEquals("first line", FIRST_PID, iterator.next());
assertTrue("has second line", iterator.hasNext());
assertEquals("second line", SECOND_PID, iterator.next());
assertTrue("has third line", iterator.hasNext());
assertEquals("third line", THIRD_PID, iterator.next());
assertFalse("no fourth line", iterator.hasNext());
} finally {
if (dummyFile != null || dummyFile.exists()) {
dummyFile.delete();
}
}