BATCH-1841 ChunkElementParser Inheritance Error
Fixes bug in ChunkElementParser that caused the retryable-exception-classes and skippable-exception-classes defined on parent bean to be ignored. Polishing Reverted spaces to tabs and added another test.
This commit is contained in:
committed by
Gary Russell
parent
1ce4cb1e95
commit
49645285d4
@@ -15,16 +15,6 @@
|
||||
*/
|
||||
package org.springframework.batch.core.configuration.xml;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.springframework.batch.classify.SubclassClassifier;
|
||||
import org.springframework.batch.core.Step;
|
||||
@@ -49,6 +39,17 @@ import org.springframework.dao.PessimisticLockingFailureException;
|
||||
import org.springframework.test.util.ReflectionTestUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
/**
|
||||
* @author Dan Garrette
|
||||
* @author Dave Syer
|
||||
@@ -183,6 +184,22 @@ public class ChunkElementParserTests {
|
||||
containsClassified(retryable, CannotSerializeTransactionException.class, false);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRetryableInherited() throws Exception {
|
||||
Map<Class<? extends Throwable>, Boolean> retryable = getRetryableExceptionClasses("s3", getContext());
|
||||
System.err.println(retryable);
|
||||
assertEquals(2, retryable.size());
|
||||
containsClassified(retryable, IOException.class, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRetryableInheritedMerge() throws Exception {
|
||||
Map<Class<? extends Throwable>, Boolean> retryable = getRetryableExceptionClasses("s4", getContext());
|
||||
System.err.println(retryable);
|
||||
assertEquals(3, retryable.size());
|
||||
containsClassified(retryable, IOException.class, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testInheritSkippable() throws Exception {
|
||||
Map<Class<? extends Throwable>, Boolean> skippable = getSkippableExceptionClasses("s1", getContext());
|
||||
|
||||
Reference in New Issue
Block a user