BATCH-1285: Add additional test for unreachable step in a subflow
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans:beans xmlns="http://www.springframework.org/schema/batch" xmlns:beans="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/batch http://www.springframework.org/schema/batch/spring-batch-2.0.xsd
|
||||
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
|
||||
|
||||
<beans:import resource="common-context.xml" />
|
||||
|
||||
<job id="job1">
|
||||
<step id="s1" parent="step1" next="split1"/>
|
||||
<split id="split1">
|
||||
<flow>
|
||||
<step id="s2" parent="step2"/>
|
||||
</flow>
|
||||
<flow>
|
||||
<step id="s3" parent="step3"/>
|
||||
<step id="s4" parent="step4"/>
|
||||
</flow>
|
||||
</split>
|
||||
</job>
|
||||
|
||||
</beans:beans>
|
||||
Reference in New Issue
Block a user