diff --git a/archetypes/simple-cli/pom.xml b/archetypes/simple-cli/pom.xml index a3a79ad84..dd39150c4 100644 --- a/archetypes/simple-cli/pom.xml +++ b/archetypes/simple-cli/pom.xml @@ -87,14 +87,6 @@ org.codehaus.mojo exec-maven-plugin 1.1 - - - none - - exec - - - java diff --git a/archetypes/simple-cli/src/main/resources/data-source-context.xml b/archetypes/simple-cli/src/main/resources/data-source-context.xml deleted file mode 100644 index f4e0730cb..000000000 --- a/archetypes/simple-cli/src/main/resources/data-source-context.xml +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - environment - - - environment - - - - hsql - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file 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 7eb23bfbb..c81a16834 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 @@ -29,6 +29,7 @@ import org.springframework.batch.core.JobParametersBuilder; import org.springframework.batch.core.job.JobSupport; import org.springframework.batch.repeat.ExitStatus; import org.springframework.test.AbstractTransactionalDataSourceSpringContextTests; +import org.springframework.util.ClassUtils; /** * @author Dave Syer @@ -52,7 +53,7 @@ public abstract class AbstractJobDaoTests extends AbstractTransactionalDataSourc protected Date jobExecutionStartTime = new Date(System.currentTimeMillis()); protected String[] getConfigLocations() { - return new String[] { "sql-dao-test.xml" }; + return new String[] { ClassUtils.addResourcePathToPackagePath(getClass(), "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 b2781ea8c..1fe607d9d 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 @@ -31,6 +31,7 @@ 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 @@ -79,7 +80,7 @@ public abstract class AbstractStepDaoTests extends AbstractTransactionalDataSour * @see org.springframework.test.AbstractSingleSpringContextTests#getConfigLocations() */ protected String[] getConfigLocations() { - return new String[] { "sql-dao-test.xml" }; + return new String[] { ClassUtils.addResourcePathToPackagePath(getClass(), "sql-dao-test.xml") }; } /* diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/repository/dao/JdbcJobExecutionDaoTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/repository/dao/JdbcJobExecutionDaoTests.java index 2fb460430..62278cbe7 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/repository/dao/JdbcJobExecutionDaoTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/repository/dao/JdbcJobExecutionDaoTests.java @@ -1,5 +1,7 @@ package org.springframework.batch.core.repository.dao; +import org.springframework.util.ClassUtils; + public class JdbcJobExecutionDaoTests extends AbstractJobExecutionDaoTests { protected JobExecutionDao getJobExecutionDao() { @@ -14,7 +16,7 @@ public class JdbcJobExecutionDaoTests extends AbstractJobExecutionDaoTests { } protected String[] getConfigLocations() { - return new String[] { "sql-dao-test.xml" }; + return new String[] { ClassUtils.addResourcePathToPackagePath(getClass(), "sql-dao-test.xml") }; } } diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/repository/dao/JdbcJobInstanceDaoTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/repository/dao/JdbcJobInstanceDaoTests.java index 02ef9f762..95deb2459 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/repository/dao/JdbcJobInstanceDaoTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/repository/dao/JdbcJobInstanceDaoTests.java @@ -1,5 +1,7 @@ package org.springframework.batch.core.repository.dao; +import org.springframework.util.ClassUtils; + public class JdbcJobInstanceDaoTests extends AbstractJobInstanceDaoTests { @@ -10,7 +12,7 @@ public class JdbcJobInstanceDaoTests extends AbstractJobInstanceDaoTests { } protected String[] getConfigLocations() { - return new String[] { "sql-dao-test.xml" }; + return new String[] { ClassUtils.addResourcePathToPackagePath(getClass(), "sql-dao-test.xml") }; } } diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/repository/dao/JdbcStepExecutionDaoTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/repository/dao/JdbcStepExecutionDaoTests.java index c03897bdb..216fd1fbb 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/repository/dao/JdbcStepExecutionDaoTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/repository/dao/JdbcStepExecutionDaoTests.java @@ -3,6 +3,7 @@ package org.springframework.batch.core.repository.dao; import org.springframework.batch.core.StepExecution; import org.springframework.batch.core.repository.JobRepository; import org.springframework.batch.repeat.ExitStatus; +import org.springframework.util.ClassUtils; public class JdbcStepExecutionDaoTests extends AbstractStepExecutionDaoTests { @@ -17,7 +18,7 @@ public class JdbcStepExecutionDaoTests extends AbstractStepExecutionDaoTests { } protected String[] getConfigLocations() { - return new String[] { "sql-dao-test.xml" }; + return new String[] { ClassUtils.addResourcePathToPackagePath(getClass(), "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 65c16aea8..3d8e7f43f 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 @@ -12,9 +12,11 @@ import org.springframework.batch.core.StepExecution; import org.springframework.batch.core.job.JobSupport; import org.springframework.batch.core.repository.JobExecutionAlreadyRunningException; import org.springframework.batch.core.repository.JobRestartException; +import org.springframework.batch.core.repository.dao.AbstractJobDaoTests; import org.springframework.batch.core.step.StepSupport; import org.springframework.batch.item.ExecutionContext; import org.springframework.test.AbstractTransactionalDataSourceSpringContextTests; +import org.springframework.util.ClassUtils; /** * Repository tests using JDBC DAOs (rather than mocks). @@ -24,7 +26,7 @@ import org.springframework.test.AbstractTransactionalDataSourceSpringContextTest public class SimpleJobRepositoryIntegrationTests extends AbstractTransactionalDataSourceSpringContextTests { protected String[] getConfigLocations() { - return new String[] { "classpath:sql-dao-test.xml" }; + return new String[] { ClassUtils.addResourcePathToPackagePath(AbstractJobDaoTests.class, "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 318a62e19..a8cd10be8 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 @@ -8,9 +8,11 @@ import org.springframework.batch.core.JobInstance; import org.springframework.batch.core.JobParameters; import org.springframework.batch.core.JobParametersBuilder; import org.springframework.batch.core.StepExecution; +import org.springframework.batch.core.repository.dao.AbstractJobDaoTests; import org.springframework.batch.item.ExecutionContext; import org.springframework.batch.item.database.JdbcCursorItemReader; import org.springframework.test.AbstractTransactionalDataSourceSpringContextTests; +import org.springframework.util.ClassUtils; public class JdbcCursorItemReaderPreparedStatementIntegrationTests extends AbstractTransactionalDataSourceSpringContextTests { @@ -56,6 +58,6 @@ public class JdbcCursorItemReaderPreparedStatementIntegrationTests extends } protected String[] getConfigLocations() { - return new String[] { "data-source-context.xml" }; + return new String[] { ClassUtils.addResourcePathToPackagePath(AbstractJobDaoTests.class, "data-source-context.xml") }; } } diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/resource/StepExecutionPreparedStatementSetterTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/resource/StepExecutionPreparedStatementSetterTests.java index c522dd178..3ea4a750c 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/resource/StepExecutionPreparedStatementSetterTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/resource/StepExecutionPreparedStatementSetterTests.java @@ -25,8 +25,10 @@ import org.springframework.batch.core.JobInstance; import org.springframework.batch.core.JobParameters; import org.springframework.batch.core.JobParametersBuilder; import org.springframework.batch.core.StepExecution; +import org.springframework.batch.core.repository.dao.AbstractJobDaoTests; import org.springframework.jdbc.core.RowCallbackHandler; import org.springframework.test.AbstractTransactionalDataSourceSpringContextTests; +import org.springframework.util.ClassUtils; /** * @author Lucas Ward @@ -38,7 +40,7 @@ public class StepExecutionPreparedStatementSetterTests extends AbstractTransacti StepExecution stepExecution; protected String[] getConfigLocations() { - return new String[] { "data-source-context.xml" }; + return new String[] { ClassUtils.addResourcePathToPackagePath(AbstractJobDaoTests.class, "data-source-context.xml") }; } protected void onSetUpInTransaction() throws Exception { diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/step/item/ItemOrientedStepIntegrationTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/step/item/ItemOrientedStepIntegrationTests.java index 5f1b35cd7..c404d16bd 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/step/item/ItemOrientedStepIntegrationTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/step/item/ItemOrientedStepIntegrationTests.java @@ -28,6 +28,7 @@ import org.springframework.batch.core.JobParameters; import org.springframework.batch.core.StepExecution; import org.springframework.batch.core.job.JobSupport; import org.springframework.batch.core.repository.JobRepository; +import org.springframework.batch.core.repository.dao.AbstractJobDaoTests; import org.springframework.batch.core.repository.dao.MapJobExecutionDao; import org.springframework.batch.core.repository.dao.MapJobInstanceDao; import org.springframework.batch.core.repository.dao.MapStepExecutionDao; @@ -43,6 +44,7 @@ import org.springframework.test.AbstractDependencyInjectionSpringContextTests; import org.springframework.transaction.PlatformTransactionManager; import org.springframework.transaction.support.TransactionSynchronizationAdapter; import org.springframework.transaction.support.TransactionSynchronizationManager; +import org.springframework.util.ClassUtils; /** * @author Dave Syer @@ -118,7 +120,7 @@ public class ItemOrientedStepIntegrationTests extends AbstractDependencyInjectio * @see org.springframework.test.AbstractSingleSpringContextTests#getConfigLocations() */ protected String[] getConfigLocations() { - return new String[] { "sql-dao-test.xml" }; + return new String[] { ClassUtils.addResourcePathToPackagePath(AbstractJobDaoTests.class, "sql-dao-test.xml") }; } public void testStatusForCommitFailedException() throws Exception { diff --git a/spring-batch-core/src/test/resources/data-source-context.xml b/spring-batch-core/src/test/resources/org/springframework/batch/core/repository/dao/data-source-context.xml similarity index 100% rename from spring-batch-core/src/test/resources/data-source-context.xml rename to spring-batch-core/src/test/resources/org/springframework/batch/core/repository/dao/data-source-context.xml diff --git a/spring-batch-core/src/test/resources/sql-dao-test.xml b/spring-batch-core/src/test/resources/org/springframework/batch/core/repository/dao/sql-dao-test.xml similarity index 100% rename from spring-batch-core/src/test/resources/sql-dao-test.xml rename to spring-batch-core/src/test/resources/org/springframework/batch/core/repository/dao/sql-dao-test.xml diff --git a/spring-batch-samples/.springBeans b/spring-batch-samples/.springBeans index 63237cf04..520dfd63c 100644 --- a/spring-batch-samples/.springBeans +++ b/spring-batch-samples/.springBeans @@ -39,6 +39,7 @@ src/main/resources/jobs/compositeItemWriterSampleJob.xml src/main/resources/jobs/multiResourceJob.xml src/main/resources/jobs/jobExecutionContextSample.xml + src/main/resources/hibernate-context.xml diff --git a/spring-batch-samples/src/main/resources/data-source-context.xml b/spring-batch-samples/src/main/resources/data-source-context.xml index b7590338c..f4e0730cb 100644 --- a/spring-batch-samples/src/main/resources/data-source-context.xml +++ b/spring-batch-samples/src/main/resources/data-source-context.xml @@ -12,20 +12,8 @@ - + - - - - - - - - - diff --git a/spring-batch-samples/src/test/resources/org/springframework/batch/sample/HibernateFailureJobFunctionalTests-context.xml b/spring-batch-samples/src/test/resources/org/springframework/batch/sample/HibernateFailureJobFunctionalTests-context.xml index 0ff99097e..a907d541b 100644 --- a/spring-batch-samples/src/test/resources/org/springframework/batch/sample/HibernateFailureJobFunctionalTests-context.xml +++ b/spring-batch-samples/src/test/resources/org/springframework/batch/sample/HibernateFailureJobFunctionalTests-context.xml @@ -5,6 +5,7 @@ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"> + diff --git a/spring-batch-samples/src/test/resources/org/springframework/batch/sample/HibernateJobFunctionalTests-context.xml b/spring-batch-samples/src/test/resources/org/springframework/batch/sample/HibernateJobFunctionalTests-context.xml index 0ff99097e..a907d541b 100644 --- a/spring-batch-samples/src/test/resources/org/springframework/batch/sample/HibernateJobFunctionalTests-context.xml +++ b/spring-batch-samples/src/test/resources/org/springframework/batch/sample/HibernateJobFunctionalTests-context.xml @@ -5,6 +5,7 @@ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"> +