public List<String> getOutputFields() {
throw new UnsupportedOperationException("Default operation");
}
});
StreamParser parser = factory.createParser(new FileInputStream(file));
assertTrue(file.length() > 30);
assertEquals(0, parser.currentOffset());
List<Object> t = parser.nextRecord();
assertEquals(2, t.size());
assertEquals("test", t.get(0));
assertEquals("1", t.get(1));
t = parser.nextRecord();
assertEquals(2, t.size());
assertEquals("test", t.get(0));
assertEquals("2", t.get(1));
// time critical section starts here ... delay > 50ms can cause failure
// first read doesn't see a full record and thus returns null
t = parser.nextRecord();
assertNull(t);
// write the remainder now
out.write(bytes, 6, bytes.length - 6);
// so that the repeated read succeeds
t = parser.nextRecord();
// end of time critical section
assertEquals(2, t.size());
assertEquals("test", t.get(0));
assertEquals("3", t.get(1));
assertNull(parser.nextRecord());
out.close();
}