From d4710ab1be559298960d7e954db434c6794d1f72 Mon Sep 17 00:00:00 2001 From: robokaso Date: Wed, 19 Mar 2008 13:58:52 +0000 Subject: [PATCH] OPEN - issue BATCH-490: SkipLimitStepFactoryBean ignores the skippableExceptionClasses property http://jira.springframework.org/browse/BATCH-490 fixed the obvious bug, but found deeper issue (see TODO in tests) --- .../batch/core/step/item/SkipLimitStepFactoryBean.java | 2 +- .../batch/core/step/item/SkipLimitStepFactoryBeanTests.java | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/step/item/SkipLimitStepFactoryBean.java b/spring-batch-core/src/main/java/org/springframework/batch/core/step/item/SkipLimitStepFactoryBean.java index ebdc75eca..b91e85ce5 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/step/item/SkipLimitStepFactoryBean.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/step/item/SkipLimitStepFactoryBean.java @@ -59,7 +59,7 @@ public class SkipLimitStepFactoryBean extends SimpleStepFactoryBean { SimpleLimitExceptionHandler exceptionHandler = new SimpleLimitExceptionHandler(); exceptionHandler.setLimit(skipLimit); exceptionHandler.setExceptionClasses(skippableExceptionClasses); - setExceptionHandler(new SimpleLimitExceptionHandler(skipLimit)); + setExceptionHandler(exceptionHandler); getStepOperations().setExceptionHandler(getExceptionHandler()); } else { diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/step/item/SkipLimitStepFactoryBeanTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/step/item/SkipLimitStepFactoryBeanTests.java index ed507b149..09b1ecf1e 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/step/item/SkipLimitStepFactoryBeanTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/step/item/SkipLimitStepFactoryBeanTests.java @@ -24,6 +24,7 @@ import org.springframework.batch.item.ParseException; import org.springframework.batch.item.ResetFailedException; import org.springframework.batch.item.Skippable; import org.springframework.batch.item.UnexpectedInputException; +import org.springframework.batch.repeat.RepeatException; import org.springframework.batch.support.transaction.ResourcelessTransactionManager; /** @@ -33,7 +34,8 @@ public class SkipLimitStepFactoryBeanTests extends TestCase { SkipLimitStepFactoryBean tested = new SkipLimitStepFactoryBean(); - Class[] skippableExceptions = new Class[] { SkippableException.class, SkippableRuntimeException.class }; + // TODO checked exceptions are wrapped as RepeatExceptions by the chunkOperations#exceptionHandler + Class[] skippableExceptions = new Class[] { RepeatException.class, SkippableException.class, SkippableRuntimeException.class }; final int SKIP_LIMIT = 2;