diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/xml/JobParserTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/xml/JobParserTests.java index 6a74d1a06..fae03eb83 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/xml/JobParserTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/xml/JobParserTests.java @@ -158,6 +158,18 @@ public class JobParserTests { } } + @Test + public void testUnreachableStepInFlow() { + try { + new ClassPathXmlApplicationContext( + "org/springframework/batch/core/configuration/xml/JobParserUnreachableStepInFlowTests-context.xml"); + fail("Error expected"); + } + catch (BeanDefinitionParsingException e) { + assertTrue(e.getMessage().contains("The element [s4] is unreachable")); + } + } + @Test public void testNextOutOfScope() { try { diff --git a/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/JobParserUnreachableStepInFlowTests-context.xml b/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/JobParserUnreachableStepInFlowTests-context.xml new file mode 100644 index 000000000..83b3dce25 --- /dev/null +++ b/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/JobParserUnreachableStepInFlowTests-context.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + +