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:
@@ -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>
|
||||
|
||||
|
||||
@@ -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" />
|
||||
|
||||
|
||||
@@ -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" />
|
||||
|
||||
@@ -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"/>
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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" />
|
||||
|
||||
|
||||
@@ -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" />
|
||||
|
||||
|
||||
@@ -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" />
|
||||
|
||||
|
||||
@@ -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" />
|
||||
|
||||
|
||||
@@ -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"/>
|
||||
|
||||
|
||||
@@ -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" />
|
||||
|
||||
|
||||
@@ -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" />
|
||||
|
||||
@@ -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" />
|
||||
|
||||
|
||||
@@ -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" />
|
||||
|
||||
@@ -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" />
|
||||
|
||||
|
||||
@@ -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" /-->
|
||||
|
||||
|
||||
@@ -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"/>
|
||||
|
||||
|
||||
@@ -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"/>
|
||||
|
||||
@@ -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" />
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user