RESLOVED - BATCH-346: CommandLineJobRunner now requires just single xml file argument, samples modified to use import statement (and removed parent context loading from test launcher)

This commit is contained in:
robokaso
2008-02-29 08:54:09 +00:00
parent a2135adbba
commit ac1f86b1a5
23 changed files with 71 additions and 56 deletions

View File

@@ -55,7 +55,7 @@
<property name="location" value="classpath:batch.properties" />
<property name="systemPropertiesModeName"
value="SYSTEM_PROPERTIES_MODE_OVERRIDE" />
<property name="ignoreUnresolvablePlaceholders" value="false" />
<property name="ignoreUnresolvablePlaceholders" value="true" />
<property name="order" value="1" />
</bean>

View File

@@ -10,6 +10,8 @@
<!-- The tasklet used in this job will run in an infinite loop. This is useful for testing graceful shutdown from
multiple environments. -->
<import resource="../simple-container-definition.xml" />
<bean parent="stepScope" />
<bean parent="jobConfigurationRegistryBeanPostProcessor" />

View File

@@ -8,7 +8,9 @@
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd">
<import resource="../simple-container-definition.xml" />
<bean parent="stepScope" />
<bean parent="jobConfigurationRegistryBeanPostProcessor" />
@@ -49,15 +51,14 @@
<bean id="fileInputTemplate"
class="org.springframework.batch.io.file.FlatFileItemReader">
<property name="resource" ref="fileLocator" />
<property name="resource" value="classpath:data/beanWrapperMapperSampleJob/input/20070122.teststream.ImportTradeDataStep.txt" />
<property name="lineTokenizer" ref="fixedFileDescriptor" />
<property name="fieldSetMapper" ref="fieldSetMapper" />
</bean>
<bean id="fileInputTemplate2"
class="org.springframework.batch.io.file.FlatFileItemReader"
scope="step">
<property name="resource" ref="fileLocator2" />
class="org.springframework.batch.io.file.FlatFileItemReader">
<property name="resource" value="classpath:data/beanWrapperMapperSampleJob/input/20070122.teststream.ImportPersonDataStep.txt" />
<property name="lineTokenizer" ref="fixedFileDescriptor2" />
<property name="fieldSetMapper" ref="fieldSetMapper2" />
<!-- <property name="validator" ref="fixedValidator" />-->
@@ -103,20 +104,6 @@
</property>
</bean>
<bean id="fileLocator"
class="org.springframework.core.io.ClassPathResource">
<constructor-arg type="java.lang.String"
value="data/beanWrapperMapperSampleJob/input/20070122.teststream.ImportTradeDataStep.txt" />
</bean>
<bean id="fileLocator2"
class="org.springframework.core.io.ClassPathResource">
<constructor-arg type="java.lang.String"
value="data/beanWrapperMapperSampleJob/input/20070122.teststream.ImportPersonDataStep.txt" />
</bean>
<bean id="fieldSetMapper"
class="org.springframework.batch.io.file.mapping.BeanWrapperFieldSetMapper">
<property name="prototypeBeanName" value="trade" />

View File

@@ -7,6 +7,8 @@
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd">
<import resource="../simple-container-definition.xml" />
<bean parent="stepScope"/>
<bean parent="jobConfigurationRegistryBeanPostProcessor"/>

View File

