IN PROGRESS - issue BATCH-476: samples cleanup

http://jira.springframework.org/browse/BATCH-476

infinite loop replaced with finite but long enough (so that the loop doesn't run forever when test fails)
This commit is contained in:
robokaso
2008-03-18 14:07:39 +00:00
parent 1c6aa3570b
commit 94b5615245
3 changed files with 4 additions and 39 deletions

View File

@@ -1,38 +0,0 @@
package org.springframework.batch.sample.item.reader;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.batch.item.ItemReader;
import org.springframework.batch.item.MarkFailedException;
import org.springframework.batch.item.ResetFailedException;
/**
* Creates items infinitely - useful for testing job interruption by user.
*/
public class InfiniteItemReader implements ItemReader {
private static final Log logger = LogFactory.getLog(InfiniteItemReader.class);
private long counter = 0;
public Object read() throws Exception {
Object item = "item" + counter;
Thread.sleep(10);
logger.info("read item: " + item);
return item;
}
public void mark() throws MarkFailedException {
// no-op
}
public void reset() throws ResetFailedException {
// no-op
}
}