f = new File(fileName);
assertTrue(f.exists());
outputBuffer.close();
assertTrue(f.length() == 4000);// + (4000 / 1024 + 1) * 4));
SpilledDataInputBuffer inputBuffer = outputBuffer
.getInputStreamToRead(fileName);
for (int i = 0; i < 100; ++i) {
text.readFields(inputBuffer);
assertTrue("Testing the spillage of spilling buffer".equals(text
.toString()));
text.clear();
}
try {
text.readFields(inputBuffer);
assertTrue(false);
} catch (EOFException eof) {
assertTrue(true);
}
inputBuffer.close();
inputBuffer.completeReading(false);
assertTrue(f.exists());
inputBuffer.completeReading(true);
assertFalse(f.exists());
} finally {
if (f != null) {
if (f.exists()) {
f.delete();