RESOLVED - issue BATCH-1481: Support injection of step-scoped dependencies into unit tests

Revert a few of the more complicated options: just support a factory method
This commit is contained in:
dsyer
2010-01-07 07:50:21 +00:00
parent 983a2c81fe
commit 919fc0f8ff
6 changed files with 88 additions and 283 deletions

View File

@@ -29,16 +29,12 @@
</property>
</bean>
<bean id="itemReader" parent="itemReaderParent" scope="step" autowire-candidate="false">
<bean id="itemReader" parent="itemReaderParent" scope="step">
<property name="resource" value="#{jobParameters[fileName]}" />
</bean>
<bean id="itemReaderForTest" parent="itemReaderParent" scope="prototype" >
<property name="resource" value="data/iosample/input/delimited.csv" />
</bean>
<bean id="itemWriter" class="org.springframework.batch.item.file.FlatFileItemWriter">
<property name="resource" ref="outputResource" />
<property name="resource" value="file:./target/test-outputs/delimitedOutput.csv" />
<property name="lineAggregator">
<bean class="org.springframework.batch.item.file.transform.DelimitedLineAggregator">
<property name="delimiter" value=","/>
@@ -50,9 +46,5 @@
</bean>
</property>
</bean>
<bean id="outputResource" class="org.springframework.core.io.FileSystemResource">
<constructor-arg value="target/test-outputs/delimitedOutput.csv" />
</bean>
</beans>