From 84a5f0d7aa7fa2c0019c945d82cbc1c03d631cef Mon Sep 17 00:00:00 2001 From: dhgarrette Date: Thu, 11 Jun 2009 05:42:35 +0000 Subject: [PATCH] BATCH-1285: Add additional test for unreachable step in a subflow --- .../configuration/xml/JobParserTests.java | 12 ++++++++++ ...rserUnreachableStepInFlowTests-context.xml | 22 +++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/JobParserUnreachableStepInFlowTests-context.xml 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 @@ + + + + + + + + + + + + + + + + + + +