BATCH-1753: added test case (seems to be OK)
This commit is contained in:
@@ -559,6 +559,18 @@ public class FlatFileItemWriterTests {
|
||||
assertFalse(outputFile.exists());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDeleteOnExitReopen() throws Exception {
|
||||
writer.setShouldDeleteIfEmpty(true);
|
||||
writer.open(executionContext);
|
||||
assertTrue(outputFile.exists());
|
||||
writer.close();
|
||||
assertFalse(outputFile.exists());
|
||||
writer.open(executionContext);
|
||||
writer.write(Collections.singletonList("test2"));
|
||||
assertEquals("test2", readLine());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testWriteHeaderAfterRestartOnFirstChunk() throws Exception {
|
||||
writer.setHeaderCallback(new FlatFileHeaderCallback() {
|
||||
|
||||
Reference in New Issue
Block a user