@@ -14,7 +14,9 @@
definitions (e.g. from custom application's domain layer) can be
integrated into a batch job.
</description>
<import resource="../simple-container-definition.xml" />
<bean
class="org.springframework.batch.execution.configuration.JobRegistryBeanPostProcessor">
<property name="jobConfigurationRegistry"

View File

@@ -8,7 +8,9 @@
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd">
<import resource="../simple-container-definition.xml" />
<bean parent="stepScope" />
<bean parent="jobConfigurationRegistryBeanPostProcessor" />

View File

@@ -9,6 +9,8 @@
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd">
<import resource="../simple-container-definition.xml" />
<bean parent="stepScope" />
<bean parent="jobConfigurationRegistryBeanPostProcessor" />

View File

@@ -10,7 +10,9 @@
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">
<description>Example for Hibernate integration.</description>
<import resource="../simple-container-definition.xml" />
<bean parent="stepScope" />
<bean parent="jobConfigurationRegistryBeanPostProcessor" />

View File

@@ -10,7 +10,9 @@
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd">
<description>Example for iBATIS integration.</description>
<import resource="../simple-container-definition.xml" />
<bean parent="stepScope" />
<bean parent="jobConfigurationRegistryBeanPostProcessor" />

View File

@@ -8,7 +8,9 @@
<!-- The tasklet used in this job will run in an infinite loop. This is useful for testing graceful shutdown from
multiple environments. -->
<import resource="../simple-container-definition.xml" />
<bean parent="stepScope"/>
<bean parent="jobConfigurationRegistryBeanPostProcessor"/>

View File

@@ -6,7 +6,9 @@
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
<import resource="../simple-container-definition.xml" />
<bean parent="stepScope" />
<bean parent="jobConfigurationRegistryBeanPostProcessor" />

View File

@@ -6,6 +6,8 @@
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
<import resource="../simple-container-definition.xml" />
<import resource="multilineOrderInputDescriptors.xml" />
<import resource="multilineOrderOutputDescriptors.xml" />
<import resource="multilineOrderIo.xml" />

View File

@@ -8,7 +8,9 @@
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd">
<import resource="../simple-container-definition.xml" />
<bean parent="stepScope" />
<bean parent="jobConfigurationRegistryBeanPostProcessor" />

View File

@@ -8,7 +8,9 @@
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd">
<import resource="../simple-container-definition.xml" />
<bean parent="stepScope" />
<bean parent="jobConfigurationRegistryBeanPostProcessor" />
<bean parent="customEditorConfigurer" />

View File

@@ -8,7 +8,9 @@
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd">
<import resource="../simple-container-definition.xml" />
<bean parent="stepScope" />
<bean parent="jobConfigurationRegistryBeanPostProcessor" />

View File

@@ -7,7 +7,9 @@
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
<import resource="../simple-container-definition.xml" />
<import resource="tradeJobIo.xml" />
<!--import resource="tradeJobAop.xml" /-->

View File

@@ -7,6 +7,8 @@
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
<import resource="../simple-container-definition.xml" />
<bean parent="stepScope"/>
<bean parent="jobConfigurationRegistryBeanPostProcessor"/>

View File

@@ -8,6 +8,8 @@
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
<import resource="../simple-container-definition.xml" />
<import resource="tradeJobIo.xml" />
<bean parent="stepScope"/>

View File

@@ -10,7 +10,9 @@
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd">
<import resource="../simple-container-definition.xml" />
<bean parent="stepScope" />
<bean parent="jobConfigurationRegistryBeanPostProcessor" />

View File

@@ -19,7 +19,6 @@ package org.springframework.batch.sample;
import org.springframework.batch.core.domain.Job;
import org.springframework.batch.core.domain.JobParameters;
import org.springframework.batch.execution.launch.JobLauncher;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.test.AbstractDependencyInjectionSpringContextTests;
@@ -36,7 +35,7 @@ import org.springframework.test.AbstractDependencyInjectionSpringContextTests;
public abstract class AbstractBatchLauncherTests extends
AbstractDependencyInjectionSpringContextTests {
private static final String CONTAINER_DEFINITION_LOCATION = "simple-container-definition.xml";
// private static final String CONTAINER_DEFINITION_LOCATION = "simple-container-definition.xml";
public AbstractBatchLauncherTests() {
setDependencyCheck(false);
@@ -54,9 +53,7 @@ public abstract class AbstractBatchLauncherTests extends
*/
protected ConfigurableApplicationContext createApplicationContext(
String[] locations) {
ApplicationContext parent = new ClassPathXmlApplicationContext(
CONTAINER_DEFINITION_LOCATION);
return new ClassPathXmlApplicationContext(locations, parent);
return new ClassPathXmlApplicationContext(locations);
}
public void setLauncher(JobLauncher bootstrap) {