BATCH-1004: parser now uses the step name for bean references to step bean definitions

This commit is contained in:
trisberg
2009-01-27 02:20:06 +00:00
parent c5da264dae
commit e68d9a246a
3 changed files with 601 additions and 568 deletions

View File

@@ -15,13 +15,14 @@
*/
package org.springframework.batch.core.configuration.xml;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import java.util.Map;
import org.junit.Test;
import org.springframework.batch.core.Step;
import org.springframework.batch.core.step.item.FaultTolerantStepFactoryBean;
import org.springframework.batch.core.step.tasklet.TaskletStep;
import org.springframework.beans.factory.parsing.BeanDefinitionParsingException;
@@ -45,6 +46,16 @@ public class StepParserTests {
TaskletStep bean = (TaskletStep) factory.getObject();
assertEquals("wrong start-limit:", 25, bean.getStartLimit());
}
@SuppressWarnings("unchecked")
@Test
public void testStepParserBeanName() throws Exception {
ConfigurableApplicationContext ctx =
new ClassPathXmlApplicationContext("org/springframework/batch/core/configuration/xml/StepParserBeanNameTests-context.xml");
Map<String, Object> beans = ctx.getBeansOfType(Step.class);
assertTrue("'step1' bean not found", beans.containsKey("step1"));
assertTrue("'step2' bean not found", beans.containsKey("step2"));
}
@Test
public void testTaskletStepWithBadStepListener() throws Exception {