IN PROGRESS - BATCH-693: Refactor samples along domain contours
moved generic domain-agnostic classes into common package
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
package org.springframework.batch.sample.tasklet;
|
||||
package org.springframework.batch.sample.common;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.batch.sample.item.writer;
|
||||
package org.springframework.batch.sample.common;
|
||||
|
||||
import org.springframework.batch.item.support.AbstractItemWriter;
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.batch.sample;
|
||||
package org.springframework.batch.sample.common;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.ResultSetMetaData;
|
||||
@@ -1,4 +1,4 @@
|
||||
package org.springframework.batch.sample.tasklet;
|
||||
package org.springframework.batch.sample.common;
|
||||
|
||||
import org.springframework.batch.repeat.ExitStatus;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package org.springframework.batch.sample.item.reader;
|
||||
package org.springframework.batch.sample.common;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
@@ -16,7 +16,6 @@ import org.springframework.batch.item.ItemReader;
|
||||
import org.springframework.batch.item.ItemStream;
|
||||
import org.springframework.batch.item.ReaderNotOpenException;
|
||||
import org.springframework.batch.repeat.ExitStatus;
|
||||
import org.springframework.batch.sample.item.writer.StagingItemWriter;
|
||||
import org.springframework.dao.OptimisticLockingFailureException;
|
||||
import org.springframework.dao.DataAccessException;
|
||||
import org.springframework.jdbc.core.RowMapper;
|
||||
@@ -1,4 +1,4 @@
|
||||
package org.springframework.batch.sample.item.writer;
|
||||
package org.springframework.batch.sample.common;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.sql.PreparedStatement;
|
||||
@@ -1,4 +1,4 @@
|
||||
package org.springframework.batch.sample.tasklet;
|
||||
package org.springframework.batch.sample.common;
|
||||
|
||||
/**
|
||||
* Exception indicating failed execution of system command.
|
||||
@@ -1,4 +1,4 @@
|
||||
package org.springframework.batch.sample.tasklet;
|
||||
package org.springframework.batch.sample.common;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
@@ -1,4 +1,4 @@
|
||||
package org.springframework.batch.sample.tasklet;
|
||||
package org.springframework.batch.sample.common;
|
||||
|
||||
import org.springframework.batch.repeat.ExitStatus;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package org.springframework.batch.sample.exception.handler;
|
||||
package org.springframework.batch.sample.football;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
@@ -30,7 +30,7 @@
|
||||
</bean>
|
||||
</property>
|
||||
<property name="itemWriter">
|
||||
<bean id="writer" class="org.springframework.batch.sample.item.writer.DummyItemWriter" />
|
||||
<bean id="writer" class="org.springframework.batch.sample.common.DummyItemWriter" />
|
||||
</property>
|
||||
</bean>
|
||||
</property>
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
</property>
|
||||
<property name="itemWriter">
|
||||
<bean
|
||||
class="org.springframework.batch.sample.item.writer.StagingItemWriter">
|
||||
class="org.springframework.batch.sample.common.StagingItemWriter">
|
||||
<property name="dataSource"
|
||||
ref="dataSource" />
|
||||
<property name="lobHandler"
|
||||
@@ -48,7 +48,7 @@
|
||||
</property>
|
||||
<property name="itemReader">
|
||||
<bean
|
||||
class="org.springframework.batch.sample.item.reader.StagingItemReader">
|
||||
class="org.springframework.batch.sample.common.StagingItemReader">
|
||||
<property name="lobHandler"
|
||||
ref="lobHandler" />
|
||||
<property name="dataSource"
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
<bean id="executeSystemCommand" parent="taskletStep">
|
||||
<property name="tasklet">
|
||||
<bean
|
||||
class="org.springframework.batch.sample.tasklet.SystemCommandTasklet">
|
||||
class="org.springframework.batch.sample.common.SystemCommandTasklet">
|
||||
<property name="command" value="java -version" />
|
||||
<!-- 5 second timeout for the command to complete -->
|
||||
<property name="timeout" value="5000" />
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<import resource="classpath:data-source-context.xml" />
|
||||
|
||||
<bean id="processor"
|
||||
class="org.springframework.batch.sample.item.writer.StagingItemWriter">
|
||||
class="org.springframework.batch.sample.common.StagingItemWriter">
|
||||
<property name="incrementer">
|
||||
<bean id="jobIncrementer" parent="incrementerParent">
|
||||
<property name="incrementerName"
|
||||
@@ -19,7 +19,7 @@
|
||||
</bean>
|
||||
|
||||
<bean id="provider"
|
||||
class="org.springframework.batch.sample.item.reader.StagingItemReader">
|
||||
class="org.springframework.batch.sample.common.StagingItemReader">
|
||||
<property name="dataSource" ref="dataSource" />
|
||||
</bean>
|
||||
|
||||
|
||||
@@ -143,7 +143,7 @@ xmlStaxJob | | | x | | | | | | x | | | | | | | |
|
||||
<bean id="executeSystemCommand" parent="taskletStep">
|
||||
<property name="tasklet">
|
||||
<bean
|
||||
class="org.springframework.batch.sample.tasklet.SystemCommandTasklet">
|
||||
class="org.springframework.batch.sample.common.SystemCommandTasklet">
|
||||
<property name="command" value="echo hello" />
|
||||
<!-- 5 second timeout for the command to complete -->
|
||||
<property name="timeout" value="5000" />
|
||||
|
||||
@@ -4,7 +4,7 @@ import static org.junit.Assert.*;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
|
||||
import org.springframework.batch.sample.item.writer.StagingItemWriter;
|
||||
import org.springframework.batch.sample.common.StagingItemWriter;
|
||||
import org.springframework.jdbc.core.JdbcOperations;
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
|
||||
@@ -11,7 +11,8 @@ import org.springframework.batch.core.JobInstance;
|
||||
import org.springframework.batch.core.JobParameters;
|
||||
import org.springframework.batch.core.StepExecution;
|
||||
import org.springframework.batch.item.ExecutionContext;
|
||||
import org.springframework.batch.sample.item.writer.StagingItemWriter;
|
||||
import org.springframework.batch.sample.common.StagingItemReader;
|
||||
import org.springframework.batch.sample.common.StagingItemWriter;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.jdbc.core.JdbcOperations;
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
|
||||
@@ -26,6 +26,7 @@ import org.springframework.batch.core.JobExecution;
|
||||
import org.springframework.batch.core.JobInstance;
|
||||
import org.springframework.batch.core.JobParameters;
|
||||
import org.springframework.batch.core.StepExecution;
|
||||
import org.springframework.batch.sample.common.StagingItemWriter;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.jdbc.core.JdbcOperations;
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
|
||||
@@ -4,6 +4,7 @@ import static org.junit.Assert.assertSame;
|
||||
import static org.junit.Assert.fail;
|
||||
import org.junit.Test;
|
||||
import org.springframework.batch.repeat.ExitStatus;
|
||||
import org.springframework.batch.sample.common.ConfigurableSystemProcessExitCodeMapper;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -4,6 +4,7 @@ import static org.junit.Assert.*;
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.batch.repeat.ExitStatus;
|
||||
import org.springframework.batch.sample.common.SimpleSystemProcessExitCodeMapper;
|
||||
|
||||
/**
|
||||
* Tests for {@link SimpleSystemProcessExitCodeMapper}.
|
||||
|
||||
@@ -11,6 +11,9 @@ import org.springframework.batch.core.JobInterruptedException;
|
||||
import org.springframework.batch.core.JobParameters;
|
||||
import org.springframework.batch.core.StepExecution;
|
||||
import org.springframework.batch.repeat.ExitStatus;
|
||||
import org.springframework.batch.sample.common.SystemCommandException;
|
||||
import org.springframework.batch.sample.common.SystemCommandTasklet;
|
||||
import org.springframework.batch.sample.common.SystemProcessExitCodeMapper;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
Reference in New Issue
Block a user