RESOLVED - BATCH-645: Have JdbcCursorItemReader use ResultSet.absolute() to set the cursor by configuration

cleaned up the javadoc as sideeffect
This commit is contained in:
robokaso
2008-06-02 09:25:59 +00:00
parent 78c4e34b98
commit 58963c7bdb
2 changed files with 89 additions and 49 deletions

View File

@@ -5,20 +5,29 @@ import org.springframework.batch.item.ItemReader;
public class JdbcCursorItemReaderCommonTests extends CommonDatabaseItemStreamItemReaderTests {
protected ItemReader getItemReader() throws Exception {
JdbcCursorItemReader result = new JdbcCursorItemReader();
result.setDataSource(getDataSource());
result.setSql("select ID, NAME, VALUE from T_FOOS");
result.setIgnoreWarnings(true);
result.setVerifyCursorPosition(true);
result.setMapper(new FooRowMapper());
result.setFetchSize(10);
result.setMaxRows(100);
result.setQueryTimeout(1000);
result.setSaveState(true);
result.setDriverSupportsAbsolute(false);
return result;
}
public void testRestartWithDriverSupportsAbsolute() throws Exception {
tested = getItemReader();
((JdbcCursorItemReader) tested).setDriverSupportsAbsolute(true);
testedAsStream().open(executionContext);
testRestart();
}
}