From bd703fef34532b719a9fbc05c58ec0ec1608a606 Mon Sep 17 00:00:00 2001 From: lucasward Date: Fri, 21 Mar 2008 19:07:18 +0000 Subject: [PATCH] BATCH-377: Build error should be fixed now. --- spring-batch-core/.springBeans | 5 +--- .../repository/dao/AbstractJobDaoTests.java | 6 +---- .../repository/dao/AbstractStepDaoTests.java | 6 +---- .../SimpleJobRepositoryIntegrationTests.java | 2 +- ...aderPreparedStatementIntegrationTests.java | 2 +- ...arametersPreparedStatementSetterTests.java | 2 +- .../dao => }/data-source-context.xml | 4 +-- .../core/repository/dao => }/destroy.sql | 1 + .../batch/core/repository/dao => }/init.sql | 14 +++++++++++ .../core/resource/data-source-context.xml | 25 ------------------- .../resource/destroy-foo-schema-hsqldb.sql | 1 - .../core/resource/init-foo-schema-hsqldb.sql | 13 ---------- .../core/repository/dao => }/sql-dao-test.xml | 0 13 files changed, 23 insertions(+), 58 deletions(-) rename spring-batch-core/src/test/resources/{org/springframework/batch/core/repository/dao => }/data-source-context.xml (89%) rename spring-batch-core/src/test/resources/{org/springframework/batch/core/repository/dao => }/destroy.sql (95%) rename spring-batch-core/src/test/resources/{org/springframework/batch/core/repository/dao => }/init.sql (83%) delete mode 100644 spring-batch-core/src/test/resources/org/springframework/batch/core/resource/data-source-context.xml delete mode 100644 spring-batch-core/src/test/resources/org/springframework/batch/core/resource/destroy-foo-schema-hsqldb.sql delete mode 100644 spring-batch-core/src/test/resources/org/springframework/batch/core/resource/init-foo-schema-hsqldb.sql rename spring-batch-core/src/test/resources/{org/springframework/batch/core/repository/dao => }/sql-dao-test.xml (100%) diff --git a/spring-batch-core/.springBeans b/spring-batch-core/.springBeans index 747efc613..727751631 100644 --- a/spring-batch-core/.springBeans +++ b/spring-batch-core/.springBeans @@ -1,17 +1,14 @@ 1 - + - src/test/resources/org/springframework/batch/core/configuration/support/test-context.xml src/test/resources/org/springframework/batch/core/launch/support/job.xml src/test/resources/org/springframework/batch/core/launch/support/test-environment.xml - src/test/resources/org/springframework/batch/core/repository/dao/data-source-context.xml - src/test/resources/org/springframework/batch/core/repository/dao/sql-dao-test.xml diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/repository/dao/AbstractJobDaoTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/repository/dao/AbstractJobDaoTests.java index 8afc8fcdd..50cf5e36a 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/repository/dao/AbstractJobDaoTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/repository/dao/AbstractJobDaoTests.java @@ -27,12 +27,8 @@ import org.springframework.batch.core.JobInstance; import org.springframework.batch.core.JobParameters; import org.springframework.batch.core.JobParametersBuilder; import org.springframework.batch.core.job.JobSupport; -import org.springframework.batch.core.repository.dao.JobExecutionDao; -import org.springframework.batch.core.repository.dao.JobInstanceDao; -import org.springframework.batch.core.repository.dao.NoSuchObjectException; import org.springframework.batch.repeat.ExitStatus; import org.springframework.test.AbstractTransactionalDataSourceSpringContextTests; -import org.springframework.util.ClassUtils; /** * @author Dave Syer @@ -56,7 +52,7 @@ public abstract class AbstractJobDaoTests extends AbstractTransactionalDataSourc protected Date jobExecutionStartTime = new Date(System.currentTimeMillis()); protected String[] getConfigLocations() { - return new String[] { ClassUtils.addResourcePathToPackagePath(getClass(), "sql-dao-test.xml") }; + return new String[] { "sql-dao-test.xml" }; } /** diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/repository/dao/AbstractStepDaoTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/repository/dao/AbstractStepDaoTests.java index b22da5982..d087f96e2 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/repository/dao/AbstractStepDaoTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/repository/dao/AbstractStepDaoTests.java @@ -26,16 +26,12 @@ import org.springframework.batch.core.JobParameters; import org.springframework.batch.core.Step; import org.springframework.batch.core.StepExecution; import org.springframework.batch.core.job.JobSupport; -import org.springframework.batch.core.repository.dao.JobExecutionDao; -import org.springframework.batch.core.repository.dao.JobInstanceDao; -import org.springframework.batch.core.repository.dao.StepExecutionDao; import org.springframework.batch.core.step.ExitStatusExceptionClassifier; import org.springframework.batch.core.step.StepSupport; import org.springframework.batch.item.ExecutionContext; import org.springframework.batch.repeat.ExitStatus; import org.springframework.dao.OptimisticLockingFailureException; import org.springframework.test.AbstractTransactionalDataSourceSpringContextTests; -import org.springframework.util.ClassUtils; /** * Tests for step persistence (StepInstanceDao and StepExecutionDao). Because it is very reasonable to assume that there is a @@ -84,7 +80,7 @@ public abstract class AbstractStepDaoTests extends AbstractTransactionalDataSour * @see org.springframework.test.AbstractSingleSpringContextTests#getConfigLocations() */ protected String[] getConfigLocations() { - return new String[] { ClassUtils.addResourcePathToPackagePath(getClass(), "sql-dao-test.xml") }; + return new String[] { "sql-dao-test.xml" }; } /* diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/repository/support/SimpleJobRepositoryIntegrationTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/repository/support/SimpleJobRepositoryIntegrationTests.java index 6725b2fcf..03f1b315b 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/repository/support/SimpleJobRepositoryIntegrationTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/repository/support/SimpleJobRepositoryIntegrationTests.java @@ -24,7 +24,7 @@ import org.springframework.test.AbstractTransactionalDataSourceSpringContextTest public class SimpleJobRepositoryIntegrationTests extends AbstractTransactionalDataSourceSpringContextTests { protected String[] getConfigLocations() { - return new String[] { "classpath:org/springframework/batch/core/repository/dao/sql-dao-test.xml" }; + return new String[] { "classpath:sql-dao-test.xml" }; } private SimpleJobRepository jobRepository; diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/resource/JdbcCursorItemReaderPreparedStatementIntegrationTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/resource/JdbcCursorItemReaderPreparedStatementIntegrationTests.java index 0e5fff50e..7d93b5380 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/resource/JdbcCursorItemReaderPreparedStatementIntegrationTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/resource/JdbcCursorItemReaderPreparedStatementIntegrationTests.java @@ -57,6 +57,6 @@ public class JdbcCursorItemReaderPreparedStatementIntegrationTests extends } protected String[] getConfigLocations() { - return new String[] { "org/springframework/batch/core/resource/data-source-context.xml" }; + return new String[] { "data-source-context.xml" }; } } diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/resource/JobParametersPreparedStatementSetterTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/resource/JobParametersPreparedStatementSetterTests.java index 3ada02bd4..803724752 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/resource/JobParametersPreparedStatementSetterTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/resource/JobParametersPreparedStatementSetterTests.java @@ -42,7 +42,7 @@ public class JobParametersPreparedStatementSetterTests extends AbstractTransacti JobParametersPreparedStatementSetter pss; protected String[] getConfigLocations() { - return new String[] { ClassUtils.addResourcePathToPackagePath(getClass(), "data-source-context.xml") }; + return new String[] { "data-source-context.xml" }; } protected void onSetUpInTransaction() throws Exception { diff --git a/spring-batch-core/src/test/resources/org/springframework/batch/core/repository/dao/data-source-context.xml b/spring-batch-core/src/test/resources/data-source-context.xml similarity index 89% rename from spring-batch-core/src/test/resources/org/springframework/batch/core/repository/dao/data-source-context.xml rename to spring-batch-core/src/test/resources/data-source-context.xml index 231f997c0..a3fc06736 100644 --- a/spring-batch-core/src/test/resources/org/springframework/batch/core/repository/dao/data-source-context.xml +++ b/spring-batch-core/src/test/resources/data-source-context.xml @@ -9,8 +9,8 @@ - - + + diff --git a/spring-batch-core/src/test/resources/org/springframework/batch/core/repository/dao/destroy.sql b/spring-batch-core/src/test/resources/destroy.sql similarity index 95% rename from spring-batch-core/src/test/resources/org/springframework/batch/core/repository/dao/destroy.sql rename to spring-batch-core/src/test/resources/destroy.sql index 461b9682d..bbdb2a8d6 100644 --- a/spring-batch-core/src/test/resources/org/springframework/batch/core/repository/dao/destroy.sql +++ b/spring-batch-core/src/test/resources/destroy.sql @@ -4,6 +4,7 @@ DROP TABLE BATCH_STEP_EXECUTION IF EXISTS; DROP TABLE BATCH_JOB_EXECUTION IF EXISTS; DROP TABLE BATCH_JOB_PARAMS IF EXISTS; DROP TABLE BATCH_JOB_INSTANCE IF EXISTS; +DROP TABLE T_FOOS; DROP TABLE BATCH_STEP_EXECUTION_SEQ IF EXISTS; DROP TABLE BATCH_JOB_EXECUTION_SEQ IF EXISTS; diff --git a/spring-batch-core/src/test/resources/org/springframework/batch/core/repository/dao/init.sql b/spring-batch-core/src/test/resources/init.sql similarity index 83% rename from spring-batch-core/src/test/resources/org/springframework/batch/core/repository/dao/init.sql rename to spring-batch-core/src/test/resources/init.sql index 56a4553b0..129475606 100644 --- a/spring-batch-core/src/test/resources/org/springframework/batch/core/repository/dao/init.sql +++ b/spring-batch-core/src/test/resources/init.sql @@ -71,3 +71,17 @@ CREATE TABLE BATCH_JOB_EXECUTION_SEQ ( CREATE TABLE BATCH_JOB_SEQ ( ID BIGINT IDENTITY ); + +CREATE TABLE T_FOOS ( + ID BIGINT NOT NULL, + NAME VARCHAR(45), + VALUE INTEGER +); + +ALTER TABLE T_FOOS ADD PRIMARY KEY (ID); + +INSERT INTO t_foos (id, name, value) VALUES (1, 'bar1', 1); +INSERT INTO t_foos (id, name, value) VALUES (2, 'bar2', 2); +INSERT INTO t_foos (id, name, value) VALUES (3, 'bar3', 3); +INSERT INTO t_foos (id, name, value) VALUES (4, 'bar4', 4); +INSERT INTO t_foos (id, name, value) VALUES (5, 'bar5', 5); diff --git a/spring-batch-core/src/test/resources/org/springframework/batch/core/resource/data-source-context.xml b/spring-batch-core/src/test/resources/org/springframework/batch/core/resource/data-source-context.xml deleted file mode 100644 index 5c65efecd..000000000 --- a/spring-batch-core/src/test/resources/org/springframework/batch/core/resource/data-source-context.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/spring-batch-core/src/test/resources/org/springframework/batch/core/resource/destroy-foo-schema-hsqldb.sql b/spring-batch-core/src/test/resources/org/springframework/batch/core/resource/destroy-foo-schema-hsqldb.sql deleted file mode 100644 index 7124ced3e..000000000 --- a/spring-batch-core/src/test/resources/org/springframework/batch/core/resource/destroy-foo-schema-hsqldb.sql +++ /dev/null @@ -1 +0,0 @@ -DROP TABLE T_FOOS; \ No newline at end of file diff --git a/spring-batch-core/src/test/resources/org/springframework/batch/core/resource/init-foo-schema-hsqldb.sql b/spring-batch-core/src/test/resources/org/springframework/batch/core/resource/init-foo-schema-hsqldb.sql deleted file mode 100644 index 6e565a286..000000000 --- a/spring-batch-core/src/test/resources/org/springframework/batch/core/resource/init-foo-schema-hsqldb.sql +++ /dev/null @@ -1,13 +0,0 @@ -CREATE TABLE T_FOOS ( - ID BIGINT NOT NULL, - NAME VARCHAR(45), - VALUE INTEGER -); - -ALTER TABLE T_FOOS ADD PRIMARY KEY (ID); - -INSERT INTO t_foos (id, name, value) VALUES (1, 'bar1', 1); -INSERT INTO t_foos (id, name, value) VALUES (2, 'bar2', 2); -INSERT INTO t_foos (id, name, value) VALUES (3, 'bar3', 3); -INSERT INTO t_foos (id, name, value) VALUES (4, 'bar4', 4); -INSERT INTO t_foos (id, name, value) VALUES (5, 'bar5', 5); diff --git a/spring-batch-core/src/test/resources/org/springframework/batch/core/repository/dao/sql-dao-test.xml b/spring-batch-core/src/test/resources/sql-dao-test.xml similarity index 100% rename from spring-batch-core/src/test/resources/org/springframework/batch/core/repository/dao/sql-dao-test.xml rename to spring-batch-core/src/test/resources/sql-dao-test.xml