IN PROGRESS - issue BATCH-422: Provide ability to specify exception types as well as skip limit in DefaultStepFactoryBean

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

The desired functionality should now be there, but needs better tests
This commit is contained in:
robokaso
2008-03-12 13:43:39 +00:00
parent 64a4e53a99
commit 8fff682219
3 changed files with 34 additions and 13 deletions

View File

@@ -63,7 +63,7 @@ public class SimpleLimitExceptionHandlerTests extends TestCase {
final int MORE_THAN_ZERO = 1;
handler.setLimit(MORE_THAN_ZERO);
handler.setType(IllegalArgumentException.class);
handler.setExceptionClasses(new Class[] { IllegalArgumentException.class });
try {
handler.handleException(new RepeatContextSupport(null), throwable);
@@ -82,7 +82,7 @@ public class SimpleLimitExceptionHandlerTests extends TestCase {
public void testLimitedExceptionTypeNotThrown() throws Exception {
final int MORE_THAN_ZERO = 1;
handler.setLimit(MORE_THAN_ZERO);
handler.setType(RuntimeException.class);
handler.setExceptionClasses(new Class[] {RuntimeException.class} );
try {
handler.handleException(new RepeatContextSupport(null), new RuntimeException("foo"));
@@ -101,7 +101,7 @@ public class SimpleLimitExceptionHandlerTests extends TestCase {
final int MORE_THAN_ZERO = 1;
handler.setLimit(MORE_THAN_ZERO);
handler.setType(RuntimeException.class);
handler.setExceptionClasses(new Class[] {RuntimeException.class});
RepeatContextSupport parent = new RepeatContextSupport(null);
@@ -125,7 +125,7 @@ public class SimpleLimitExceptionHandlerTests extends TestCase {
final int MORE_THAN_ZERO = 1;
handler.setLimit(MORE_THAN_ZERO);
handler.setType(RuntimeException.class);
handler.setExceptionClasses(new Class[] { RuntimeException.class } );
handler.setUseParent(true);
RepeatContextSupport parent = new RepeatContextSupport(null);