Merge spring-batch-core-tests in spring-batch-core
This commit is contained in:
@@ -0,0 +1,112 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:aop="http://www.springframework.org/schema/aop"
|
||||
xmlns:p="http://www.springframework.org/schema/p"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/aop https://www.springframework.org/schema/aop/spring-aop-3.1.xsd
|
||||
http://www.springframework.org/schema/batch https://www.springframework.org/schema/batch/spring-batch-2.2.xsd
|
||||
http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans-3.1.xsd">
|
||||
|
||||
<job id="footballJob" xmlns="http://www.springframework.org/schema/batch">
|
||||
<step id="playerload" next="gameLoad">
|
||||
<tasklet>
|
||||
<chunk reader="playerFileItemReader" writer="playerWriter"
|
||||
commit-interval="#{jobParameters['commit.interval']}"/>
|
||||
</tasklet>
|
||||
</step>
|
||||
<step id="gameLoad" next="playerSummarization">
|
||||
<tasklet>
|
||||
<chunk reader="gameFileItemReader" writer="gameWriter"
|
||||
commit-interval="${job.commit.interval}" />
|
||||
</tasklet>
|
||||
</step>
|
||||
<step id="playerSummarization" parent="summarizationStep" />
|
||||
</job>
|
||||
|
||||
<step id="summarizationStep" xmlns="http://www.springframework.org/schema/batch">
|
||||
<tasklet>
|
||||
<chunk reader="playerSummarizationSource" writer="summaryWriter"
|
||||
commit-interval="${job.commit.interval}" />
|
||||
</tasklet>
|
||||
</step>
|
||||
|
||||
<bean id="playerWriter" class="org.springframework.batch.core.test.football.internal.PlayerItemWriter">
|
||||
<property name="playerDao">
|
||||
<bean class="org.springframework.batch.core.test.football.internal.JdbcPlayerDao">
|
||||
<property name="dataSource" ref="dataSource" />
|
||||
</bean>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="gameWriter" class="org.springframework.batch.core.test.football.internal.JdbcGameDao">
|
||||
<property name="dataSource" ref="dataSource" />
|
||||
</bean>
|
||||
|
||||
<bean id="summaryWriter" class="org.springframework.batch.core.test.football.internal.JdbcPlayerSummaryDao">
|
||||
<property name="dataSource" ref="dataSource" />
|
||||
</bean>
|
||||
|
||||
<bean id="playerFileItemReader" class="org.springframework.batch.item.file.FlatFileItemReader">
|
||||
<property name="resource" value="classpath:data/football/${player.file.name}" />
|
||||
<property name="lineMapper">
|
||||
<bean class="org.springframework.batch.item.file.mapping.DefaultLineMapper">
|
||||
<property name="lineTokenizer">
|
||||
<bean class="org.springframework.batch.item.file.transform.DelimitedLineTokenizer">
|
||||
<property name="names" value="ID,lastName,firstName,position,birthYear,debutYear" />
|
||||
</bean>
|
||||
</property>
|
||||
<property name="fieldSetMapper">
|
||||
<bean class="org.springframework.batch.core.test.football.internal.PlayerFieldSetMapper" />
|
||||
</property>
|
||||
</bean>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="gameFileItemReader" class="org.springframework.batch.item.file.FlatFileItemReader">
|
||||
<property name="resource" value="classpath:data/football/${games.file.name}" />
|
||||
<property name="lineMapper">
|
||||
<bean class="org.springframework.batch.item.file.mapping.DefaultLineMapper">
|
||||
<property name="lineTokenizer">
|
||||
<bean class="org.springframework.batch.item.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.core.test.football.internal.GameFieldSetMapper" />
|
||||
</property>
|
||||
</bean>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="playerSummarizationSource" class="org.springframework.batch.item.database.JdbcCursorItemReader">
|
||||
<property name="dataSource" ref="dataSource" />
|
||||
<property name="verifyCursorPosition" value="${batch.verify.cursor.position}" />
|
||||
<property name="rowMapper">
|
||||
<bean class="org.springframework.batch.core.test.football.internal.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>
|
||||
|
||||
<bean id="footballProperties" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
|
||||
<property name="properties">
|
||||
<value>
|
||||
games.file.name=games-small.csv
|
||||
player.file.name=player-small.csv
|
||||
job.commit.interval=2
|
||||
</value>
|
||||
</property>
|
||||
<property name="systemPropertiesModeName" value="SYSTEM_PROPERTIES_MODE_OVERRIDE" />
|
||||
<property name="ignoreUnresolvablePlaceholders" value="true" />
|
||||
<property name="order" value="1" />
|
||||
</bean>
|
||||
|
||||
</beans>
|
||||
@@ -0,0 +1,132 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:aop="http://www.springframework.org/schema/aop"
|
||||
xmlns:p="http://www.springframework.org/schema/p" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/aop https://www.springframework.org/schema/aop/spring-aop-3.1.xsd
|
||||
http://www.springframework.org/schema/batch https://www.springframework.org/schema/batch/spring-batch-2.2.xsd
|
||||
http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans-3.1.xsd">
|
||||
|
||||
<job id="footballSkipJob" xmlns="http://www.springframework.org/schema/batch">
|
||||
<step id="playerload" next="gameLoad">
|
||||
<tasklet>
|
||||
<chunk reader="playerFileItemReader" writer="playerWriter" commit-interval="${job.commit.interval}"
|
||||
skip-policy="skipPolicy" retry-policy="retryPolicy"/>
|
||||
</tasklet>
|
||||
</step>
|
||||
<step id="gameLoad" next="playerSummarization">
|
||||
<tasklet>
|
||||
<chunk reader="gameFileItemReader" writer="gameWriter" commit-interval="${job.commit.interval}" skip-limit="100000">
|
||||
<skippable-exception-classes>
|
||||
<include class="org.springframework.dao.DataAccessException" />
|
||||
</skippable-exception-classes>
|
||||
</chunk>
|
||||
</tasklet>
|
||||
</step>
|
||||
<step id="playerSummarization" parent="summarizationStep" />
|
||||
</job>
|
||||
|
||||
<bean id="skipPolicy" class="org.springframework.batch.core.step.skip.LimitCheckingItemSkipPolicy" scope="step">
|
||||
<property name="skipLimit" value="#{jobParameters['skip.limit']}" />
|
||||
<property name="skippableExceptionMap">
|
||||
<map key-type="java.lang.Class">
|
||||
<entry key="org.springframework.dao.DataAccessException" value="true"/>
|
||||
</map>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="retryPolicy" class="org.springframework.retry.policy.SimpleRetryPolicy" scope="step">
|
||||
<constructor-arg value="#{jobParameters['retry.limit']}"/>
|
||||
<constructor-arg>
|
||||
<map key-type="java.lang.Class">
|
||||
<entry key="org.springframework.dao.DataAccessException" value="true"/>
|
||||
</map>
|
||||
</constructor-arg>
|
||||
</bean>
|
||||
|
||||
<step id="summarizationStep" xmlns="http://www.springframework.org/schema/batch">
|
||||
<tasklet>
|
||||
<chunk reader="playerSummarizationSource" writer="summaryWriter" commit-interval="${job.commit.interval}" />
|
||||
</tasklet>
|
||||
</step>
|
||||
|
||||
<bean id="playerWriter" class="org.springframework.batch.core.test.football.internal.PlayerItemWriter">
|
||||
<property name="playerDao">
|
||||
<bean class="org.springframework.batch.core.test.football.internal.JdbcPlayerDao">
|
||||
<property name="dataSource" ref="dataSource" />
|
||||
</bean>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="gameWriter" class="org.springframework.batch.core.test.football.internal.JdbcGameDao">
|
||||
<property name="dataSource" ref="dataSource" />
|
||||
</bean>
|
||||
|
||||
<bean id="summaryWriter" class="org.springframework.batch.core.test.football.internal.JdbcPlayerSummaryDao">
|
||||
<property name="dataSource" ref="dataSource" />
|
||||
</bean>
|
||||
|
||||
<bean id="playerFileItemReader" class="org.springframework.batch.item.file.FlatFileItemReader">
|
||||
<property name="resource" value="classpath:data/football/${player.file.name}" />
|
||||
<property name="lineMapper">
|
||||
<bean class="org.springframework.batch.item.file.mapping.DefaultLineMapper">
|
||||
<property name="lineTokenizer">
|
||||
<bean class="org.springframework.batch.item.file.transform.DelimitedLineTokenizer">
|
||||
<property name="names" value="ID,lastName,firstName,position,birthYear,debutYear" />
|
||||
</bean>
|
||||
</property>
|
||||
<property name="fieldSetMapper">
|
||||
<bean class="org.springframework.batch.core.test.football.internal.PlayerFieldSetMapper" />
|
||||
</property>
|
||||
</bean>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="gameFileItemReader" class="org.springframework.batch.item.file.FlatFileItemReader">
|
||||
<property name="resource" value="classpath:data/football/${games.file.name}" />
|
||||
<property name="lineMapper">
|
||||
<bean class="org.springframework.batch.item.file.mapping.DefaultLineMapper">
|
||||
<property name="lineTokenizer">
|
||||
<bean class="org.springframework.batch.item.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.core.test.football.internal.GameFieldSetMapper" />
|
||||
</property>
|
||||
</bean>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="playerSummarizationSource" class="org.springframework.batch.item.database.JdbcCursorItemReader">
|
||||
<property name="dataSource" ref="dataSource" />
|
||||
<property name="verifyCursorPosition" value="${batch.verify.cursor.position}" />
|
||||
<property name="rowMapper">
|
||||
<bean class="org.springframework.batch.core.test.football.internal.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>
|
||||
|
||||
<bean id="footballProperties" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
|
||||
<property name="properties">
|
||||
<value>
|
||||
games.file.name=games-small.csv
|
||||
player.file.name=player-small.csv
|
||||
job.commit.interval=2
|
||||
</value>
|
||||
</property>
|
||||
<property name="systemPropertiesModeName" value="SYSTEM_PROPERTIES_MODE_OVERRIDE" />
|
||||
<property name="ignoreUnresolvablePlaceholders" value="true" />
|
||||
<property name="order" value="1" />
|
||||
</bean>
|
||||
|
||||
</beans>
|
||||
@@ -0,0 +1,119 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:aop="http://www.springframework.org/schema/aop"
|
||||
xmlns:p="http://www.springframework.org/schema/p"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/aop https://www.springframework.org/schema/aop/spring-aop-3.1.xsd
|
||||
http://www.springframework.org/schema/batch https://www.springframework.org/schema/batch/spring-batch-2.2.xsd
|
||||
http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans-3.1.xsd">
|
||||
|
||||
<job id="parallelJob" xmlns="http://www.springframework.org/schema/batch">
|
||||
<step id="playerload" next="gameLoadParallel">
|
||||
<tasklet>
|
||||
<chunk reader="playerFileItemReader" writer="playerWriter"
|
||||
commit-interval="${job.commit.interval}" />
|
||||
</tasklet>
|
||||
</step>
|
||||
<step id="gameLoadParallel" next="playerSummarization">
|
||||
<tasklet task-executor="taskExecutor">
|
||||
<chunk reader="gameFileItemReader" writer="gameWriter"
|
||||
commit-interval="${job.commit.interval}" />
|
||||
</tasklet>
|
||||
</step>
|
||||
<step id="playerSummarization" parent="summarizationStep" />
|
||||
</job>
|
||||
|
||||
<step id="summarizationStep" xmlns="http://www.springframework.org/schema/batch">
|
||||
<tasklet>
|
||||
<chunk reader="playerSummarizationSource" writer="summaryWriter"
|
||||
commit-interval="${job.commit.interval}" />
|
||||
</tasklet>
|
||||
</step>
|
||||
|
||||
<bean id="taskExecutor" class="org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor">
|
||||
<property name="corePoolSize" value="10"/>
|
||||
<property name="maxPoolSize" value="20"/>
|
||||
<property name="queueCapacity" value="0"/>
|
||||
</bean>
|
||||
|
||||
<bean id="playerWriter" class="org.springframework.batch.core.test.football.internal.PlayerItemWriter">
|
||||
<property name="playerDao">
|
||||
<bean class="org.springframework.batch.core.test.football.internal.JdbcPlayerDao">
|
||||
<property name="dataSource" ref="dataSource" />
|
||||
</bean>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="gameWriter" class="org.springframework.batch.core.test.football.internal.JdbcGameDao">
|
||||
<property name="dataSource" ref="dataSource" />
|
||||
</bean>
|
||||
|
||||
<bean id="summaryWriter" class="org.springframework.batch.core.test.football.internal.JdbcPlayerSummaryDao">
|
||||
<property name="dataSource" ref="dataSource" />
|
||||
</bean>
|
||||
|
||||
<bean id="playerFileItemReader" class="org.springframework.batch.item.file.FlatFileItemReader">
|
||||
<property name="resource" value="classpath:data/football/${player.file.name}" />
|
||||
<property name="lineMapper">
|
||||
<bean class="org.springframework.batch.item.file.mapping.DefaultLineMapper">
|
||||
<property name="lineTokenizer">
|
||||
<bean class="org.springframework.batch.item.file.transform.DelimitedLineTokenizer">
|
||||
<property name="names" value="ID,lastName,firstName,position,birthYear,debutYear" />
|
||||
</bean>
|
||||
</property>
|
||||
<property name="fieldSetMapper">
|
||||
<bean class="org.springframework.batch.core.test.football.internal.PlayerFieldSetMapper" />
|
||||
</property>
|
||||
</bean>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="gameFileItemReader" class="org.springframework.batch.item.file.FlatFileItemReader">
|
||||
<property name="resource" value="classpath:data/football/${games.file.name}" />
|
||||
<property name="saveState" value="false" />
|
||||
<property name="lineMapper">
|
||||
<bean class="org.springframework.batch.item.file.mapping.DefaultLineMapper">
|
||||
<property name="lineTokenizer">
|
||||
<bean class="org.springframework.batch.item.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.core.test.football.internal.GameFieldSetMapper" />
|
||||
</property>
|
||||
</bean>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="playerSummarizationSource" class="org.springframework.batch.item.database.JdbcCursorItemReader">
|
||||
<property name="dataSource" ref="dataSource" />
|
||||
<property name="verifyCursorPosition" value="${batch.verify.cursor.position}" />
|
||||
<property name="rowMapper">
|
||||
<bean class="org.springframework.batch.core.test.football.internal.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>
|
||||
|
||||
<bean id="footballProperties" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
|
||||
<property name="properties">
|
||||
<value>
|
||||
games.file.name=games-small.csv
|
||||
player.file.name=player-small.csv
|
||||
job.commit.interval=2
|
||||
</value>
|
||||
</property>
|
||||
<property name="systemPropertiesModeName" value="SYSTEM_PROPERTIES_MODE_OVERRIDE" />
|
||||
<property name="ignoreUnresolvablePlaceholders" value="true" />
|
||||
<property name="order" value="1" />
|
||||
</bean>
|
||||
|
||||
</beans>
|
||||
@@ -0,0 +1,55 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:aop="http://www.springframework.org/schema/aop"
|
||||
xmlns:p="http://www.springframework.org/schema/p"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/aop https://www.springframework.org/schema/aop/spring-aop-3.1.xsd
|
||||
http://www.springframework.org/schema/batch https://www.springframework.org/schema/batch/spring-batch-2.2.xsd
|
||||
http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans-3.1.xsd">
|
||||
|
||||
<job id="chunkTimeoutJob" xmlns="http://www.springframework.org/schema/batch">
|
||||
<step id="chunk-step">
|
||||
<tasklet>
|
||||
<chunk reader="dummyReader" processor="sleepingProcessor" writer="loggingWriter"
|
||||
commit-interval="5" />
|
||||
<transaction-attributes timeout="1"/>
|
||||
</tasklet>
|
||||
</step>
|
||||
</job>
|
||||
|
||||
<job id="taskletTimeoutJob" xmlns="http://www.springframework.org/schema/batch">
|
||||
<step id="tasklet-step">
|
||||
<tasklet ref="sleepingTasklet">
|
||||
<transaction-attributes timeout="1"/>
|
||||
</tasklet>
|
||||
</step>
|
||||
</job>
|
||||
|
||||
<bean id="dummyReader" class="org.springframework.batch.item.support.ListItemReader">
|
||||
<constructor-arg>
|
||||
<list>
|
||||
<value>1</value>
|
||||
<value>2</value>
|
||||
<value>3</value>
|
||||
<value>4</value>
|
||||
<value>5</value>
|
||||
<value>6</value>
|
||||
<value>7</value>
|
||||
<value>8</value>
|
||||
<value>9</value>
|
||||
<value>10</value>
|
||||
</list>
|
||||
</constructor-arg>
|
||||
</bean>
|
||||
|
||||
<bean id="sleepingProcessor" class="org.springframework.batch.core.test.timeout.SleepingItemProcessor">
|
||||
<property name="millisToSleep" value="500" />
|
||||
</bean>
|
||||
|
||||
<bean id="loggingWriter" class="org.springframework.batch.core.test.timeout.LoggingItemWriter" />
|
||||
|
||||
<bean id="sleepingTasklet" class="org.springframework.batch.core.test.timeout.SleepingTasklet">
|
||||
<property name="millisToSleep" value="2000" />
|
||||
</bean>
|
||||
|
||||
</beans>
|
||||
@@ -1 +1 @@
|
||||
http\://www.springframework.org/schema/batch/test=org.springframework.batch.test.namespace.config.DummyNamespaceHandler
|
||||
http\://www.springframework.org/schema/batch/test=org.springframework.batch.core.test.namespace.config.DummyNamespaceHandler
|
||||
@@ -1 +1 @@
|
||||
http\://www.springframework.org/schema/batch/test/test.xsd=org/springframework/batch/test/namespace/config/test.xsd
|
||||
http\://www.springframework.org/schema/batch/test/test.xsd=org/springframework/batch/core/test/namespace/config/test.xsd
|
||||
@@ -0,0 +1,43 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://www.springframework.org/schema/batch https://www.springframework.org/schema/batch/spring-batch.xsd">
|
||||
|
||||
<job id="job1" xmlns="http://www.springframework.org/schema/batch">
|
||||
<step id="step1">
|
||||
<tasklet>
|
||||
<chunk reader="itemReader1" writer="itemWriter" commit-interval="2" skip-limit="1">
|
||||
<skippable-exception-classes>
|
||||
<include class="org.springframework.ldap.ldif.InvalidAttributeFormatException"/>
|
||||
</skippable-exception-classes>
|
||||
</chunk>
|
||||
</tasklet>
|
||||
</step>
|
||||
</job>
|
||||
|
||||
<job id="job2" xmlns="http://www.springframework.org/schema/batch">
|
||||
<step id="step2">
|
||||
<tasklet>
|
||||
<chunk reader="itemReader2" writer="itemWriter" commit-interval="2" />
|
||||
</tasklet>
|
||||
</step>
|
||||
</job>
|
||||
|
||||
<bean id="itemReader1" class="org.springframework.batch.item.ldif.LdifReader">
|
||||
<property name="resource" value="classpath:/test.ldif" />
|
||||
<property name="recordsToSkip" value="1" />
|
||||
</bean>
|
||||
|
||||
<bean id="itemReader2" class="org.springframework.batch.item.ldif.LdifReader">
|
||||
<property name="resource" value="file:src/test/resources/missing.ldif" />
|
||||
<property name="recordsToSkip" value="1" />
|
||||
</bean>
|
||||
|
||||
<bean id="itemWriter" class="org.springframework.batch.item.file.FlatFileItemWriter">
|
||||
<property name="resource" value="file:target/test-outputs/output.ldif" />
|
||||
<property name="lineAggregator">
|
||||
<bean class="org.springframework.batch.item.file.transform.PassThroughLineAggregator" />
|
||||
</property>
|
||||
</bean>
|
||||
</beans>
|
||||
@@ -0,0 +1,61 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://www.springframework.org/schema/batch https://www.springframework.org/schema/batch/spring-batch.xsd">
|
||||
|
||||
<job id="job1" xmlns="http://www.springframework.org/schema/batch">
|
||||
<step id="step1">
|
||||
<tasklet transaction-manager="transactionManager">
|
||||
<chunk reader="itemReader1" writer="itemWriter" commit-interval="2" skip-limit="1">
|
||||
<skippable-exception-classes>
|
||||
<include class="org.springframework.ldap.ldif.InvalidAttributeFormatException"/>
|
||||
</skippable-exception-classes>
|
||||
</chunk>
|
||||
</tasklet>
|
||||
</step>
|
||||
</job>
|
||||
|
||||
<job id="job2" xmlns="http://www.springframework.org/schema/batch">
|
||||
<step id="step2">
|
||||
<tasklet transaction-manager="transactionManager">
|
||||
<chunk reader="itemReader2" writer="itemWriter" commit-interval="2" />
|
||||
</tasklet>
|
||||
</step>
|
||||
</job>
|
||||
|
||||
<bean id="itemReader1" class="org.springframework.batch.item.ldif.MappingLdifReader">
|
||||
<property name="resource" value="file:src/test/resources/test.ldif" />
|
||||
<property name="recordsToSkip" value="1" />
|
||||
<property name="recordMapper" ref="recordMapper" />
|
||||
</bean>
|
||||
|
||||
<bean id="itemReader2" class="org.springframework.batch.item.ldif.MappingLdifReader">
|
||||
<property name="resource" value="file:src/test/resources/missing.ldif" />
|
||||
<property name="recordsToSkip" value="1" />
|
||||
<property name="recordMapper" ref="recordMapper" />
|
||||
</bean>
|
||||
|
||||
<bean id="recordMapper" class="org.springframework.batch.core.test.ldif.MyMapper" />
|
||||
|
||||
<bean id="itemWriter" class="org.springframework.batch.item.file.FlatFileItemWriter">
|
||||
<property name="resource" value="file:target/test-outputs/output.ldif" />
|
||||
<property name="lineAggregator">
|
||||
<bean class="org.springframework.batch.item.file.transform.PassThroughLineAggregator" />
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="jobLauncher" class="org.springframework.batch.core.launch.support.SimpleJobLauncher">
|
||||
<property name="jobRepository" ref="jobRepository" />
|
||||
<property name="taskExecutor" ref="taskExecutor" />
|
||||
</bean>
|
||||
|
||||
<bean id="jobRepository" class="org.springframework.batch.core.repository.support.MapJobRepositoryFactoryBean">
|
||||
<property name="transactionManager" ref="transactionManager"/>
|
||||
</bean>
|
||||
|
||||
<bean id="transactionManager" class="org.springframework.batch.support.transaction.ResourcelessTransactionManager" />
|
||||
|
||||
<bean id="taskExecutor" class="org.springframework.core.task.SyncTaskExecutor" />
|
||||
|
||||
</beans>
|
||||
17
spring-batch-core/src/test/resources/batch-derby.properties
Normal file
17
spring-batch-core/src/test/resources/batch-derby.properties
Normal file
@@ -0,0 +1,17 @@
|
||||
# Placeholders batch.*
|
||||
# for Derby:
|
||||
batch.jdbc.driver=org.apache.derby.jdbc.EmbeddedDriver
|
||||
batch.jdbc.url=jdbc:derby:build/derby-home/test;create=true
|
||||
batch.jdbc.user=sa
|
||||
batch.jdbc.password=
|
||||
batch.jdbc.testWhileIdle=false
|
||||
batch.jdbc.validationQuery=
|
||||
batch.drop.script=classpath:/org/springframework/batch/core/schema-drop-derby.sql
|
||||
batch.schema.script=classpath:/org/springframework/batch/core/schema-derby.sql
|
||||
batch.business.schema.script=business-schema-derby.sql
|
||||
batch.data.source.init=true
|
||||
batch.database.incrementer.class=org.springframework.jdbc.support.incrementer.DerbyMaxValueIncrementer
|
||||
batch.database.incrementer.parent=columnIncrementerParent
|
||||
batch.grid.size=2
|
||||
batch.verify.cursor.position=false
|
||||
batch.jdbc.validationQuery=values 1
|
||||
21
spring-batch-core/src/test/resources/batch-hsql.properties
Normal file
21
spring-batch-core/src/test/resources/batch-hsql.properties
Normal file
@@ -0,0 +1,21 @@
|
||||
# Placeholders batch.*
|
||||
# for HSQLDB:
|
||||
batch.jdbc.driver=org.hsqldb.jdbcDriver
|
||||
batch.jdbc.url=jdbc:hsqldb:mem:testdb;sql.enforce_strict_size=true;hsqldb.tx=mvcc
|
||||
# use this one for a separate server process so you can inspect the results
|
||||
# (or add it to system properties with -D to override at run time).
|
||||
# batch.jdbc.url=jdbc:hsqldb:hsql://localhost:9005/samples
|
||||
batch.jdbc.user=sa
|
||||
batch.jdbc.password=
|
||||
batch.jdbc.testWhileIdle=false
|
||||
batch.jdbc.validationQuery=
|
||||
batch.drop.script=classpath:/org/springframework/batch/core/schema-drop-hsqldb.sql
|
||||
batch.schema.script=classpath:/org/springframework/batch/core/schema-hsqldb.sql
|
||||
batch.business.schema.script=classpath:/business-schema-hsqldb.sql
|
||||
batch.data.source.init=true
|
||||
batch.database.incrementer.class=org.springframework.jdbc.support.incrementer.HsqlMaxValueIncrementer
|
||||
batch.database.incrementer.parent=columnIncrementerParent
|
||||
batch.grid.size=2
|
||||
batch.verify.cursor.position=true
|
||||
batch.jdbc.validationQuery=SELECT 1 FROM INFORMATION_SCHEMA.SYSTEM_USERS
|
||||
batch.table.prefix=BATCH_
|
||||
14
spring-batch-core/src/test/resources/batch-mysql.properties
Normal file
14
spring-batch-core/src/test/resources/batch-mysql.properties
Normal file
@@ -0,0 +1,14 @@
|
||||
# Placeholders batch.*
|
||||
# for MySQL:
|
||||
batch.jdbc.driver=com.mysql.jdbc.Driver
|
||||
batch.jdbc.url=jdbc:mysql://localhost/test
|
||||
batch.jdbc.user=root
|
||||
batch.jdbc.password=root
|
||||
batch.schema.script=classpath:/org/springframework/batch/core/schema-mysql.sql
|
||||
batch.business.schema.script=classpath:/business-schema-mysql.sql
|
||||
batch.data.source.init=false
|
||||
batch.database.incrementer.class=org.springframework.jdbc.support.incrementer.MySQLMaxValueIncrementer
|
||||
batch.database.incrementer.parent=columnIncrementerParent
|
||||
batch.lob.handler.class=org.springframework.jdbc.support.lob.DefaultLobHandler
|
||||
batch.verify.cursor.position=true
|
||||
batch.jdbc.validationQuery=SELECT 1
|
||||
@@ -0,0 +1,17 @@
|
||||
# Placeholders batch.*
|
||||
# for Postgres:
|
||||
batch.jdbc.driver=org.postgresql.Driver
|
||||
batch.jdbc.url=jdbc:postgresql://localhost/test
|
||||
batch.jdbc.user=test
|
||||
batch.jdbc.password=test
|
||||
batch.jdbc.testWhileIdle=false
|
||||
batch.jdbc.validationQuery=
|
||||
batch.schema.script=classpath:/org/springframework/batch/core/schema-postgresql.sql
|
||||
batch.drop.script=classpath:/org/springframework/batch/core/schema-drop-postgresql.sql
|
||||
batch.business.schema.script=classpath:/business-schema-postgresql.sql
|
||||
batch.data.source.init=true
|
||||
batch.database.incrementer.class=org.springframework.jdbc.support.incrementer.PostgresSequenceMaxValueIncrementer
|
||||
batch.database.incrementer.parent=sequenceIncrementerParent
|
||||
batch.grid.size=2
|
||||
batch.verify.cursor.position=true
|
||||
batch.jdbc.validationQuery=SELECT 1
|
||||
@@ -0,0 +1,96 @@
|
||||
-- Autogenerated: do not edit this file
|
||||
DROP TABLE BATCH_STAGING_SEQ ;
|
||||
DROP TABLE TRADE_SEQ ;
|
||||
DROP TABLE CUSTOMER_SEQ ;
|
||||
DROP TABLE BATCH_STAGING ;
|
||||
DROP TABLE TRADE ;
|
||||
DROP TABLE CUSTOMER ;
|
||||
DROP TABLE PLAYERS ;
|
||||
DROP TABLE GAMES ;
|
||||
DROP TABLE PLAYER_SUMMARY ;
|
||||
DROP TABLE ERROR_LOG ;
|
||||
|
||||
-- Autogenerated: do not edit this file
|
||||
|
||||
CREATE TABLE CUSTOMER_SEQ (ID BIGINT PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY, DUMMY VARCHAR(1));
|
||||
INSERT INTO CUSTOMER_SEQ (ID) values (5);
|
||||
CREATE TABLE BATCH_STAGING_SEQ (ID BIGINT PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY, DUMMY VARCHAR(1));
|
||||
INSERT INTO BATCH_STAGING_SEQ (ID) values (0);
|
||||
CREATE TABLE TRADE_SEQ (ID BIGINT PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY, DUMMY VARCHAR(1));
|
||||
INSERT INTO TRADE_SEQ (ID) values (0);
|
||||
|
||||
CREATE TABLE BATCH_STAGING (
|
||||
ID BIGINT NOT NULL PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY,
|
||||
JOB_ID BIGINT NOT NULL,
|
||||
VALUE BLOB NOT NULL,
|
||||
PROCESSED CHAR(1) NOT NULL
|
||||
) ;
|
||||
|
||||
CREATE TABLE TRADE (
|
||||
ID BIGINT NOT NULL PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY,
|
||||
VERSION BIGINT ,
|
||||
ISIN VARCHAR(45) NOT NULL,
|
||||
QUANTITY BIGINT ,
|
||||
PRICE DECIMAL(8,2) ,
|
||||
CUSTOMER VARCHAR(45)
|
||||
) ;
|
||||
|
||||
CREATE TABLE CUSTOMER (
|
||||
ID BIGINT NOT NULL PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY,
|
||||
VERSION BIGINT ,
|
||||
NAME VARCHAR(45) ,
|
||||
CREDIT DECIMAL(10,2)
|
||||
) ;
|
||||
|
||||
INSERT INTO CUSTOMER (ID, VERSION, NAME, CREDIT) VALUES (1, 0, 'customer1', 100000);
|
||||
INSERT INTO CUSTOMER (ID, VERSION, NAME, CREDIT) VALUES (2, 0, 'customer2', 100000);
|
||||
INSERT INTO CUSTOMER (ID, VERSION, NAME, CREDIT) VALUES (3, 0, 'customer3', 100000);
|
||||
INSERT INTO CUSTOMER (ID, VERSION, NAME, CREDIT) VALUES (4, 0, 'customer4', 100000);
|
||||
|
||||
CREATE TABLE PLAYERS (
|
||||
PLAYER_ID CHAR(8) NOT NULL PRIMARY KEY,
|
||||
LAST_NAME VARCHAR(35) NOT NULL,
|
||||
FIRST_NAME VARCHAR(25) NOT NULL,
|
||||
POS VARCHAR(10) ,
|
||||
YEAR_OF_BIRTH BIGINT NOT NULL,
|
||||
YEAR_DRAFTED BIGINT NOT NULL
|
||||
) ;
|
||||
|
||||
CREATE TABLE GAMES (
|
||||
PLAYER_ID CHAR(8) NOT NULL,
|
||||
YEAR_NO BIGINT NOT NULL,
|
||||
TEAM CHAR(3) NOT NULL,
|
||||
WEEK BIGINT NOT NULL,
|
||||
OPPONENT CHAR(3) ,
|
||||
COMPLETES BIGINT ,
|
||||
ATTEMPTS BIGINT ,
|
||||
PASSING_YARDS BIGINT ,
|
||||
PASSING_TD BIGINT ,
|
||||
INTERCEPTIONS BIGINT ,
|
||||
RUSHES BIGINT ,
|
||||
RUSH_YARDS BIGINT ,
|
||||
RECEPTIONS BIGINT ,
|
||||
RECEPTIONS_YARDS BIGINT ,
|
||||
TOTAL_TD BIGINT
|
||||
) ;
|
||||
|
||||
CREATE TABLE PLAYER_SUMMARY (
|
||||
ID CHAR(8) NOT NULL,
|
||||
YEAR_NO BIGINT NOT NULL,
|
||||
COMPLETES BIGINT NOT NULL ,
|
||||
ATTEMPTS BIGINT NOT NULL ,
|
||||
PASSING_YARDS BIGINT NOT NULL ,
|
||||
PASSING_TD BIGINT NOT NULL ,
|
||||
INTERCEPTIONS BIGINT NOT NULL ,
|
||||
RUSHES BIGINT NOT NULL ,
|
||||
RUSH_YARDS BIGINT NOT NULL ,
|
||||
RECEPTIONS BIGINT NOT NULL ,
|
||||
RECEPTIONS_YARDS BIGINT NOT NULL ,
|
||||
TOTAL_TD BIGINT NOT NULL
|
||||
) ;
|
||||
|
||||
CREATE TABLE ERROR_LOG (
|
||||
JOB_NAME CHAR(20) ,
|
||||
STEP_NAME CHAR(20) ,
|
||||
MESSAGE VARCHAR(300) NOT NULL
|
||||
) ;
|
||||
@@ -0,0 +1,53 @@
|
||||
-- Autogenerated: do not edit this file
|
||||
DROP TABLE PLAYERS IF EXISTS;
|
||||
DROP TABLE GAMES IF EXISTS;
|
||||
DROP TABLE PLAYER_SUMMARY IF EXISTS;
|
||||
DROP TABLE ERROR_LOG IF EXISTS;
|
||||
|
||||
CREATE TABLE PLAYERS (
|
||||
PLAYER_ID CHAR(8) NOT NULL PRIMARY KEY,
|
||||
LAST_NAME VARCHAR(35) NOT NULL,
|
||||
FIRST_NAME VARCHAR(25) NOT NULL,
|
||||
POS VARCHAR(10) ,
|
||||
YEAR_OF_BIRTH BIGINT NOT NULL,
|
||||
YEAR_DRAFTED BIGINT NOT NULL
|
||||
) ;
|
||||
|
||||
CREATE TABLE GAMES (
|
||||
PLAYER_ID CHAR(8) NOT NULL,
|
||||
YEAR_NO BIGINT NOT NULL,
|
||||
TEAM CHAR(3) NOT NULL,
|
||||
WEEK BIGINT NOT NULL,
|
||||
OPPONENT CHAR(3) ,
|
||||
COMPLETES BIGINT ,
|
||||
ATTEMPTS BIGINT ,
|
||||
PASSING_YARDS BIGINT ,
|
||||
PASSING_TD BIGINT ,
|
||||
INTERCEPTIONS BIGINT ,
|
||||
RUSHES BIGINT ,
|
||||
RUSH_YARDS BIGINT ,
|
||||
RECEPTIONS BIGINT ,
|
||||
RECEPTIONS_YARDS BIGINT ,
|
||||
TOTAL_TD BIGINT
|
||||
) ;
|
||||
|
||||
CREATE TABLE PLAYER_SUMMARY (
|
||||
ID CHAR(8) NOT NULL,
|
||||
YEAR_NO BIGINT NOT NULL,
|
||||
COMPLETES BIGINT NOT NULL ,
|
||||
ATTEMPTS BIGINT NOT NULL ,
|
||||
PASSING_YARDS BIGINT NOT NULL ,
|
||||
PASSING_TD BIGINT NOT NULL ,
|
||||
INTERCEPTIONS BIGINT NOT NULL ,
|
||||
RUSHES BIGINT NOT NULL ,
|
||||
RUSH_YARDS BIGINT NOT NULL ,
|
||||
RECEPTIONS BIGINT NOT NULL ,
|
||||
RECEPTIONS_YARDS BIGINT NOT NULL ,
|
||||
TOTAL_TD BIGINT NOT NULL
|
||||
) ;
|
||||
|
||||
CREATE TABLE ERROR_LOG (
|
||||
JOB_NAME CHAR(20) ,
|
||||
STEP_NAME CHAR(20) ,
|
||||
MESSAGE VARCHAR(300) NOT NULL
|
||||
) ;
|
||||
@@ -0,0 +1,96 @@
|
||||
-- Autogenerated: do not edit this file
|
||||
DROP TABLE IF EXISTS BATCH_STAGING_SEQ ;
|
||||
DROP TABLE IF EXISTS TRADE_SEQ ;
|
||||
DROP TABLE IF EXISTS CUSTOMER_SEQ ;
|
||||
DROP TABLE IF EXISTS BATCH_STAGING ;
|
||||
DROP TABLE IF EXISTS TRADE ;
|
||||
DROP TABLE IF EXISTS CUSTOMER ;
|
||||
DROP TABLE IF EXISTS PLAYERS ;
|
||||
DROP TABLE IF EXISTS GAMES ;
|
||||
DROP TABLE IF EXISTS PLAYER_SUMMARY ;
|
||||
DROP TABLE IF EXISTS ERROR_LOG ;
|
||||
|
||||
-- Autogenerated: do not edit this file
|
||||
|
||||
CREATE TABLE CUSTOMER_SEQ (ID BIGINT NOT NULL) type=MYISAM;
|
||||
INSERT INTO CUSTOMER_SEQ values(5);
|
||||
CREATE TABLE BATCH_STAGING_SEQ (ID BIGINT NOT NULL) type=MYISAM;
|
||||
INSERT INTO BATCH_STAGING_SEQ values(0);
|
||||
CREATE TABLE TRADE_SEQ (ID BIGINT NOT NULL) type=MYISAM;
|
||||
INSERT INTO TRADE_SEQ values(0);
|
||||
|
||||
CREATE TABLE BATCH_STAGING (
|
||||
ID BIGINT NOT NULL PRIMARY KEY ,
|
||||
JOB_ID BIGINT NOT NULL,
|
||||
VALUE BLOB NOT NULL,
|
||||
PROCESSED CHAR(1) NOT NULL
|
||||
) type=InnoDB;
|
||||
|
||||
CREATE TABLE TRADE (
|
||||
ID BIGINT NOT NULL PRIMARY KEY ,
|
||||
VERSION BIGINT ,
|
||||
ISIN VARCHAR(45) NOT NULL,
|
||||
QUANTITY BIGINT ,
|
||||
PRICE DECIMAL(8,2) ,
|
||||
CUSTOMER VARCHAR(45)
|
||||
) type=InnoDB;
|
||||
|
||||
CREATE TABLE CUSTOMER (
|
||||
ID BIGINT NOT NULL PRIMARY KEY ,
|
||||
VERSION BIGINT ,
|
||||
NAME VARCHAR(45) ,
|
||||
CREDIT DECIMAL(10,2)
|
||||
) type=InnoDB;
|
||||
|
||||
INSERT INTO CUSTOMER (ID, VERSION, NAME, CREDIT) VALUES (1, 0, 'customer1', 100000);
|
||||
INSERT INTO CUSTOMER (ID, VERSION, NAME, CREDIT) VALUES (2, 0, 'customer2', 100000);
|
||||
INSERT INTO CUSTOMER (ID, VERSION, NAME, CREDIT) VALUES (3, 0, 'customer3', 100000);
|
||||
INSERT INTO CUSTOMER (ID, VERSION, NAME, CREDIT) VALUES (4, 0, 'customer4', 100000);
|
||||
|
||||
CREATE TABLE PLAYERS (
|
||||
PLAYER_ID CHAR(8) NOT NULL PRIMARY KEY,
|
||||
LAST_NAME VARCHAR(35) NOT NULL,
|
||||
FIRST_NAME VARCHAR(25) NOT NULL,
|
||||
POS VARCHAR(10) ,
|
||||
YEAR_OF_BIRTH BIGINT NOT NULL,
|
||||
YEAR_DRAFTED BIGINT NOT NULL
|
||||
) type=InnoDB;
|
||||
|
||||
CREATE TABLE GAMES (
|
||||
PLAYER_ID CHAR(8) NOT NULL,
|
||||
YEAR_NO BIGINT NOT NULL,
|
||||
TEAM CHAR(3) NOT NULL,
|
||||
WEEK BIGINT NOT NULL,
|
||||
OPPONENT CHAR(3) ,
|
||||
COMPLETES BIGINT ,
|
||||
ATTEMPTS BIGINT ,
|
||||
PASSING_YARDS BIGINT ,
|
||||
PASSING_TD BIGINT ,
|
||||
INTERCEPTIONS BIGINT ,
|
||||
RUSHES BIGINT ,
|
||||
RUSH_YARDS BIGINT ,
|
||||
RECEPTIONS BIGINT ,
|
||||
RECEPTIONS_YARDS BIGINT ,
|
||||
TOTAL_TD BIGINT
|
||||
) type=InnoDB;
|
||||
|
||||
CREATE TABLE PLAYER_SUMMARY (
|
||||
ID CHAR(8) NOT NULL,
|
||||
YEAR_NO BIGINT NOT NULL,
|
||||
COMPLETES BIGINT NOT NULL ,
|
||||
ATTEMPTS BIGINT NOT NULL ,
|
||||
PASSING_YARDS BIGINT NOT NULL ,
|
||||
PASSING_TD BIGINT NOT NULL ,
|
||||
INTERCEPTIONS BIGINT NOT NULL ,
|
||||
RUSHES BIGINT NOT NULL ,
|
||||
RUSH_YARDS BIGINT NOT NULL ,
|
||||
RECEPTIONS BIGINT NOT NULL ,
|
||||
RECEPTIONS_YARDS BIGINT NOT NULL ,
|
||||
TOTAL_TD BIGINT NOT NULL
|
||||
) type=InnoDB;
|
||||
|
||||
CREATE TABLE ERROR_LOG (
|
||||
JOB_NAME CHAR(20) ,
|
||||
STEP_NAME CHAR(20) ,
|
||||
MESSAGE VARCHAR(300) NOT NULL
|
||||
) type=InnoDB;
|
||||
@@ -0,0 +1,94 @@
|
||||
-- Autogenerated: do not edit this file
|
||||
DROP SEQUENCE BATCH_STAGING_SEQ ;
|
||||
DROP SEQUENCE TRADE_SEQ ;
|
||||
DROP SEQUENCE CUSTOMER_SEQ ;
|
||||
DROP TABLE BATCH_STAGING ;
|
||||
DROP TABLE TRADE ;
|
||||
DROP TABLE CUSTOMER ;
|
||||
DROP TABLE PLAYERS ;
|
||||
DROP TABLE GAMES ;
|
||||
DROP TABLE PLAYER_SUMMARY ;
|
||||
DROP TABLE ERROR_LOG ;
|
||||
|
||||
-- Autogenerated: do not edit this file
|
||||
|
||||
CREATE SEQUENCE CUSTOMER_SEQ;
|
||||
CREATE SEQUENCE BATCH_STAGING_SEQ;
|
||||
CREATE SEQUENCE TRADE_SEQ;
|
||||
|
||||
CREATE TABLE BATCH_STAGING (
|
||||
ID BIGINT NOT NULL PRIMARY KEY ,
|
||||
JOB_ID BIGINT NOT NULL,
|
||||
VALUE BYTEA NOT NULL,
|
||||
PROCESSED CHAR(1) NOT NULL
|
||||
) ;
|
||||
|
||||
CREATE TABLE TRADE (
|
||||
ID BIGINT NOT NULL PRIMARY KEY ,
|
||||
VERSION BIGINT ,
|
||||
ISIN VARCHAR(45) NOT NULL,
|
||||
QUANTITY BIGINT ,
|
||||
PRICE DECIMAL(8,2) ,
|
||||
CUSTOMER VARCHAR(45)
|
||||
) ;
|
||||
|
||||
CREATE TABLE CUSTOMER (
|
||||
ID BIGINT NOT NULL PRIMARY KEY ,
|
||||
VERSION BIGINT ,
|
||||
NAME VARCHAR(45) ,
|
||||
CREDIT DECIMAL(10,2)
|
||||
) ;
|
||||
|
||||
INSERT INTO CUSTOMER (ID, VERSION, NAME, CREDIT) VALUES (1, 0, 'customer1', 100000);
|
||||
INSERT INTO CUSTOMER (ID, VERSION, NAME, CREDIT) VALUES (2, 0, 'customer2', 100000);
|
||||
INSERT INTO CUSTOMER (ID, VERSION, NAME, CREDIT) VALUES (3, 0, 'customer3', 100000);
|
||||
INSERT INTO CUSTOMER (ID, VERSION, NAME, CREDIT) VALUES (4, 0, 'customer4', 100000);
|
||||
|
||||
CREATE TABLE PLAYERS (
|
||||
PLAYER_ID CHAR(8) NOT NULL PRIMARY KEY,
|
||||
LAST_NAME VARCHAR(35) NOT NULL,
|
||||
FIRST_NAME VARCHAR(25) NOT NULL,
|
||||
POS VARCHAR(10) ,
|
||||
YEAR_OF_BIRTH BIGINT NOT NULL,
|
||||
YEAR_DRAFTED BIGINT NOT NULL
|
||||
) ;
|
||||
|
||||
CREATE TABLE GAMES (
|
||||
PLAYER_ID CHAR(8) NOT NULL,
|
||||
YEAR_NO BIGINT NOT NULL,
|
||||
TEAM CHAR(3) NOT NULL,
|
||||
WEEK BIGINT NOT NULL,
|
||||
OPPONENT CHAR(3) ,
|
||||
COMPLETES BIGINT ,
|
||||
ATTEMPTS BIGINT ,
|
||||
PASSING_YARDS BIGINT ,
|
||||
PASSING_TD BIGINT ,
|
||||
INTERCEPTIONS BIGINT ,
|
||||
RUSHES BIGINT ,
|
||||
RUSH_YARDS BIGINT ,
|
||||
RECEPTIONS BIGINT ,
|
||||
RECEPTIONS_YARDS BIGINT ,
|
||||
TOTAL_TD BIGINT
|
||||
) ;
|
||||
|
||||
CREATE TABLE PLAYER_SUMMARY (
|
||||
ID CHAR(8) NOT NULL,
|
||||
YEAR_NO BIGINT NOT NULL,
|
||||
COMPLETES BIGINT NOT NULL ,
|
||||
ATTEMPTS BIGINT NOT NULL ,
|
||||
PASSING_YARDS BIGINT NOT NULL ,
|
||||
PASSING_TD BIGINT NOT NULL ,
|
||||
INTERCEPTIONS BIGINT NOT NULL ,
|
||||
RUSHES BIGINT NOT NULL ,
|
||||
RUSH_YARDS BIGINT NOT NULL ,
|
||||
RECEPTIONS BIGINT NOT NULL ,
|
||||
RECEPTIONS_YARDS BIGINT NOT NULL ,
|
||||
TOTAL_TD BIGINT NOT NULL
|
||||
) ;
|
||||
|
||||
CREATE TABLE ERROR_LOG (
|
||||
JOB_NAME CHAR(20) ,
|
||||
STEP_NAME CHAR(20) ,
|
||||
MESSAGE VARCHAR(300) NOT NULL
|
||||
);
|
||||
|
||||
58
spring-batch-core/src/test/resources/data-source-context.xml
Normal file
58
spring-batch-core/src/test/resources/data-source-context.xml
Normal file
@@ -0,0 +1,58 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:util="http://www.springframework.org/schema/util"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans-3.1.xsd
|
||||
http://www.springframework.org/schema/util https://www.springframework.org/schema/util/spring-util-3.1.xsd">
|
||||
|
||||
<!-- Initialise the database before every test case: -->
|
||||
<bean id="dataSourceInitializer" class="test.jdbc.datasource.DataSourceInitializer">
|
||||
<property name="dataSource" ref="dataSource"/>
|
||||
<property name="initScripts">
|
||||
<list>
|
||||
<value>${batch.drop.script}</value>
|
||||
<value>${batch.schema.script}</value>
|
||||
<value>${batch.business.schema.script}</value>
|
||||
</list>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="dataSource" class="org.apache.commons.dbcp2.BasicDataSource" destroy-method="close">
|
||||
<property name="driverClassName" value="${batch.jdbc.driver}" />
|
||||
<property name="url" value="${batch.jdbc.url}" />
|
||||
<property name="username" value="${batch.jdbc.user}" />
|
||||
<property name="password" value="${batch.jdbc.password}" />
|
||||
<property name="validationQuery" value="${batch.jdbc.validationQuery}"/>
|
||||
</bean>
|
||||
|
||||
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager" lazy-init="true">
|
||||
<property name="dataSource" ref="dataSource" />
|
||||
</bean>
|
||||
|
||||
<!-- Set up or detect a System property called "ENVIRONMENT" used to construct a properties file on the classpath. The default is "hsql". -->
|
||||
<bean id="environment"
|
||||
class="org.springframework.batch.support.SystemPropertyInitializer">
|
||||
<property name="defaultValue" value="hsql"/>
|
||||
<property name="keyName" value="ENVIRONMENT"/>
|
||||
</bean>
|
||||
|
||||
<bean id="placeholderProperties" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"
|
||||
depends-on="environment">
|
||||
<property name="location" value="classpath:batch-${ENVIRONMENT}.properties" />
|
||||
<property name="systemPropertiesModeName" value="SYSTEM_PROPERTIES_MODE_OVERRIDE" />
|
||||
<property name="ignoreUnresolvablePlaceholders" value="true" />
|
||||
<property name="order" value="1" />
|
||||
</bean>
|
||||
|
||||
<bean id="sequenceIncrementerParent" class="${batch.database.incrementer.class}" abstract="true">
|
||||
<property name="dataSource" ref="dataSource" />
|
||||
</bean>
|
||||
|
||||
<bean id="columnIncrementerParent" class="${batch.database.incrementer.class}" abstract="true" parent="sequenceIncrementerParent">
|
||||
<property name="columnName" value="ID" />
|
||||
</bean>
|
||||
|
||||
<bean id="incrementerParent" parent="${batch.database.incrementer.parent}">
|
||||
<property name="incrementerName" value="DUMMY" />
|
||||
</bean>
|
||||
|
||||
</beans>
|
||||
@@ -0,0 +1,5 @@
|
||||
AbduKa00,1996,mia,10,nwe,0,0,0,0,0,29,104,,16,2
|
||||
AbduKa00,1996,mia,11,clt,0,0,0,0,0,18,70,,11,2
|
||||
AbduKa00,1996,mia,12,oti,0,0,0,0,0,18,59,,0,0
|
||||
AbduKa00,1996,mia,13,pit,0,0,0,0,0,16,57,,0,0
|
||||
AbduKa00,1996,mia,14,rai,0,0,0,0,0,18,39,,7,0
|
||||
|
56377
spring-batch-core/src/test/resources/data/football/games.csv
Normal file
56377
spring-batch-core/src/test/resources/data/football/games.csv
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,20 @@
|
||||
AbduKa00,Abdul-Jabbar,Karim,rb,1974,1996
|
||||
AbduRa00,Abdullah,Rabih,rb,1975,1999
|
||||
AberWa00,Abercrombie,Walter,rb,1959,1982
|
||||
AbraDa00,Abramowicz,Danny,wr,1945,1967
|
||||
AdamBo00,Adams,Bob,te,1946,1969
|
||||
AdamCh00,Adams,Charlie,wr,1979,2003
|
||||
AdamCu00,Adams,Curtis,rb,1962,1985
|
||||
AdamGe00,Adams,George,rb,1962,1985
|
||||
AdamGr00,Adams,Grant,wr,2000,2005
|
||||
AdamJo00,Adams,John,rb,1937,1959
|
||||
AdamMi00,Adams,Michael,wr,1974,1997
|
||||
AdamMi01,Adamle,Mike,rb,1949,1971
|
||||
AdamTo00,Adams,Tony,qb,1950,1975
|
||||
AdamTo01,Adams,Tom,wr,1940,1962
|
||||
AdamTo02,Adamle,Tony,rb,1924,1950
|
||||
AdamWi00,Adams,Willie,wr,1956,1979
|
||||
AddaJo00,Addai,Joseph,rb,1983,2006
|
||||
AdkiJa00,Adkisson,James,te,1980,2005
|
||||
AdkiMa00,Adkins,Margene,wr,1947,1970
|
||||
AdkiSa00,Adkins,Sam,qb,1955,1977
|
||||
|
4320
spring-batch-core/src/test/resources/data/football/player.csv
Normal file
4320
spring-batch-core/src/test/resources/data/football/player.csv
Normal file
File diff suppressed because it is too large
Load Diff
75
spring-batch-core/src/test/resources/expectedOutput.ldif
Normal file
75
spring-batch-core/src/test/resources/expectedOutput.ldif
Normal file
@@ -0,0 +1,75 @@
|
||||
dn: cn=Bjorn Jensen,ou=Accounting,dc=airius,dc=com
|
||||
telephonenumber: +1 408 555 1212
|
||||
objectclass: top
|
||||
objectclass: person
|
||||
objectclass: organizationalPerson
|
||||
sn: Jensen
|
||||
cn: Bjorn Jensen
|
||||
|
||||
dn: cn=Barbara Jensen,ou=Product Development,dc=airius,dc=com
|
||||
telephonenumber: +1 408 555 1212
|
||||
uid: bjensen
|
||||
description: Babs is a big sailing fan, and travels extensively in search of perfect sailing conditions.
|
||||
objectclass: top
|
||||
objectclass: person
|
||||
objectclass: organizationalPerson
|
||||
title: Product Manager, Rod and Reel Division
|
||||
sn: Jensen
|
||||
cn: Barbara Jensen
|
||||
cn: Barbara J Jensen
|
||||
cn: Babs Jensen
|
||||
|
||||
dn: cn=Gern Jensen,ou=Product Testing,dc=airius,dc=com
|
||||
telephonenumber: +1 408 555 1212
|
||||
uid: gernj
|
||||
description:: V2hhdCBhIGNhcmVmdWwgcmVhZGVyIHlvdSBhcmUhICBUaGlzIHZhbHVlIGlzIGJhc2UtNjQtZW5j
|
||||
b2RlZCBiZWNhdXNlIGl0IGhhcyBhIGNvbnRyb2wgY2hhcmFjdGVyIGluIGl0IChhIENSKS4NICBC
|
||||
eSB0aGUgd2F5LCB5b3Ugc2hvdWxkIHJlYWxseSBnZXQgb3V0IG1vcmUu
|
||||
objectclass: top
|
||||
objectclass: person
|
||||
objectclass: organizationalPerson
|
||||
sn: Jensen
|
||||
cn: Gern Jensen
|
||||
cn: Gern O Jensen
|
||||
|
||||
dn:: b3U95Za25qWt6YOoLG89QWlyaXVz
|
||||
ou:: 5Za25qWt6YOo
|
||||
ou:: 44GI44GE44GO44KH44GG44G2
|
||||
ou: Sales
|
||||
description: Japanese office
|
||||
objectclass: top
|
||||
objectclass: organizationalUnit
|
||||
|
||||
dn:: dWlkPXJvZ2FzYXdhcmEsb3U95Za25qWt6YOoLG89QWlyaXVz
|
||||
givenname:: 44Ot44OJ44OL44O8
|
||||
givenname:: 44KN44Gp44Gr44O8
|
||||
givenname: Rodney
|
||||
sn:: 5bCP56yg5Y6f
|
||||
sn:: 44GK44GM44GV44KP44KJ
|
||||
sn: Ogasawara
|
||||
userpassword: {SHA}O3HSv1MusyL4kTjP+HKI5uxuNoM=
|
||||
mail: rogasawara@airius.co.jp
|
||||
objectclass: top
|
||||
objectclass: person
|
||||
objectclass: organizationalPerson
|
||||
objectclass: inetOrgPerson
|
||||
uid: rogasawara
|
||||
preferredlanguage: ja
|
||||
cn:: 5bCP56yg5Y6fIOODreODieODi+ODvA==
|
||||
cn:: 44GK44GM44GV44KP44KJIOOCjeOBqeOBq+ODvA==
|
||||
cn: Rodney Ogasawara
|
||||
title:: 5Za25qWt6YOoIOmDqOmVtw==
|
||||
title:: 44GI44GE44GO44KH44GG44G2IOOBtuOBoeOCh+OBhg==
|
||||
title: Sales, Director
|
||||
|
||||
dn: cn=Horatio Jensen,ou=Product Testing,dc=airius,dc=com
|
||||
telephonenumber: +1 408 555 1212
|
||||
uid: hjensen
|
||||
jpegphoto:< file:///usr/local/directory/photos/hjensen.jpg
|
||||
objectclass: top
|
||||
objectclass: person
|
||||
objectclass: organizationalPerson
|
||||
sn: Jensen
|
||||
cn: Horatio Jensen
|
||||
cn: Horatio N Jensen
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:beans="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://www.springframework.org/schema/batch https://www.springframework.org/schema/batch/spring-batch.xsd">
|
||||
|
||||
<job id="job" xmlns="http://www.springframework.org/schema/batch">
|
||||
<split id="split" task-executor="taskExecutor">
|
||||
<flow>
|
||||
<step id="step1" parent="step" />
|
||||
</flow>
|
||||
<flow>
|
||||
<step id="step2" parent="step" />
|
||||
</flow>
|
||||
</split>
|
||||
</job>
|
||||
|
||||
<bean id="taskExecutor" class="org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor">
|
||||
<property name="maxPoolSize" value="6"/>
|
||||
<property name="queueCapacity" value="0"/>
|
||||
</bean>
|
||||
|
||||
<step id="step" xmlns="http://www.springframework.org/schema/batch">
|
||||
<tasklet>
|
||||
<beans:bean class="org.springframework.batch.core.test.step.SplitJobMapRepositoryIntegrationTests$CountingTasklet" />
|
||||
</tasklet>
|
||||
</step>
|
||||
|
||||
<bean id="jobLauncher" class="org.springframework.batch.core.launch.support.SimpleJobLauncher">
|
||||
<property name="jobRepository" ref="jobRepository" />
|
||||
</bean>
|
||||
|
||||
<bean id="jobRepository" class="org.springframework.batch.core.repository.support.MapJobRepositoryFactoryBean">
|
||||
<property name="transactionManager" ref="transactionManager" />
|
||||
</bean>
|
||||
|
||||
<bean id="transactionManager" class="org.springframework.batch.support.transaction.ResourcelessTransactionManager" />
|
||||
|
||||
</beans>
|
||||
@@ -0,0 +1,42 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
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 https://www.springframework.org/schema/beans/spring-beans-3.1.xsd">
|
||||
|
||||
<import resource="data-source-context.xml" />
|
||||
|
||||
<bean id="jobLauncher"
|
||||
class="org.springframework.batch.core.launch.support.SimpleJobLauncher">
|
||||
<property name="jobRepository" ref="jobRepository" />
|
||||
</bean>
|
||||
|
||||
<bean class="org.springframework.batch.core.configuration.support.JobRegistryBeanPostProcessor">
|
||||
<property name="jobRegistry" ref="jobRegistry"/>
|
||||
</bean>
|
||||
|
||||
<bean id="jobRepository"
|
||||
class="org.springframework.batch.core.repository.support.JobRepositoryFactoryBean"
|
||||
p:dataSource-ref="dataSource" p:transactionManager-ref="transactionManager" />
|
||||
|
||||
<bean id="mapJobRepository"
|
||||
class="org.springframework.batch.core.repository.support.MapJobRepositoryFactoryBean"
|
||||
lazy-init="true" autowire-candidate="false" />
|
||||
|
||||
<bean id="jobOperator"
|
||||
class="org.springframework.batch.core.launch.support.SimpleJobOperator"
|
||||
p:jobLauncher-ref="jobLauncher" p:jobExplorer-ref="jobExplorer"
|
||||
p:jobRepository-ref="jobRepository" p:jobRegistry-ref="jobRegistry" />
|
||||
|
||||
<bean id="jobExplorer"
|
||||
class="org.springframework.batch.core.explore.support.JobExplorerFactoryBean"
|
||||
p:dataSource-ref="dataSource" />
|
||||
|
||||
<bean id="jobRegistry"
|
||||
class="org.springframework.batch.core.configuration.support.MapJobRegistry" />
|
||||
|
||||
<bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
|
||||
<property name="dataSource" ref="dataSource" />
|
||||
</bean>
|
||||
|
||||
</beans>
|
||||
235
spring-batch-core/src/test/resources/test.ldif
Normal file
235
spring-batch-core/src/test/resources/test.ldif
Normal file
@@ -0,0 +1,235 @@
|
||||
version: 1
|
||||
|
||||
#
|
||||
#Examples of LDAP Data Interchange Format
|
||||
#
|
||||
|
||||
#
|
||||
#Example 1: An simple LDAP file with two entries
|
||||
#
|
||||
|
||||
dn: cn=Barbara Jensen, ou=Product Development, dc=airius, dc=com
|
||||
objectclass: top
|
||||
objectclass: person
|
||||
objectclass: organizationalPerson
|
||||
cn: Barbara Jensen
|
||||
cn: Barbara J Jensen
|
||||
cn: Babs Jensen
|
||||
sn: Jensen
|
||||
uid: bjensen
|
||||
telephonenumber: +1 408 555 1212
|
||||
description: A big sailing fan.
|
||||
|
||||
dn: cn=Bjorn Jensen, ou=Accounting, dc=airius, dc=com
|
||||
objectclass: top
|
||||
objectclass: person
|
||||
objectclass: organizationalPerson
|
||||
cn: Bjorn Jensen
|
||||
sn: Jensen
|
||||
telephonenumber: +1 408 555 1212
|
||||
|
||||
|
||||
#
|
||||
# Example 2: A file containing an entry with a folded attribute value
|
||||
#
|
||||
|
||||
dn:cn=Barbara Jensen, ou=Product Development, dc=airius, dc=com
|
||||
objectclass:top
|
||||
objectclass:person
|
||||
objectclass:organizationalPerson
|
||||
cn:Barbara Jensen
|
||||
cn:Barbara J Jensen
|
||||
cn:Babs Jensen
|
||||
sn:Jensen
|
||||
uid:bjensen
|
||||
telephonenumber:+1 408 555 1212
|
||||
description:Babs is a big sailing fan, and travels extensively in sea
|
||||
rch of perfect sailing conditions.
|
||||
title:Product Manager, Rod and Reel Division
|
||||
|
||||
#
|
||||
# Example 3: A file containing a base-64-encoded value
|
||||
#
|
||||
|
||||
dn: cn=Gern Jensen, ou=Product Testing, dc=airius, dc=com
|
||||
objectclass: top
|
||||
objectclass: person
|
||||
objectclass: organizationalPerson
|
||||
cn: Gern Jensen
|
||||
cn: Gern O Jensen
|
||||
sn: Jensen
|
||||
uid: gernj
|
||||
telephonenumber: +1 408 555 1212
|
||||
description:: V2hhdCBhIGNhcmVmdWwgcmVhZGVyIHlvdSBhcmUhICBUaGlzIHZhbHVl
|
||||
IGlzIGJhc2UtNjQtZW5jb2RlZCBiZWNhdXNlIGl0IGhhcyBhIGNvbnRyb2wgY2hhcmFjdG
|
||||
VyIGluIGl0IChhIENSKS4NICBCeSB0aGUgd2F5LCB5b3Ugc2hvdWxkIHJlYWxseSBnZXQg
|
||||
b3V0IG1vcmUu
|
||||
|
||||
|
||||
#
|
||||
# Example 4: A file containing an entries with UTF-8-encoded attribute
|
||||
# values, including language tags. Comments indicate the contents
|
||||
# of UTF-8-encoded attributes and distinguished names.
|
||||
#
|
||||
|
||||
dn:: b3U95Za25qWt6YOoLG89QWlyaXVz
|
||||
# dn:: ou=<JapaneseOU>,o=Airius
|
||||
objectclass: top
|
||||
objectclass: organizationalUnit
|
||||
ou:: 5Za25qWt6YOo
|
||||
# ou:: <JapaneseOU>
|
||||
ou;lang-ja:: 5Za25qWt6YOo
|
||||
# ou;lang-ja:: <JapaneseOU>
|
||||
ou;lang-ja;phonetic:: 44GI44GE44GO44KH44GG44G2
|
||||
# ou;lang-ja:: <JapaneseOU_in_phonetic_representation>
|
||||
ou;lang-en: Sales
|
||||
description: Japanese office
|
||||
|
||||
dn:: dWlkPXJvZ2FzYXdhcmEsb3U95Za25qWt6YOoLG89QWlyaXVz
|
||||
# dn:: uid=<uid>,ou=<JapaneseOU>,o=Airius
|
||||
userpassword: {SHA}O3HSv1MusyL4kTjP+HKI5uxuNoM=
|
||||
objectclass: top
|
||||
objectclass: person
|
||||
objectclass: organizationalPerson
|
||||
objectclass: inetOrgPerson
|
||||
uid: rogasawara
|
||||
mail: rogasawara@airius.co.jp
|
||||
givenname;lang-ja:: 44Ot44OJ44OL44O8
|
||||
# givenname;lang-ja:: <JapaneseGivenname>
|
||||
sn;lang-ja:: 5bCP56yg5Y6f
|
||||
# sn;lang-ja:: <JapaneseSn>
|
||||
cn;lang-ja:: 5bCP56yg5Y6fIOODreODieODi+ODvA==
|
||||
# cn;lang-ja:: <JapaneseCn>
|
||||
title;lang-ja:: 5Za25qWt6YOoIOmDqOmVtw==
|
||||
# title;lang-ja:: <JapaneseTitle>
|
||||
preferredlanguage: ja
|
||||
givenname:: 44Ot44OJ44OL44O8
|
||||
# givenname:: <JapaneseGivenname>
|
||||
sn:: 5bCP56yg5Y6f
|
||||
# sn:: <JapaneseSn>
|
||||
cn:: 5bCP56yg5Y6fIOODreODieODi+ODvA==
|
||||
# cn:: <JapaneseCn>
|
||||
title:: 5Za25qWt6YOoIOmDqOmVtw==
|
||||
# title:: <JapaneseTitle>
|
||||
givenname;lang-ja;phonetic:: 44KN44Gp44Gr44O8
|
||||
# givenname;lang-ja;phonetic::
|
||||
# <JapaneseGivenname_in_phonetic_representation_kana>
|
||||
sn;lang-ja;phonetic:: 44GK44GM44GV44KP44KJ
|
||||
# sn;lang-ja;phonetic:: <JapaneseSn_in_phonetic_representation_kana>
|
||||
cn;lang-ja;phonetic:: 44GK44GM44GV44KP44KJIOOCjeOBqeOBq+ODvA==
|
||||
# cn;lang-ja;phonetic:: <JapaneseCn_in_phonetic_representation_kana>
|
||||
title;lang-ja;phonetic:: 44GI44GE44GO44KH44GG44G2IOOBtuOBoeOCh+OBhg==
|
||||
# title;lang-ja;phonetic::
|
||||
# <JapaneseTitle_in_phonetic_representation_kana>
|
||||
givenname;lang-en: Rodney
|
||||
sn;lang-en: Ogasawara
|
||||
cn;lang-en: Rodney Ogasawara
|
||||
title;lang-en: Sales, Director
|
||||
|
||||
|
||||
#
|
||||
# Example 5: An LDIF file containing an invalid attribute
|
||||
#
|
||||
|
||||
dn: cn=Harry Jacobs, ou=Product Development, dc=airius, dc=com
|
||||
objectClass: top
|
||||
objectClass: person
|
||||
cn: Harry Jacobs
|
||||
description: :A big sailing fan.
|
||||
|
||||
|
||||
#
|
||||
# Example 6: A file containing a reference to an external file
|
||||
#
|
||||
|
||||
dn: cn=Horatio Jensen, ou=Product Testing, dc=airius, dc=com
|
||||
objectclass: top
|
||||
objectclass: person
|
||||
objectclass: organizationalPerson
|
||||
cn: Horatio Jensen
|
||||
cn: Horatio N Jensen
|
||||
sn: Jensen
|
||||
uid: hjensen
|
||||
telephonenumber: +1 408 555 1212
|
||||
jpegphoto:< file:///usr/local/directory/photos/hjensen.jpg
|
||||
|
||||
|
||||
#
|
||||
# Example 7: A file containing a series of change records and comments
|
||||
#
|
||||
|
||||
# Add a new entry
|
||||
dn: cn=Fiona Jensen, ou=Marketing, dc=airius, dc=com
|
||||
changetype: add
|
||||
objectclass: top
|
||||
objectclass: person
|
||||
objectclass: organizationalPerson
|
||||
cn: Fiona Jensen
|
||||
sn: Jensen
|
||||
uid: fiona
|
||||
telephonenumber: +1 408 555 1212
|
||||
jpegphoto:< file:///usr/local/directory/photos/fiona.jpg
|
||||
|
||||
# Delete an existing entry
|
||||
dn: cn=Robert Jensen, ou=Marketing, dc=airius, dc=com
|
||||
changetype: delete
|
||||
|
||||
# Modify an entry's relative distinguished name
|
||||
dn: cn=Paul Jensen, ou=Product Development, dc=airius, dc=com
|
||||
changetype: modrdn
|
||||
newrdn: cn=Paula Jensen
|
||||
deleteoldrdn: 1
|
||||
|
||||
# Rename an entry and move all of its children to a new location in
|
||||
# the directory tree (only implemented by LDAPv3 servers).
|
||||
dn: ou=PD Accountants, ou=Product Development, dc=airius, dc=com
|
||||
changetype: modrdn
|
||||
newrdn: ou=Product Development Accountants
|
||||
deleteoldrdn: 0
|
||||
newsuperior: ou=Accounting, dc=airius, dc=com
|
||||
|
||||
|
||||
# Modify an entry: add an additional value to the postaladdress
|
||||
# attribute, completely delete the description attribute, replace
|
||||
# the telephonenumber attribute with two values, and delete a specific
|
||||
# value from the facsimiletelephonenumber attribute
|
||||
dn: cn=Paula Jensen, ou=Product Development, dc=airius, dc=com
|
||||
changetype: modify
|
||||
add: postaladdress
|
||||
postaladdress: 123 Anystreet $ Sunnyvale, CA $ 94086
|
||||
-
|
||||
|
||||
delete: description
|
||||
-
|
||||
replace: telephonenumber
|
||||
telephonenumber: +1 408 555 1234
|
||||
telephonenumber: +1 408 555 5678
|
||||
-
|
||||
delete: facsimiletelephonenumber
|
||||
facsimiletelephonenumber: +1 408 555 9876
|
||||
-
|
||||
|
||||
# Modify an entry: replace the postaladdress attribute with an empty
|
||||
# set of values (which will cause the attribute to be removed), and
|
||||
# delete the entire description attribute. Note that the first will
|
||||
# always succeed, while the second will only succeed if at least
|
||||
# one value for the description attribute is present.
|
||||
dn: cn=Ingrid Jensen, ou=Product Support, dc=airius, dc=com
|
||||
changetype: modify
|
||||
replace: postaladdress
|
||||
-
|
||||
delete: description
|
||||
-
|
||||
|
||||
|
||||
#
|
||||
# Example 8: An LDIF file containing a change record with a control
|
||||
#
|
||||
|
||||
# Delete an entry. The operation will attach the LDAPv3
|
||||
# Tree Delete Control defined in [9]. The criticality
|
||||
# field is "true" and the controlValue field is
|
||||
# absent, as required by [9].
|
||||
dn: ou=Product Development, dc=airius, dc=com
|
||||
control: 1.2.840.113556.1.4.805 true
|
||||
changetype: delete
|
||||
Reference in New Issue
Block a user