RESOLVED - BATCH-828: org.springframework.batch.item.file.MultiResourceItemReader should allow for no resources

return null on first read if the resource list is empty
This commit is contained in:
robokaso
2008-09-10 10:59:53 +00:00
parent 8c787dbd2c
commit e80fdae0aa
2 changed files with 29 additions and 1 deletions

View File

@@ -200,6 +200,15 @@ public class MultiResourceItemReaderIntegrationTests extends TestCase {
assertSame(r2, resources[2]);
}
/**
* Empty resource list is OK.
*/
public void testNoResourcesFound() throws Exception {
tested.setResources(new Resource[] {});
tested.open(ctx);
assertNull(tested.read());
}
private String readItem() throws Exception {
Object result = tested.read();
return result == null ? null : ((FieldSet) result).readString(0);