add spring3 profile

This commit is contained in:
dsyer
2009-07-07 12:56:53 +00:00
parent abd28fe07a
commit b0d6e0e2b9
53 changed files with 142 additions and 2629 deletions

View File

@@ -30,21 +30,21 @@ import org.springframework.context.support.ClassPathXmlApplicationContext;
*/
public class AutoRegisteringStepScopeTests {
@SuppressWarnings("unchecked")
@Test
public void testJobElement() throws Exception {
ConfigurableApplicationContext ctx =
new ClassPathXmlApplicationContext("org/springframework/batch/core/configuration/xml/AutoRegisteringStepScopeForJobElementTests-context.xml");
Map<String, Object> beans = ctx.getBeansOfType(StepScope.class);
@SuppressWarnings("unchecked")
Map<String, StepScope> beans = ctx.getBeansOfType(StepScope.class);
assertTrue("StepScope not defined properly", beans.size() == 1);
}
@SuppressWarnings("unchecked")
@Test
public void testStepElement() throws Exception {
ConfigurableApplicationContext ctx =
new ClassPathXmlApplicationContext("org/springframework/batch/core/configuration/xml/AutoRegisteringStepScopeForStepElementTests-context.xml");
Map<String, Object> beans = ctx.getBeansOfType(StepScope.class);
@SuppressWarnings("unchecked")
Map<String, StepScope> beans = ctx.getBeansOfType(StepScope.class);
assertTrue("StepScope not defined properly", beans.size() == 1);
}

View File

@@ -174,7 +174,7 @@ public class ChunkElementParserTests {
@SuppressWarnings("unchecked")
private Set<Class<?>> getExceptionClasses(String stepName, String type, ApplicationContext ctx) throws Exception {
Map<String, Object> beans = ctx.getBeansOfType(Step.class);
Map<String, Step> beans = ctx.getBeansOfType(Step.class);
assertTrue(beans.containsKey(stepName));
Object step = ctx.getBean(stepName);
assertTrue(step instanceof TaskletStep);
@@ -190,7 +190,7 @@ public class ChunkElementParserTests {
@SuppressWarnings("unchecked")
private Collection<ItemStream> getStreams(String stepName, ApplicationContext ctx) throws Exception {
Map<String, Object> beans = ctx.getBeansOfType(Step.class);
Map<String, Step> beans = ctx.getBeansOfType(Step.class);
assertTrue(beans.containsKey(stepName));
Object step = ctx.getBean(stepName);
assertTrue(step instanceof TaskletStep);
@@ -201,7 +201,7 @@ public class ChunkElementParserTests {
@SuppressWarnings("unchecked")
private Collection<RetryListener> getRetryListeners(String stepName, ApplicationContext ctx) throws Exception {
Map<String, Object> beans = ctx.getBeansOfType(Step.class);
Map<String, Step> beans = ctx.getBeansOfType(Step.class);
assertTrue(beans.containsKey(stepName));
Object step = ctx.getBean(stepName);
assertTrue(step instanceof TaskletStep);

View File

@@ -89,7 +89,7 @@ public class StepListenerParserTests {
@SuppressWarnings("unchecked")
private List<?> getListeners(String stepName, ApplicationContext ctx) throws Exception {
Map<String, Object> beans = ctx.getBeansOfType(Step.class);
Map<String, Step> beans = ctx.getBeansOfType(Step.class);
assertTrue(beans.containsKey(stepName));
Object step = ctx.getBean(stepName);
assertTrue(step instanceof TaskletStep);

View File

@@ -61,25 +61,26 @@ public class StepParserTests {
"org/springframework/batch/core/configuration/xml/StepParserParentAttributeTests-context.xml");
}
@SuppressWarnings("unchecked")
@Test
public void testTaskletStepAttributes() throws Exception {
ConfigurableApplicationContext ctx = new ClassPathXmlApplicationContext(
"org/springframework/batch/core/configuration/xml/StepParserTaskletAttributesTests-context.xml");
Map<String, Object> beans = ctx.getBeansOfType(StepParserStepFactoryBean.class);
@SuppressWarnings("unchecked")
Map<String, StepParserStepFactoryBean> beans = ctx.getBeansOfType(StepParserStepFactoryBean.class);
String factoryName = (String) beans.keySet().toArray()[0];
@SuppressWarnings("unchecked")
StepParserStepFactoryBean<Object, Object> factory = (StepParserStepFactoryBean<Object, Object>) beans
.get(factoryName);
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);
@SuppressWarnings("unchecked")
Map<String, Step> beans = ctx.getBeansOfType(Step.class);
assertTrue("'s1' bean not found", beans.containsKey("s1"));
Step s1 = (Step) ctx.getBean("s1");
assertEquals("wrong name", "s1", s1.getName());
@@ -91,12 +92,12 @@ public class StepParserTests {
"org/springframework/batch/core/configuration/xml/StepParserCommitIntervalCompletionPolicyTests-context.xml");
}
@SuppressWarnings("unchecked")
@Test
public void testStepParserCommitInterval() throws Exception {
ConfigurableApplicationContext ctx = new ClassPathXmlApplicationContext(
"org/springframework/batch/core/configuration/xml/StepParserCommitIntervalTests-context.xml");
Map<String, Object> beans = ctx.getBeansOfType(Step.class);
@SuppressWarnings("unchecked")
Map<String, Step> beans = ctx.getBeansOfType(Step.class);
assertTrue("'s1' bean not found", beans.containsKey("s1"));
Step s1 = (Step) ctx.getBean("s1");
CompletionPolicy completionPolicy = getCompletionPolicy(s1);
@@ -104,12 +105,12 @@ public class StepParserTests {
assertEquals(25, ReflectionTestUtils.getField(completionPolicy, "chunkSize"));
}
@SuppressWarnings("unchecked")
@Test
public void testStepParserCompletionPolicy() throws Exception {
ConfigurableApplicationContext ctx = new ClassPathXmlApplicationContext(
"org/springframework/batch/core/configuration/xml/StepParserCompletionPolicyTests-context.xml");
Map<String, Object> beans = ctx.getBeansOfType(Step.class);
@SuppressWarnings("unchecked")
Map<String, Step> beans = ctx.getBeansOfType(Step.class);
assertTrue("'s1' bean not found", beans.containsKey("s1"));
Step s1 = (Step) ctx.getBean("s1");
CompletionPolicy completionPolicy = getCompletionPolicy(s1);