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.

Updated config for ParentStepFactoryBeanParserTests
			.testSkippableLateBindingAttributes
This commit is contained in:
Damien Hollis
2012-03-02 15:22:39 +13:00
committed by Gary Russell
parent 4b552d0113
commit c5675b23a5
4 changed files with 78 additions and 21 deletions

View File

@@ -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());