BATCH-413: Added a more specific exception type for when an item reader doesn't find any work.

This commit is contained in:
lucasward
2008-03-04 19:32:49 +00:00
parent 6e5e60af64
commit a7fe4db96e
3 changed files with 35 additions and 5 deletions

View File

@@ -7,11 +7,11 @@ import java.util.Properties;
import junit.framework.TestCase;
import org.springframework.batch.io.sample.domain.Foo;
import org.springframework.batch.item.ExecutionContext;
import org.springframework.batch.item.ItemReader;
import org.springframework.batch.item.ItemStream;
import org.springframework.batch.item.ExecutionContext;
import org.springframework.batch.item.exception.NoWorkFoundException;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.dao.DataRetrievalFailureException;
import org.springframework.transaction.support.TransactionSynchronizationManager;
import org.springframework.util.Assert;
@@ -170,7 +170,7 @@ public class DrivingQueryItemReaderTests extends TestCase {
itemReader.open(new ExecutionContext());
fail();
}
catch(DataRetrievalFailureException ex){
catch(NoWorkFoundException ex){
//expected
}
}