From a61a9842aef89e973e1b0cd6b438b8312e75b37a Mon Sep 17 00:00:00 2001 From: Dave Syer Date: Tue, 3 May 2011 08:09:25 +0100 Subject: [PATCH] BATCH-1739: add test (passes now showing workaround) --- .../xml/ParentStepFactoryBeanParserTests.java | 11 ++++++++ ...ableStepFactoryBeanParserTests-context.xml | 26 +++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/ParentSkippableStepFactoryBeanParserTests-context.xml diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/xml/ParentStepFactoryBeanParserTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/xml/ParentStepFactoryBeanParserTests.java index 333aa6395..2ec531b2e 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/xml/ParentStepFactoryBeanParserTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/xml/ParentStepFactoryBeanParserTests.java @@ -42,4 +42,15 @@ public class ParentStepFactoryBeanParserTests { assertTrue("Wrong processor type", chunkProcessor instanceof FaultTolerantChunkProcessor); } + @Test + public void testSkippableAttributes() throws Exception { + ConfigurableApplicationContext context = new ClassPathXmlApplicationContext( + "org/springframework/batch/core/configuration/xml/ParentSkippableStepFactoryBeanParserTests-context.xml"); + Object step = context.getBean("s1", Step.class); + assertNotNull("Step not parsed", step); + Object tasklet = ReflectionTestUtils.getField(step, "tasklet"); + Object chunkProcessor = ReflectionTestUtils.getField(tasklet, "chunkProcessor"); + assertTrue("Wrong processor type", chunkProcessor instanceof FaultTolerantChunkProcessor); + } + } diff --git a/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/ParentSkippableStepFactoryBeanParserTests-context.xml b/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/ParentSkippableStepFactoryBeanParserTests-context.xml new file mode 100644 index 000000000..409433076 --- /dev/null +++ b/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/ParentSkippableStepFactoryBeanParserTests-context.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file