BATCH-162: FootballJob unit test now uses a file with a smaller dataset, and has been removed from the exclusion portion of the pom. A .launch has been added which uses the large files.

This commit is contained in:
lucasward
2008-01-17 14:43:51 +00:00
parent ddac3e8e5e
commit 682cfb560f
2 changed files with 170 additions and 162 deletions

View File

@@ -188,7 +188,6 @@
</includes>
<excludes>
<exclude>**/Abstract*.java</exclude>
<exclude>**/FootballJobFunctionalTests.java</exclude>
</excludes>
</configuration>
</plugin>

View File

@@ -1,162 +1,171 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
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">
<bean parent="stepScope" />
<bean parent="jobConfigurationRegistryBeanPostProcessor" />
<bean id="footballJob"
class="org.springframework.batch.core.domain.Job">
<property name="restartable" value="true" />
<property name="startLimit" value="100" />
<property name="steps">
<list>
<bean id="playerload"
class="org.springframework.batch.execution.step.SimpleStep">
<property name="commitInterval" value="100"></property>
<property name="startLimit" value="100" />
<property name="saveRestartData" value="true" />
<property name="allowStartIfComplete" value="false" />
<property name="tasklet">
<bean
class="org.springframework.batch.execution.tasklet.RestartableItemOrientedTasklet">
<property name="itemReader" ref="playerFileItemReader" />
<property name="itemProcessor">
<bean
class="org.springframework.batch.sample.item.processor.PlayerItemProcessor">
<property name="playerDao">
<bean
class="org.springframework.batch.sample.dao.JdbcPlayerDao">
<property name="dataSource"
ref="dataSource" />
</bean>
</property>
</bean>
</property>
</bean>
</property>
</bean>
<bean id="gameLoad"
class="org.springframework.batch.execution.step.SimpleStep">
<property name="commitInterval" value="1000" />
<property name="startLimit" value="100" />
<property name="saveRestartData" value="true" />
<property name="tasklet">
<bean
class="org.springframework.batch.execution.tasklet.RestartableItemOrientedTasklet">
<property name="itemReader" ref="gameFileItemReader" />
<property name="itemProcessor">
<bean
class="org.springframework.batch.item.processor.ItemWriterItemProcessor">
<property name="itemWriter">
<bean
class="org.springframework.batch.sample.dao.JdbcGameDao">
<property name="dataSource"
ref="dataSource" />
</bean>
</property>
</bean>
</property>
</bean>
</property>
</bean>
<bean id="playerSummarization"
class="org.springframework.batch.execution.step.SimpleStep">
<property name="commitInterval" value="100" />
<property name="startLimit" value="100" />
<property name="saveRestartData" value="true" />
<property name="tasklet">
<bean
class="org.springframework.batch.execution.tasklet.RestartableItemOrientedTasklet">
<property name="itemReader" ref="playerSummarizationSource" />
<property name="itemProcessor">
<bean
class="org.springframework.batch.item.processor.ItemWriterItemProcessor">
<property name="itemWriter">
<bean
class="org.springframework.batch.sample.dao.JdbcPlayerSummaryDao">
<property name="dataSource"
ref="dataSource" />
</bean>
</property>
</bean>
</property>
</bean>
</property>
</bean>
</list>
</property>
</bean>
<bean id="playerFileItemReader"
class="org.springframework.batch.io.file.DefaultFlatFileItemReader" scope="step">
<aop:scoped-proxy/>
<property name="resource" value="classpath:data/footballjob/input/player.csv" />
<property name="tokenizer">
<bean
class="org.springframework.batch.io.file.transform.DelimitedLineTokenizer">
<property name="names"
value="ID,lastName,firstName,position,birthYear,debutYear" />
</bean>
</property>
<property name="fieldSetMapper">
<bean
class="org.springframework.batch.sample.mapping.PlayerMapper" />
</property>
</bean>
<bean id="gameFileItemReader"
class="org.springframework.batch.io.file.DefaultFlatFileItemReader" scope="step">
<aop:scoped-proxy/>
<property name="resource" value="classpath:data/footballjob/input/games.csv"/>
<property name="tokenizer">
<bean
class="org.springframework.batch.io.file.transform.DelimitedLineTokenizer">
<property name="names"
value="id,year,team,week,opponent,completes,attempts,passingYards,passingTd,interceptions,rushes,rushYards,receptions,receptionYards,totalTd" />
</bean>
</property>
<property name="fieldSetMapper">
<bean
class="org.springframework.batch.sample.mapping.GameMapper" />
</property>
</bean>
<bean id="playerSummarizationSource"
class="org.springframework.batch.io.cursor.JdbcCursorItemReader" scope="step">
<aop:scoped-proxy/>
<property name="dataSource" ref="dataSource" />
<property name="mapper">
<bean
class="org.springframework.batch.sample.mapping.PlayerSummaryMapper" />
</property>
<property name="sql">
<value>
SELECT games.player_id, games.year_no, SUM(COMPLETES),
SUM(ATTEMPTS), SUM(PASSING_YARDS), SUM(PASSING_TD),
SUM(INTERCEPTIONS), SUM(RUSHES), SUM(RUSH_YARDS),
SUM(RECEPTIONS), SUM(RECEPTIONS_YARDS), SUM(TOTAL_TD)
from games, players where players.player_id =
games.player_id group by games.player_id, games.year_no
</value>
</property>
</bean>
<aop:config>
<aop:aspect id="moduleLogging" ref="itemProcessorLogAdvice">
<aop:after
pointcut="execution( * org.springframework.batch.item.ItemProcessor+.process(Object)) and args(item)"
method="doStronglyTypedLogging" />
</aop:aspect>
</aop:config>
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
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">
<bean parent="stepScope" />
<bean parent="jobConfigurationRegistryBeanPostProcessor" />
<bean id="footballJob"
class="org.springframework.batch.core.domain.Job">
<property name="restartable" value="true" />
<property name="startLimit" value="100" />
<property name="steps">
<list>
<bean id="playerload"
class="org.springframework.batch.execution.step.SimpleStep">
<property name="commitInterval" value="100"></property>
<property name="startLimit" value="100" />
<property name="saveRestartData" value="true" />
<property name="allowStartIfComplete" value="false" />
<property name="tasklet">
<bean
class="org.springframework.batch.execution.tasklet.RestartableItemOrientedTasklet">
<property name="itemReader" ref="playerFileItemReader" />
<property name="itemProcessor">
<bean
class="org.springframework.batch.sample.item.processor.PlayerItemProcessor">
<property name="playerDao">
<bean
class="org.springframework.batch.sample.dao.JdbcPlayerDao">
<property name="dataSource"
ref="dataSource" />
</bean>
</property>
</bean>
</property>
</bean>
</property>
</bean>
<bean id="gameLoad"
class="org.springframework.batch.execution.step.SimpleStep">
<property name="commitInterval" value="1000" />
<property name="startLimit" value="100" />
<property name="saveRestartData" value="true" />
<property name="tasklet">
<bean
class="org.springframework.batch.execution.tasklet.RestartableItemOrientedTasklet">
<property name="itemReader" ref="gameFileItemReader" />
<property name="itemProcessor">
<bean
class="org.springframework.batch.item.processor.ItemWriterItemProcessor">
<property name="itemWriter">
<bean
class="org.springframework.batch.sample.dao.JdbcGameDao">
<property name="dataSource"
ref="dataSource" />
</bean>
</property>
</bean>
</property>
</bean>
</property>
</bean>
<bean id="playerSummarization"
class="org.springframework.batch.execution.step.SimpleStep">
<property name="commitInterval" value="100" />
<property name="startLimit" value="100" />
<property name="saveRestartData" value="true" />
<property name="tasklet">
<bean
class="org.springframework.batch.execution.tasklet.RestartableItemOrientedTasklet">
<property name="itemReader" ref="playerSummarizationSource" />
<property name="itemProcessor">
<bean
class="org.springframework.batch.item.processor.ItemWriterItemProcessor">
<property name="itemWriter">
<bean
class="org.springframework.batch.sample.dao.JdbcPlayerSummaryDao">
<property name="dataSource"
ref="dataSource" />
</bean>
</property>
</bean>
</property>
</bean>
</property>
</bean>
</list>
</property>
</bean>
<bean id="playerFileItemReader"
class="org.springframework.batch.io.file.DefaultFlatFileItemReader" scope="step">
<aop:scoped-proxy/>
<property name="resource" value="classpath:data/footballjob/input/${player.file.name}" />
<property name="tokenizer">
<bean
class="org.springframework.batch.io.file.transform.DelimitedLineTokenizer">
<property name="names"
value="ID,lastName,firstName,position,birthYear,debutYear" />
</bean>
</property>
<property name="fieldSetMapper">
<bean
class="org.springframework.batch.sample.mapping.PlayerMapper" />
</property>
</bean>
<bean id="gameFileItemReader"
class="org.springframework.batch.io.file.DefaultFlatFileItemReader" scope="step">
<aop:scoped-proxy/>
<property name="resource" value="classpath:data/footballjob/input/${games.file.name}"/>
<property name="tokenizer">
<bean
class="org.springframework.batch.io.file.transform.DelimitedLineTokenizer">
<property name="names"
value="id,year,team,week,opponent,completes,attempts,passingYards,passingTd,interceptions,rushes,rushYards,receptions,receptionYards,totalTd" />
</bean>
</property>
<property name="fieldSetMapper">
<bean
class="org.springframework.batch.sample.mapping.GameMapper" />
</property>
</bean>
<bean id="playerSummarizationSource"
class="org.springframework.batch.io.cursor.JdbcCursorItemReader" scope="step">
<aop:scoped-proxy/>
<property name="dataSource" ref="dataSource" />
<property name="mapper">
<bean
class="org.springframework.batch.sample.mapping.PlayerSummaryMapper" />
</property>
<property name="sql">
<value>
SELECT games.player_id, games.year_no, SUM(COMPLETES),
SUM(ATTEMPTS), SUM(PASSING_YARDS), SUM(PASSING_TD),
SUM(INTERCEPTIONS), SUM(RUSHES), SUM(RUSH_YARDS),
SUM(RECEPTIONS), SUM(RECEPTIONS_YARDS), SUM(TOTAL_TD)
from games, players where players.player_id =
games.player_id group by games.player_id, games.year_no
</value>
</property>
</bean>
<aop:config>
<aop:aspect id="moduleLogging" ref="itemProcessorLogAdvice">
<aop:after
pointcut="execution( * org.springframework.batch.item.ItemProcessor+.process(Object)) and args(item)"
method="doStronglyTypedLogging" />
</aop:aspect>
</aop:config>
<bean
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="location" value="classpath:data/footballJob/input/input.properties" />
<property name="systemPropertiesModeName"
value="SYSTEM_PROPERTIES_MODE_OVERRIDE" />
<property name="ignoreUnresolvablePlaceholders" value="false" />
<property name="order" value="1" />
</bean>
</beans>