BATCH-1444: better check for ChunkMonitor stream

This commit is contained in:
dsyer
2009-11-18 07:45:54 +00:00
parent c7bb8ae1a8
commit fcf7b1d1c4
2 changed files with 21 additions and 4 deletions

View File

@@ -134,4 +134,18 @@ public class ChunkMonitorTests {
assertEquals(1, executionContext.size());
}
@Test
public void testUpdateWithNoStream() throws Exception {
monitor = new ChunkMonitor();
monitor.setItemReader(new ItemReader<String>() {
public String read() throws Exception, UnexpectedInputException, ParseException {
return "" + (count++);
}
});
monitor.setChunkSize(CHUNK_SIZE);
monitor.incrementOffset();
ExecutionContext executionContext = new ExecutionContext();
monitor.update(executionContext);
assertEquals(0, executionContext.size());
}
}