BATCH-1346: added test and extra Javadocs to clarify
This commit is contained in:
@@ -5,7 +5,9 @@ import static org.junit.Assert.assertEquals;
|
||||
import javax.sql.DataSource;
|
||||
|
||||
import org.springframework.batch.item.AbstractItemStreamItemReaderTests;
|
||||
import org.springframework.batch.item.ExecutionContext;
|
||||
import org.springframework.batch.item.ItemReader;
|
||||
import org.springframework.batch.item.ItemStream;
|
||||
import org.springframework.batch.item.sample.Foo;
|
||||
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
||||
import org.junit.Before;
|
||||
@@ -31,13 +33,14 @@ public abstract class AbstractDatabaseItemStreamItemReaderTests extends Abstract
|
||||
@Test
|
||||
public void testReadToExhaustion() throws Exception {
|
||||
ItemReader<Foo> reader = getItemReader();
|
||||
pointToEmptyInput(reader);
|
||||
((ItemStream) reader).open(new ExecutionContext());
|
||||
// pointToEmptyInput(reader);
|
||||
int count = 0;
|
||||
Foo item = new Foo();
|
||||
while (count++<100 && item!=null) {
|
||||
item = reader.read();
|
||||
}
|
||||
assertEquals(2, count);
|
||||
assertEquals(7, count);
|
||||
}
|
||||
|
||||
protected DataSource getDataSource() {
|
||||
|
||||
@@ -23,6 +23,7 @@ public class IbatisPagingItemReaderCommonTests extends AbstractDatabaseItemStrea
|
||||
|
||||
IbatisPagingItemReader reader = new IbatisPagingItemReader();
|
||||
reader.setQueryId("getPagedFoos");
|
||||
reader.setPageSize(2);
|
||||
reader.setSqlMapClient(sqlMapClient);
|
||||
reader.setSaveState(true);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user