IN PROGRESS - BATCH-672: modified remaining tests to use JUnit4.

This commit is contained in:
trisberg
2008-07-23 21:02:55 +00:00
parent 20fcba8b06
commit 67dfbbbc7a
19 changed files with 347 additions and 295 deletions

View File

@@ -29,7 +29,7 @@ import org.springframework.batch.item.support.DelegatingItemReader;
* @author Lucas Ward
*
*/
public class ExceptionThrowingItemReaderProxy extends DelegatingItemReader<Object> {
public class ExceptionThrowingItemReaderProxy<T> extends DelegatingItemReader<T> {
private int counter = 0;
private int throwExceptionOnRecordNumber = 4;
@@ -45,7 +45,7 @@ public class ExceptionThrowingItemReaderProxy extends DelegatingItemReader<Objec
return throwExceptionOnRecordNumber;
}
public Object read() throws Exception {
public T read() throws Exception {
counter++;
if (counter == throwExceptionOnRecordNumber) {

View File

@@ -76,9 +76,6 @@ public class OrderItemReader extends AbstractItemReader<Order> {
return result;
}
/**
* @see org.springframework.batch.execution.io.FieldSetCallback#execute(StepExecution)
*/
private void process(FieldSet fieldSet) {
// finish processing if we hit the end of file
if (fieldSet == null) {

View File

@@ -41,7 +41,7 @@ public class StagingItemReader<T> extends JdbcDaoSupport implements ItemStream,
private LobHandler lobHandler = new DefaultLobHandler();
private Object lock = new Object();
private final Object lock = new Object();
private volatile boolean initialized = false;
@@ -97,7 +97,7 @@ public class StagingItemReader<T> extends JdbcDaoSupport implements ItemStream,
new RowMapper() {
public Object mapRow(ResultSet rs, int rowNum) throws SQLException {
return new Long(rs.getLong(1));
return rs.getLong(1);
}
}
@@ -142,7 +142,7 @@ public class StagingItemReader<T> extends JdbcDaoSupport implements ItemStream,
if (keys.hasNext()) {
Assert.state(TransactionSynchronizationManager.isActualTransactionActive(),
"Transaction not active for this thread.");
Long next = (Long) keys.next();
Long next = keys.next();
getBuffer().add(next);
key = next;
logger.debug("Retrieved key from list: " + key);
@@ -175,7 +175,7 @@ public class StagingItemReader<T> extends JdbcDaoSupport implements ItemStream,
public Long next() {
if (iter.hasNext()) {
return (Long) iter.next();
return iter.next();
}
return null;
}