diff --git a/build.gradle b/build.gradle
index cf4c4baca..511849149 100644
--- a/build.gradle
+++ b/build.gradle
@@ -342,6 +342,12 @@ project('spring-batch-infrastructure') {
testCompile "javax.xml.bind:jaxb-api:$jaxbApiVersion"
testCompile "org.springframework.kafka:spring-kafka-test:$springKafkaVersion"
testCompile "org.assertj:assertj-core:$assertjVersion"
+ testCompile "org.xmlunit:xmlunit-core:$xmlunitVersion"
+ testCompile "org.xmlunit:xmlunit-matchers:$xmlunitVersion"
+ testCompile "com.thoughtworks.xstream:xstream:$xstreamVersion"
+ testCompile "org.apache.activemq:activemq-broker:$activemqVersion"
+ testCompile "org.apache.activemq:activemq-kahadb-store:$activemqVersion"
+ testCompile "org.springframework.data:spring-data-jpa:$springDataJpaVersion"
testRuntime "com.sun.mail:javax.mail:$javaMailVersion"
testRuntime "org.codehaus.groovy:groovy-jsr223:$groovyVersion"
@@ -449,62 +455,6 @@ project('spring-batch-core-tests') {
}
}
-project('spring-batch-infrastructure-tests') {
- description = 'Spring Batch Infrastructure Tests'
- project.tasks.findByPath("artifactoryPublish")?.enabled = false
- dependencies {
- compile project(":spring-batch-infrastructure")
- compile "javax.jms:javax.jms-api:$jmsVersion"
- compile "org.apache.commons:commons-dbcp2:$commonsDdbcpVersion"
- compile "org.springframework:spring-tx:$springVersion"
- compile "org.springframework:spring-aop:$springVersion"
-
- testCompile "org.hsqldb:hsqldb:$hsqldbVersion"
- testCompile "commons-io:commons-io:$commonsIoVersion"
- testCompile "org.apache.derby:derby:$derbyVersion"
- testCompile "org.apache.activemq:activemq-broker:$activemqVersion"
- testCompile "org.apache.activemq:activemq-kahadb-store:$activemqVersion"
- testCompile "junit:junit:${junitVersion}"
- testCompile "org.hamcrest:hamcrest-library:$hamcrestVersion"
- testCompile "org.apache.geronimo.specs:geronimo-j2ee-management_1.1_spec:1.0.1"
- testCompile "org.xmlunit:xmlunit-core:$xmlunitVersion"
- testCompile "org.xmlunit:xmlunit-matchers:$xmlunitVersion"
- testCompile "org.apache.logging.log4j:log4j-api:$log4jVersion"
- testCompile "org.apache.logging.log4j:log4j-core:$log4jVersion"
- testCompile "com.thoughtworks.xstream:xstream:$xstreamVersion"
- testCompile("com.fasterxml.woodstox:woodstox-core:$woodstoxVersion") {
- exclude group: 'stax', module: 'stax-api'
- }
- testCompile "org.apache.commons:commons-lang3:$commonsLangVersion"
- testCompile("org.springframework:spring-oxm:$springVersion") {
- exclude group: 'commons-lang', module: 'commons-lang'
- }
- testCompile "org.springframework.data:spring-data-jpa:$springDataJpaVersion"
- testCompile "org.springframework:spring-jdbc:$springVersion"
- testCompile "org.springframework:spring-test:$springVersion"
- testCompile "org.mockito:mockito-core:$mockitoVersion"
- testCompile "javax.xml.bind:jaxb-api:$jaxbApiVersion"
-
- compile("org.hibernate:hibernate-core:$hibernateVersion") { dep ->
- optional dep
- exclude group: 'org.jboss.spec.javax.transaction', module: 'jboss-transaction-api_1.1_spec'
- }
- compile("org.hibernate:hibernate-entitymanager:$hibernateVersion") { dep ->
- optional dep
- exclude group: 'org.jboss.spec.javax.transaction', module: 'jboss-transaction-api_1.1_spec'
- }
- optional "javax.transaction:javax.transaction-api:1.2"
- optional "org.springframework:spring-orm:$springVersion"
- optional "org.springframework:spring-jms:$springVersion"
-
- runtime "mysql:mysql-connector-java:$mysqlVersion"
- runtime "org.postgresql:postgresql:$postgresqlVersion"
- }
- test {
- enabled = project.hasProperty('alltests')
- }
-}
-
//Domain for batch job testing
project('spring-batch-test') {
description = 'Spring Batch Test'
diff --git a/spring-batch-infrastructure-tests/.springBeans b/spring-batch-infrastructure-tests/.springBeans
deleted file mode 100644
index a0683edd7..000000000
--- a/spring-batch-infrastructure-tests/.springBeans
+++ /dev/null
@@ -1,43 +0,0 @@
-
-
- 1
-
-
-
-
-
-
- src/test/resources/org/springframework/batch/jms/jms-context.xml
- src/test/resources/data-source-context.xml
- src/test/resources/org/springframework/batch/item/database/data-source-context.xml
- src/test/resources/org/springframework/batch/item/database/JdbcPagingItemReaderCommonTests-context.xml
- src/test/resources/org/springframework/batch/item/database/JpaPagingItemReaderCommonTests-context.xml
-
-
-
-
- true
- false
-
- src/test/resources/data-source-context.xml
-
-
-
-
- true
- false
-
- src/test/resources/org/springframework/batch/jms/jms-context.xml
- src/test/resources/data-source-context.xml
-
-
-
-
- true
- false
-
- src/test/resources/data-source-context.xml
-
-
-
-
diff --git a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/database/JdbcPagingItemReaderAsyncTests.java b/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/database/JdbcPagingItemReaderAsyncTests.java
deleted file mode 100644
index 53f3311b1..000000000
--- a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/database/JdbcPagingItemReaderAsyncTests.java
+++ /dev/null
@@ -1,190 +0,0 @@
-/*
- * Copyright 2012 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.springframework.batch.item.database;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.Callable;
-import java.util.concurrent.CompletionService;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.ExecutorCompletionService;
-import java.util.concurrent.Executors;
-
-import javax.sql.DataSource;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import org.springframework.batch.item.ItemReader;
-import org.springframework.batch.item.database.support.SqlPagingQueryProviderFactoryBean;
-import org.springframework.batch.item.sample.Foo;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.jdbc.core.JdbcTemplate;
-import org.springframework.jdbc.core.RowMapper;
-import org.springframework.test.context.ContextConfiguration;
-import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
-import org.springframework.test.jdbc.JdbcTestUtils;
-
-/**
- * @author Dave Syer
- * @author David Thexton
- * @author Michael Minella
- */
-@RunWith(SpringJUnit4ClassRunner.class)
-@ContextConfiguration(locations = "JdbcPagingItemReaderCommonTests-context.xml")
-public class JdbcPagingItemReaderAsyncTests {
-
- /**
- * The page size
- */
- private static final int PAGE_SIZE = 10;
-
- /**
- * The number of items to read
- */
- private static final int ITEM_COUNT = 1000;
-
- /**
- * The number of threads to create
- */
- private static final int THREAD_COUNT = 10;
-
- private static Log logger = LogFactory.getLog(JdbcPagingItemReaderAsyncTests.class);
-
- @Autowired
- private DataSource dataSource;
-
- private int maxId;
-
- @Before
- public void init() {
- JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource);
- Integer tempMaxId = jdbcTemplate.queryForObject("SELECT MAX(ID) from T_FOOS", Integer.class);
- maxId = tempMaxId != null? tempMaxId : 0;
- for (int i = ITEM_COUNT; i > maxId; i--) {
- jdbcTemplate.update("INSERT into T_FOOS (ID,NAME,VALUE) values (?, ?, ?)", i, "foo" + i, i);
- }
- assertEquals(ITEM_COUNT, JdbcTestUtils.countRowsInTable(jdbcTemplate, "T_FOOS"));
- }
-
- @After
- public void destroy() {
- JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource);
- jdbcTemplate.update("DELETE from T_FOOS where ID>?", maxId);
- }
-
- @Test
- public void testAsyncReader() throws Throwable {
- List throwables = new ArrayList<>();
- int max = 10;
- for (int i = 0; i < max; i++) {
- try {
- doTest();
- }
- catch (Throwable e) {
- throwables.add(e);
- }
- }
- if (!throwables.isEmpty()) {
- throw new IllegalStateException(String.format("Failed %d out of %d", throwables.size(), max), throwables
- .get(0));
- }
- }
-
- /**
- * @throws Exception
- * @throws InterruptedException
- * @throws ExecutionException
- */
- private void doTest() throws Exception, InterruptedException, ExecutionException {
- final ItemReader reader = getItemReader();
- CompletionService> completionService = new ExecutorCompletionService<>(Executors
- .newFixedThreadPool(THREAD_COUNT));
- for (int i = 0; i < THREAD_COUNT; i++) {
- completionService.submit(new Callable>() {
- @Override
- public List call() throws Exception {
- List list = new ArrayList<>();
- Foo next = null;
- do {
- next = reader.read();
- Thread.sleep(10L);
- logger.debug("Reading item: " + next);
- if (next != null) {
- list.add(next);
- }
- } while (next != null);
- return list;
- }
- });
- }
- int count = 0;
- Set results = new HashSet<>();
- for (int i = 0; i < THREAD_COUNT; i++) {
- List items = completionService.take().get();
- count += items.size();
- logger.debug("Finished items count: " + items.size());
- logger.debug("Finished items: " + items);
- assertNotNull(items);
- results.addAll(items);
- }
- assertEquals(ITEM_COUNT, count);
- assertEquals(ITEM_COUNT, results.size());
- }
-
- protected ItemReader getItemReader() throws Exception {
-
- JdbcPagingItemReader reader = new JdbcPagingItemReader<>();
- reader.setDataSource(dataSource);
- SqlPagingQueryProviderFactoryBean factory = new SqlPagingQueryProviderFactoryBean();
- factory.setDataSource(dataSource);
- factory.setSelectClause("select ID, NAME, VALUE");
- factory.setFromClause("from T_FOOS");
- Map sortKeys = new LinkedHashMap<>();
- sortKeys.put("VALUE", Order.ASCENDING);
- factory.setSortKeys(sortKeys);
- reader.setQueryProvider(factory.getObject());
- reader.setRowMapper(new RowMapper() {
- @Override
- public Foo mapRow(ResultSet rs, int i) throws SQLException {
- Foo foo = new Foo();
- foo.setId(rs.getInt(1));
- foo.setName(rs.getString(2));
- foo.setValue(rs.getInt(3));
- return foo;
- }
- });
- reader.setPageSize(PAGE_SIZE);
- reader.afterPropertiesSet();
- reader.setSaveState(false);
-
- return reader;
- }
-
-}
diff --git a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/database/JpaPagingItemReaderAsyncTests.java b/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/database/JpaPagingItemReaderAsyncTests.java
deleted file mode 100644
index c2f60958d..000000000
--- a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/database/JpaPagingItemReaderAsyncTests.java
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- * Copyright 2010-2014 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.springframework.batch.item.database;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-import java.util.concurrent.Callable;
-import java.util.concurrent.CompletionService;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.ExecutorCompletionService;
-import java.util.concurrent.Executors;
-
-import javax.persistence.EntityManagerFactory;
-import javax.sql.DataSource;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.springframework.batch.item.ExecutionContext;
-import org.springframework.batch.item.sample.Foo;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.jdbc.core.JdbcTemplate;
-import org.springframework.test.context.ContextConfiguration;
-import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
-import org.springframework.test.jdbc.JdbcTestUtils;
-
-@RunWith(SpringJUnit4ClassRunner.class)
-@ContextConfiguration(locations = "JpaPagingItemReaderCommonTests-context.xml")
-public class JpaPagingItemReaderAsyncTests {
-
- /**
- * The number of items to read
- */
- private static final int ITEM_COUNT = 1000;
-
- /**
- * The number of threads to create
- */
- private static final int THREAD_COUNT = 10;
-
- private static final int PAGE_SIZE = 10;
-
- private static Log logger = LogFactory.getLog(JpaPagingItemReaderAsyncTests.class);
-
- @Autowired
- private DataSource dataSource;
-
- @Autowired
- private EntityManagerFactory entityManagerFactory;
-
- private int maxId;
-
- @Before
- public void init() {
- JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource);
- maxId = jdbcTemplate.queryForObject("SELECT MAX(ID) from T_FOOS", Integer.class);
- for (int i = ITEM_COUNT; i > maxId; i--) {
- jdbcTemplate.update("INSERT into T_FOOS (ID,NAME,VALUE) values (?, ?, ?)", i, "foo" + i, i);
- }
- assertEquals(ITEM_COUNT, JdbcTestUtils.countRowsInTable(jdbcTemplate, "T_FOOS"));
- }
-
- @After
- public void destroy() {
- JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource);
- jdbcTemplate.update("DELETE from T_FOOS where ID>?", maxId);
- }
-
- @Test
- public void testAsyncReader() throws Throwable {
- List throwables = new ArrayList<>();
- int max = 10;
- for (int i = 0; i < max; i++) {
- try {
- doTest();
- }
- catch (Throwable e) {
- throwables.add(e);
- }
- }
- if (!throwables.isEmpty()) {
- throw new IllegalStateException(String.format("Failed %d out of %d", throwables.size(), max), throwables
- .get(0));
- }
- }
-
- /**
- * @throws Exception
- * @throws InterruptedException
- * @throws ExecutionException
- */
- private void doTest() throws Exception, InterruptedException, ExecutionException {
- final JpaPagingItemReader reader = getItemReader();
- CompletionService> completionService = new ExecutorCompletionService<>(Executors
- .newFixedThreadPool(THREAD_COUNT));
- for (int i = 0; i < THREAD_COUNT; i++) {
- completionService.submit(new Callable>() {
- @Override
- public List call() throws Exception {
- List list = new ArrayList<>();
- Foo next = null;
- do {
- next = reader.read();
- Thread.sleep(10L);
- logger.debug("Reading item: " + next);
- if (next != null) {
- list.add(next);
- }
- } while (next != null);
- return list;
- }
- });
- }
- int count = 0;
- Set results = new HashSet<>();
- for (int i = 0; i < THREAD_COUNT; i++) {
- List items = completionService.take().get();
- count += items.size();
- logger.debug("Finished items count: " + items.size());
- logger.debug("Finished items: " + items);
- assertNotNull(items);
- results.addAll(items);
- }
- assertEquals(ITEM_COUNT, count);
- assertEquals(ITEM_COUNT, results.size());
- reader.close();
- }
-
- private JpaPagingItemReader getItemReader() throws Exception {
-
- String jpqlQuery = "select f from Foo f";
-
- JpaPagingItemReader reader = new JpaPagingItemReader<>();
- reader.setQueryString(jpqlQuery);
- reader.setEntityManagerFactory(entityManagerFactory);
- reader.setPageSize(PAGE_SIZE);
- reader.afterPropertiesSet();
- reader.setSaveState(false);
- reader.open(new ExecutionContext());
-
- return reader;
- }
-
-}
diff --git a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/sample/Foo.java b/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/sample/Foo.java
deleted file mode 100644
index 6c8e95db9..000000000
--- a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/sample/Foo.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * Copyright 2010-2014 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.springframework.batch.item.sample;
-
-import javax.persistence.Entity;
-import javax.persistence.Id;
-import javax.persistence.Table;
-
-/**
- * Simple domain object for testing purposes.
- */
-@Entity
-@Table(name = "T_FOOS")
-public class Foo {
-
- public static final String FAILURE_MESSAGE = "Foo Failure!";
-
- public static final String UGLY_FAILURE_MESSAGE = "Ugly Foo Failure!";
-
- @Id
- private int id;
- private String name;
- private int value;
-
- public Foo(){}
-
- public Foo(int id, String name, int value) {
- this.id = id;
- this.name = name;
- this.value = value;
- }
-
- public String getName() {
- return name;
- }
- public void setName(String name) {
- this.name = name;
- }
- public int getValue() {
- return value;
- }
- public void setValue(int value) {
- this.value = value;
- }
- public int getId() {
- return id;
- }
- public void setId(int id) {
- this.id = id;
- }
-
- @Override
- public String toString() {
- return "Foo[id=" +id +",name=" + name + ",value=" + value + "]";
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + id;
- result = prime * result + ((name == null) ? 0 : name.hashCode());
- result = prime * result + value;
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- Foo other = (Foo) obj;
- if (id != other.id)
- return false;
- if (name == null) {
- if (other.name != null)
- return false;
- }
- else if (!name.equals(other.name))
- return false;
- if (value != other.value)
- return false;
- return true;
- }
-
- public void fail() throws Exception {
- throw new Exception(FAILURE_MESSAGE);
- }
-
- public void failUgly() throws Throwable {
- throw new Throwable(UGLY_FAILURE_MESSAGE);
- }
-
-}
diff --git a/spring-batch-infrastructure-tests/src/test/java/test/jdbc/datasource/DataSourceInitializer.java b/spring-batch-infrastructure-tests/src/test/java/test/jdbc/datasource/DataSourceInitializer.java
deleted file mode 100644
index 4b67fbd8a..000000000
--- a/spring-batch-infrastructure-tests/src/test/java/test/jdbc/datasource/DataSourceInitializer.java
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
- * Copyright 2006-2007 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package test.jdbc.datasource;
-
-import java.io.IOException;
-import java.util.List;
-import java.util.Arrays;
-
-import javax.sql.DataSource;
-
-import org.apache.commons.io.IOUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.springframework.beans.factory.BeanInitializationException;
-import org.springframework.beans.factory.DisposableBean;
-import org.springframework.beans.factory.InitializingBean;
-import org.springframework.core.io.Resource;
-import org.springframework.dao.DataAccessException;
-import org.springframework.jdbc.core.JdbcTemplate;
-import org.springframework.jdbc.datasource.DataSourceTransactionManager;
-import org.springframework.transaction.TransactionStatus;
-import org.springframework.transaction.support.TransactionCallback;
-import org.springframework.transaction.support.TransactionTemplate;
-import org.springframework.util.Assert;
-import org.springframework.util.StringUtils;
-
-public class DataSourceInitializer implements InitializingBean, DisposableBean {
-
- private Resource[] initScripts;
-
- private Resource destroyScript;
-
- private DataSource dataSource;
-
- private boolean initialize = false;
-
- private Log logger = LogFactory.getLog(getClass());
-
- private boolean initialized = false;
-
- public void setInitialize(boolean initialize) {
- this.initialize = initialize;
- }
-
- @Override
- public void destroy() throws Exception {
- if (!initialized) {
- return;
- }
- try {
- if (destroyScript != null) {
- doExecuteScript(destroyScript);
- initialized = false;
- }
- }
- catch (Exception e) {
- if (logger.isDebugEnabled()) {
- logger.warn("Could not execute destroy script [" + destroyScript + "]", e);
- }
- else {
- logger.warn("Could not execute destroy script [" + destroyScript + "]");
- }
- }
- }
-
- @Override
- public void afterPropertiesSet() throws Exception {
- Assert.notNull(dataSource, "DataSource is required");
- logger.info("Initializing with scripts: " + Arrays.asList(initScripts));
- if (!initialized && initialize) {
- try {
- doExecuteScript(destroyScript);
- }
- catch (Exception e) {
- logger.debug("Could not execute destroy script [" + destroyScript + "]", e);
- }
- if (initScripts != null) {
- for (int i = 0; i < initScripts.length; i++) {
- Resource initScript = initScripts[i];
- logger.info("Executing init script: " + initScript);
- doExecuteScript(initScript);
- }
- }
- initialized = true;
- }
- }
-
- private void doExecuteScript(final Resource scriptResource) {
- if (scriptResource == null || !scriptResource.exists())
- return;
- final JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource);
- String[] scripts;
- try {
- String[] list = StringUtils.delimitedListToStringArray(stripComments(IOUtils.readLines(scriptResource
- .getInputStream(), "UTF-8")), ";");
- scripts = list;
- }
- catch (IOException e) {
- throw new BeanInitializationException("Cannot load script from [" + scriptResource + "]", e);
- }
- for (int i = 0; i < scripts.length; i++) {
- final String script = scripts[i].trim();
- TransactionTemplate transactionTemplate = new TransactionTemplate(new DataSourceTransactionManager(
- dataSource));
- transactionTemplate.execute(new TransactionCallback() {
-
- @Override
- public Void doInTransaction(TransactionStatus status) {
- if (StringUtils.hasText(script)) {
- try {
- jdbcTemplate.execute(script);
- }
- catch (DataAccessException e) {
- if (!script.toUpperCase().startsWith("DROP")) {
- throw e;
- }
- }
- }
- return null;
- }
-
- });
- }
-
- }
-
- private String stripComments(List list) {
- StringBuilder buffer = new StringBuilder();
- for (String line : list) {
- if (!line.startsWith("//") && !line.startsWith("--")) {
- buffer.append(line).append("\n");
- }
- }
- return buffer.toString();
- }
-
- public Class getObjectType() {
- return DataSource.class;
- }
-
- public void setInitScripts(Resource[] initScripts) {
- this.initScripts = initScripts;
- }
-
- public void setDestroyScript(Resource destroyScript) {
- this.destroyScript = destroyScript;
- }
-
- public void setDataSource(DataSource dataSource) {
- this.dataSource = dataSource;
- }
-
-}
diff --git a/spring-batch-infrastructure-tests/src/test/resources/META-INF/persistence.xml b/spring-batch-infrastructure-tests/src/test/resources/META-INF/persistence.xml
deleted file mode 100644
index c5f634cbf..000000000
--- a/spring-batch-infrastructure-tests/src/test/resources/META-INF/persistence.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
- org.springframework.batch.item.sample.Foo
- true
-
-
-
-
diff --git a/spring-batch-infrastructure-tests/src/test/resources/log4j.properties b/spring-batch-infrastructure-tests/src/test/resources/log4j.properties
deleted file mode 100644
index da9add047..000000000
--- a/spring-batch-infrastructure-tests/src/test/resources/log4j.properties
+++ /dev/null
@@ -1,15 +0,0 @@
-log4j.rootCategory=INFO, stdout
-
-log4j.appender.stdout=org.apache.logging.log4j.core.appender.ConsoleAppender
-log4j.appender.stdout.layout=org.apache.logging.log4j.core.layout.PatternLayout
-log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %t %c{1}:%L - %m%n
-
-log4j.category.org.apache.activemq=ERROR
-# log4j.category.org.springframework=DEBUG
-#log4j.category.org.springframework.jdbc=DEBUG
-#log4j.category.org.springframework.jdbc.datasource=INFO
-# log4j.category.org.springframework.jms=DEBUG
-# log4j.category.org.springframework.batch=DEBUG
-#log4j.category.org.springframework.batch.support=INFO
-# log4j.category.org.springframework.retry=DEBUG
-# log4j.category.org.springframework.batch.item.database=DEBUG
diff --git a/spring-batch-infrastructure-tests/src/test/resources/org/springframework/batch/item/database/Foo.hbm.xml b/spring-batch-infrastructure-tests/src/test/resources/org/springframework/batch/item/database/Foo.hbm.xml
deleted file mode 100644
index 7f05cc9ed..000000000
--- a/spring-batch-infrastructure-tests/src/test/resources/org/springframework/batch/item/database/Foo.hbm.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
- from Foo
-
-
diff --git a/spring-batch-infrastructure-tests/src/test/resources/org/springframework/batch/item/database/JdbcPagingItemReaderCommonTests-context.xml b/spring-batch-infrastructure-tests/src/test/resources/org/springframework/batch/item/database/JdbcPagingItemReaderCommonTests-context.xml
deleted file mode 100644
index 964de7c89..000000000
--- a/spring-batch-infrastructure-tests/src/test/resources/org/springframework/batch/item/database/JdbcPagingItemReaderCommonTests-context.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
- ${batch.schema.script}
-
-
-
-
-
\ No newline at end of file
diff --git a/spring-batch-infrastructure-tests/src/test/resources/org/springframework/batch/item/database/JpaPagingItemReaderCommonTests-context.xml b/spring-batch-infrastructure-tests/src/test/resources/org/springframework/batch/item/database/JpaPagingItemReaderCommonTests-context.xml
deleted file mode 100644
index 262f3dbfe..000000000
--- a/spring-batch-infrastructure-tests/src/test/resources/org/springframework/batch/item/database/JpaPagingItemReaderCommonTests-context.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
- ${batch.schema.script}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/spring-batch-infrastructure-tests/src/test/resources/org/springframework/batch/item/database/data-source-context.xml b/spring-batch-infrastructure-tests/src/test/resources/org/springframework/batch/item/database/data-source-context.xml
deleted file mode 100644
index 38d407301..000000000
--- a/spring-batch-infrastructure-tests/src/test/resources/org/springframework/batch/item/database/data-source-context.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/spring-batch-infrastructure-tests/src/test/resources/org/springframework/batch/item/database/init-foo-schema-derby.sql b/spring-batch-infrastructure-tests/src/test/resources/org/springframework/batch/item/database/init-foo-schema-derby.sql
deleted file mode 100644
index 5f3a58fcf..000000000
--- a/spring-batch-infrastructure-tests/src/test/resources/org/springframework/batch/item/database/init-foo-schema-derby.sql
+++ /dev/null
@@ -1,25 +0,0 @@
-DROP TABLE T_FOOS;
-DROP TABLE T_WRITE_FOOS;
-
-CREATE TABLE T_FOOS (
- ID BIGINT NOT NULL,
- NAME VARCHAR(45),
- CODE VARCHAR(10),
- VALUE INTEGER
-);
-
-ALTER TABLE T_FOOS ADD PRIMARY KEY (ID);
-
-INSERT INTO t_foos (id, name, value) VALUES (1, 'bar2', 2);
-INSERT INTO t_foos (id, name, value) VALUES (2, 'bar4', 4);
-INSERT INTO t_foos (id, name, value) VALUES (3, 'bar1', 1);
-INSERT INTO t_foos (id, name, value) VALUES (4, 'bar5', 5);
-INSERT INTO t_foos (id, name, value) VALUES (5, 'bar3', 3);
-
-CREATE TABLE T_WRITE_FOOS (
- ID BIGINT NOT NULL,
- NAME VARCHAR(45),
- VALUE INTEGER
-);
-
-ALTER TABLE T_WRITE_FOOS ADD PRIMARY KEY (ID);
diff --git a/spring-batch-infrastructure-tests/src/test/resources/org/springframework/batch/item/database/init-foo-schema-hsqldb.sql b/spring-batch-infrastructure-tests/src/test/resources/org/springframework/batch/item/database/init-foo-schema-hsqldb.sql
deleted file mode 100644
index 6248723a0..000000000
--- a/spring-batch-infrastructure-tests/src/test/resources/org/springframework/batch/item/database/init-foo-schema-hsqldb.sql
+++ /dev/null
@@ -1,25 +0,0 @@
-DROP TABLE T_FOOS if exists;
-DROP TABLE T_WRITE_FOOS if exists;
-
-CREATE TABLE T_FOOS (
- ID BIGINT NOT NULL,
- NAME VARCHAR(45),
- CODE VARCHAR(10),
- VALUE INTEGER
-);
-
-ALTER TABLE T_FOOS ADD PRIMARY KEY (ID);
-
-INSERT INTO t_foos (id, name, value) VALUES (1, 'bar2', 2);
-INSERT INTO t_foos (id, name, value) VALUES (2, 'bar4', 4);
-INSERT INTO t_foos (id, name, value) VALUES (3, 'bar1', 1);
-INSERT INTO t_foos (id, name, value) VALUES (4, 'bar5', 5);
-INSERT INTO t_foos (id, name, value) VALUES (5, 'bar3', 3);
-
-CREATE TABLE T_WRITE_FOOS (
- ID BIGINT NOT NULL,
- NAME VARCHAR(45),
- VALUE INTEGER
-);
-
-ALTER TABLE T_WRITE_FOOS ADD PRIMARY KEY (ID);
diff --git a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/config/DatasourceTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/config/DatasourceTests.java
similarity index 100%
rename from spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/config/DatasourceTests.java
rename to spring-batch-infrastructure/src/test/java/org/springframework/batch/config/DatasourceTests.java
diff --git a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/config/MessagingTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/config/MessagingTests.java
similarity index 100%
rename from spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/config/MessagingTests.java
rename to spring-batch-infrastructure/src/test/java/org/springframework/batch/config/MessagingTests.java
diff --git a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/container/jms/BatchMessageListenerContainer.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/container/jms/BatchMessageListenerContainer.java
similarity index 100%
rename from spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/container/jms/BatchMessageListenerContainer.java
rename to spring-batch-infrastructure/src/test/java/org/springframework/batch/container/jms/BatchMessageListenerContainer.java
diff --git a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/container/jms/BatchMessageListenerContainerIntegrationTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/container/jms/BatchMessageListenerContainerIntegrationTests.java
similarity index 100%
rename from spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/container/jms/BatchMessageListenerContainerIntegrationTests.java
rename to spring-batch-infrastructure/src/test/java/org/springframework/batch/container/jms/BatchMessageListenerContainerIntegrationTests.java
diff --git a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/container/jms/BatchMessageListenerContainerTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/container/jms/BatchMessageListenerContainerTests.java
similarity index 100%
rename from spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/container/jms/BatchMessageListenerContainerTests.java
rename to spring-batch-infrastructure/src/test/java/org/springframework/batch/container/jms/BatchMessageListenerContainerTests.java
diff --git a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/database/JdbcPagingQueryIntegrationTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/JdbcPagingQueryIntegrationTests.java
similarity index 100%
rename from spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/database/JdbcPagingQueryIntegrationTests.java
rename to spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/JdbcPagingQueryIntegrationTests.java
diff --git a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/database/JdbcPagingRestartIntegrationTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/JdbcPagingRestartIntegrationTests.java
similarity index 100%
rename from spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/database/JdbcPagingRestartIntegrationTests.java
rename to spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/JdbcPagingRestartIntegrationTests.java
diff --git a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/database/JpaItemWriterIntegrationTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/JpaItemWriterIntegrationTests.java
similarity index 100%
rename from spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/database/JpaItemWriterIntegrationTests.java
rename to spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/JpaItemWriterIntegrationTests.java
diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/support/JpaNativeQueryProviderIntegrationTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/JpaNativeQueryProviderIntegrationTests.java
similarity index 95%
rename from spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/support/JpaNativeQueryProviderIntegrationTests.java
rename to spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/JpaNativeQueryProviderIntegrationTests.java
index 1346325f1..d3cb05184 100644
--- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/support/JpaNativeQueryProviderIntegrationTests.java
+++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/JpaNativeQueryProviderIntegrationTests.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.batch.item.database.support;
+package org.springframework.batch.item.database;
import static org.junit.Assert.assertEquals;
@@ -38,7 +38,7 @@ import org.springframework.transaction.annotation.Transactional;
* @author Dave Syer
*/
@RunWith(SpringJUnit4ClassRunner.class)
-@ContextConfiguration(locations = { "../JpaPagingItemReaderCommonTests-context.xml" })
+@ContextConfiguration(locations={"JpaPagingItemReaderCommonTests-context.xml"})
public class JpaNativeQueryProviderIntegrationTests {
@Autowired
diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/JpaPagingItemReaderNamedQueryIntegrationTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/JpaPagingItemReaderNamedQueryIntegrationTests.java
index eeb1e67f7..e033cc440 100644
--- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/JpaPagingItemReaderNamedQueryIntegrationTests.java
+++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/JpaPagingItemReaderNamedQueryIntegrationTests.java
@@ -32,7 +32,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
* @author Mahmoud Ben Hassine
*/
@RunWith(SpringJUnit4ClassRunner.class)
-@ContextConfiguration(locations={"JpaPagingItemReaderParameterTests-context.xml"})
+@ContextConfiguration(locations={"JpaPagingItemReaderCommonTests-context.xml"})
public class JpaPagingItemReaderNamedQueryIntegrationTests extends AbstractPagingItemReaderParameterTests {
@Autowired
diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/JpaPagingItemReaderNativeQueryIntegrationTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/JpaPagingItemReaderNativeQueryIntegrationTests.java
index eab7a7b14..2eb5e2e91 100644
--- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/JpaPagingItemReaderNativeQueryIntegrationTests.java
+++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/JpaPagingItemReaderNativeQueryIntegrationTests.java
@@ -18,20 +18,31 @@ package org.springframework.batch.item.database;
import java.util.Collections;
import javax.persistence.EntityManagerFactory;
+import javax.sql.DataSource;
import org.junit.runner.RunWith;
import org.springframework.batch.item.database.orm.JpaNativeQueryProvider;
import org.springframework.batch.item.sample.Foo;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder;
+import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType;
+import org.springframework.orm.jpa.JpaTransactionManager;
+import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean;
+import org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager;
+import org.springframework.orm.jpa.persistenceunit.PersistenceUnitManager;
+import org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
+import org.springframework.transaction.PlatformTransactionManager;
/**
* @author Anatoly Polinsky
* @author Dave Syer
*/
@RunWith(SpringJUnit4ClassRunner.class)
-@ContextConfiguration(locations={"JpaPagingItemReaderParameterTests-context.xml"})
+@ContextConfiguration(classes = JpaPagingItemReaderNativeQueryIntegrationTests.JpaConfiguration.class)
public class JpaPagingItemReaderNativeQueryIntegrationTests extends AbstractPagingItemReaderParameterTests {
@Autowired
@@ -59,4 +70,39 @@ public class JpaPagingItemReaderNativeQueryIntegrationTests extends AbstractPagi
return reader;
}
+
+ @Configuration
+ public static class JpaConfiguration {
+
+ @Bean
+ public DataSource dataSource() {
+ return new EmbeddedDatabaseBuilder()
+ .setType(EmbeddedDatabaseType.HSQL)
+ .addScript("org/springframework/batch/item/database/init-foo-schema-hsqldb.sql")
+ .build();
+ }
+
+ @Bean
+ public PersistenceUnitManager persistenceUnitManager() {
+ DefaultPersistenceUnitManager persistenceUnitManager = new DefaultPersistenceUnitManager();
+ persistenceUnitManager.setDefaultDataSource(dataSource());
+ persistenceUnitManager.afterPropertiesSet();
+ return persistenceUnitManager;
+ }
+
+ @Bean
+ public EntityManagerFactory entityManagerFactory() {
+ LocalContainerEntityManagerFactoryBean factoryBean = new LocalContainerEntityManagerFactoryBean();
+ factoryBean.setDataSource(dataSource());
+ factoryBean.setPersistenceUnitManager(persistenceUnitManager());
+ factoryBean.setJpaVendorAdapter(new HibernateJpaVendorAdapter());
+ factoryBean.afterPropertiesSet();
+ return factoryBean.getObject();
+ }
+
+ @Bean
+ public PlatformTransactionManager transactionManager() {
+ return new JpaTransactionManager(entityManagerFactory());
+ }
+ }
}
diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/JpaPagingItemReaderParameterTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/JpaPagingItemReaderParameterTests.java
index 8c474249e..8fdc05751 100644
--- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/JpaPagingItemReaderParameterTests.java
+++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/JpaPagingItemReaderParameterTests.java
@@ -26,7 +26,7 @@ import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@RunWith(SpringJUnit4ClassRunner.class)
-@ContextConfiguration
+@ContextConfiguration(locations = "JpaPagingItemReaderCommonTests-context.xml")
public class JpaPagingItemReaderParameterTests extends AbstractPagingItemReaderParameterTests {
@Autowired
diff --git a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/database/RepositoryItemReaderIntegrationTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/RepositoryItemReaderIntegrationTests.java
similarity index 100%
rename from spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/database/RepositoryItemReaderIntegrationTests.java
rename to spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/RepositoryItemReaderIntegrationTests.java
diff --git a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/json/GsonJsonFileItemWriterFunctionalTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/json/GsonJsonFileItemWriterFunctionalTests.java
similarity index 100%
rename from spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/json/GsonJsonFileItemWriterFunctionalTests.java
rename to spring-batch-infrastructure/src/test/java/org/springframework/batch/item/json/GsonJsonFileItemWriterFunctionalTests.java
diff --git a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/json/GsonJsonItemReaderFunctionalTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/json/GsonJsonItemReaderFunctionalTests.java
similarity index 100%
rename from spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/json/GsonJsonItemReaderFunctionalTests.java
rename to spring-batch-infrastructure/src/test/java/org/springframework/batch/item/json/GsonJsonItemReaderFunctionalTests.java
diff --git a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/json/JacksonJsonFileItemWriterFunctionalTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/json/JacksonJsonFileItemWriterFunctionalTests.java
similarity index 100%
rename from spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/json/JacksonJsonFileItemWriterFunctionalTests.java
rename to spring-batch-infrastructure/src/test/java/org/springframework/batch/item/json/JacksonJsonFileItemWriterFunctionalTests.java
diff --git a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/json/JacksonJsonItemReaderFunctionalTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/json/JacksonJsonItemReaderFunctionalTests.java
similarity index 100%
rename from spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/json/JacksonJsonItemReaderFunctionalTests.java
rename to spring-batch-infrastructure/src/test/java/org/springframework/batch/item/json/JacksonJsonItemReaderFunctionalTests.java
diff --git a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/json/JsonFileItemWriterFunctionalTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/json/JsonFileItemWriterFunctionalTests.java
similarity index 100%
rename from spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/json/JsonFileItemWriterFunctionalTests.java
rename to spring-batch-infrastructure/src/test/java/org/springframework/batch/item/json/JsonFileItemWriterFunctionalTests.java
diff --git a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/json/JsonItemReaderFunctionalTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/json/JsonItemReaderFunctionalTests.java
similarity index 100%
rename from spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/json/JsonItemReaderFunctionalTests.java
rename to spring-batch-infrastructure/src/test/java/org/springframework/batch/item/json/JsonItemReaderFunctionalTests.java
diff --git a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/json/domain/Trade.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/json/domain/Trade.java
similarity index 100%
rename from spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/json/domain/Trade.java
rename to spring-batch-infrastructure/src/test/java/org/springframework/batch/item/json/domain/Trade.java
diff --git a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/sample/Person.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/sample/Person.java
similarity index 100%
rename from spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/sample/Person.java
rename to spring-batch-infrastructure/src/test/java/org/springframework/batch/item/sample/Person.java
diff --git a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/sample/books/Author.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/sample/books/Author.java
similarity index 100%
rename from spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/sample/books/Author.java
rename to spring-batch-infrastructure/src/test/java/org/springframework/batch/item/sample/books/Author.java
diff --git a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/sample/books/Book.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/sample/books/Book.java
similarity index 100%
rename from spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/sample/books/Book.java
rename to spring-batch-infrastructure/src/test/java/org/springframework/batch/item/sample/books/Book.java
diff --git a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/sample/books/data/AuthorRepository.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/sample/books/data/AuthorRepository.java
similarity index 100%
rename from spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/sample/books/data/AuthorRepository.java
rename to spring-batch-infrastructure/src/test/java/org/springframework/batch/item/sample/books/data/AuthorRepository.java
diff --git a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/xml/AbstractStaxEventReaderItemReaderTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/xml/AbstractStaxEventReaderItemReaderTests.java
similarity index 79%
rename from spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/xml/AbstractStaxEventReaderItemReaderTests.java
rename to spring-batch-infrastructure/src/test/java/org/springframework/batch/item/xml/AbstractStaxEventReaderItemReaderTests.java
index 86f5cb0dc..37300d161 100644
--- a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/xml/AbstractStaxEventReaderItemReaderTests.java
+++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/xml/AbstractStaxEventReaderItemReaderTests.java
@@ -22,6 +22,7 @@ import java.util.ArrayList;
import java.util.List;
import org.junit.After;
+import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.springframework.batch.item.ExecutionContext;
@@ -78,22 +79,22 @@ public abstract class AbstractStaxEventReaderItemReaderTests {
assertEquals(3, results.size());
Trade trade1 = results.get(0);
- assertEquals("XYZ0001", trade1.getIsin());
- assertEquals(5, trade1.getQuantity());
- assertEquals(new BigDecimal("11.39"), trade1.getPrice());
- assertEquals("Customer1", trade1.getCustomer());
+ Assert.assertEquals("XYZ0001", trade1.getIsin());
+ Assert.assertEquals(5, trade1.getQuantity());
+ Assert.assertEquals(new BigDecimal("11.39"), trade1.getPrice());
+ Assert.assertEquals("Customer1", trade1.getCustomer());
Trade trade2 = results.get(1);
- assertEquals("XYZ0002", trade2.getIsin());
- assertEquals(2, trade2.getQuantity());
- assertEquals(new BigDecimal("72.99"), trade2.getPrice());
- assertEquals("Customer2", trade2.getCustomer());
+ Assert.assertEquals("XYZ0002", trade2.getIsin());
+ Assert.assertEquals(2, trade2.getQuantity());
+ Assert.assertEquals(new BigDecimal("72.99"), trade2.getPrice());
+ Assert.assertEquals("Customer2", trade2.getCustomer());
Trade trade3 = results.get(2);
- assertEquals("XYZ0003", trade3.getIsin());
- assertEquals(9, trade3.getQuantity());
- assertEquals(new BigDecimal("99.99"), trade3.getPrice());
- assertEquals("Customer3", trade3.getCustomer());
+ Assert.assertEquals("XYZ0003", trade3.getIsin());
+ Assert.assertEquals(9, trade3.getQuantity());
+ Assert.assertEquals(new BigDecimal("99.99"), trade3.getPrice());
+ Assert.assertEquals("Customer3", trade3.getCustomer());
}
@After
diff --git a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/xml/AbstractStaxEventWriterItemWriterTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/xml/AbstractStaxEventWriterItemWriterTests.java
similarity index 100%
rename from spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/xml/AbstractStaxEventWriterItemWriterTests.java
rename to spring-batch-infrastructure/src/test/java/org/springframework/batch/item/xml/AbstractStaxEventWriterItemWriterTests.java
diff --git a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/xml/Jaxb2MarshallingTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/xml/Jaxb2MarshallingTests.java
similarity index 100%
rename from spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/xml/Jaxb2MarshallingTests.java
rename to spring-batch-infrastructure/src/test/java/org/springframework/batch/item/xml/Jaxb2MarshallingTests.java
diff --git a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/xml/Jaxb2NamespaceMarshallingTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/xml/Jaxb2NamespaceMarshallingTests.java
similarity index 100%
rename from spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/xml/Jaxb2NamespaceMarshallingTests.java
rename to spring-batch-infrastructure/src/test/java/org/springframework/batch/item/xml/Jaxb2NamespaceMarshallingTests.java
diff --git a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/xml/Jaxb2NamespaceUnmarshallingTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/xml/Jaxb2NamespaceUnmarshallingTests.java
similarity index 78%
rename from spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/xml/Jaxb2NamespaceUnmarshallingTests.java
rename to spring-batch-infrastructure/src/test/java/org/springframework/batch/item/xml/Jaxb2NamespaceUnmarshallingTests.java
index fb6814a9f..a80c7dfb8 100644
--- a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/xml/Jaxb2NamespaceUnmarshallingTests.java
+++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/xml/Jaxb2NamespaceUnmarshallingTests.java
@@ -25,6 +25,7 @@ import java.util.List;
import javax.xml.transform.stream.StreamSource;
import org.junit.After;
+import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.springframework.batch.item.ExecutionContext;
@@ -57,10 +58,10 @@ public class Jaxb2NamespaceUnmarshallingTests {
public void testUnmarshal() throws Exception {
QualifiedTrade trade = (QualifiedTrade) getUnmarshaller().unmarshal(
new StreamSource(new StringReader(TRADE_XML)));
- assertEquals("XYZ0001", trade.getIsin());
- assertEquals(5, trade.getQuantity());
- assertEquals(new BigDecimal("11.39"), trade.getPrice());
- assertEquals("Customer1", trade.getCustomer());
+ Assert.assertEquals("XYZ0001", trade.getIsin());
+ Assert.assertEquals(5, trade.getQuantity());
+ Assert.assertEquals(new BigDecimal("11.39"), trade.getPrice());
+ Assert.assertEquals("Customer1", trade.getCustomer());
}
@Test
@@ -91,22 +92,22 @@ public class Jaxb2NamespaceUnmarshallingTests {
assertEquals(3, results.size());
QualifiedTrade trade1 = results.get(0);
- assertEquals("XYZ0001", trade1.getIsin());
- assertEquals(5, trade1.getQuantity());
- assertEquals(new BigDecimal("11.39"), trade1.getPrice());
- assertEquals("Customer1", trade1.getCustomer());
+ Assert.assertEquals("XYZ0001", trade1.getIsin());
+ Assert.assertEquals(5, trade1.getQuantity());
+ Assert.assertEquals(new BigDecimal("11.39"), trade1.getPrice());
+ Assert.assertEquals("Customer1", trade1.getCustomer());
QualifiedTrade trade2 = results.get(1);
- assertEquals("XYZ0002", trade2.getIsin());
- assertEquals(2, trade2.getQuantity());
- assertEquals(new BigDecimal("72.99"), trade2.getPrice());
- assertEquals("Customer2", trade2.getCustomer());
+ Assert.assertEquals("XYZ0002", trade2.getIsin());
+ Assert.assertEquals(2, trade2.getQuantity());
+ Assert.assertEquals(new BigDecimal("72.99"), trade2.getPrice());
+ Assert.assertEquals("Customer2", trade2.getCustomer());
QualifiedTrade trade3 = results.get(2);
- assertEquals("XYZ0003", trade3.getIsin());
- assertEquals(9, trade3.getQuantity());
- assertEquals(new BigDecimal("99.99"), trade3.getPrice());
- assertEquals("Customer3", trade3.getCustomer());
+ Assert.assertEquals("XYZ0003", trade3.getIsin());
+ Assert.assertEquals(9, trade3.getQuantity());
+ Assert.assertEquals(new BigDecimal("99.99"), trade3.getPrice());
+ Assert.assertEquals("Customer3", trade3.getCustomer());
}
@After
diff --git a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/xml/Jaxb2UnmarshallingTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/xml/Jaxb2UnmarshallingTests.java
similarity index 100%
rename from spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/xml/Jaxb2UnmarshallingTests.java
rename to spring-batch-infrastructure/src/test/java/org/springframework/batch/item/xml/Jaxb2UnmarshallingTests.java
diff --git a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/xml/XStreamMarshallingTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/xml/XStreamMarshallingTests.java
similarity index 100%
rename from spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/xml/XStreamMarshallingTests.java
rename to spring-batch-infrastructure/src/test/java/org/springframework/batch/item/xml/XStreamMarshallingTests.java
diff --git a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/xml/XStreamUnmarshallingTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/xml/XStreamUnmarshallingTests.java
similarity index 100%
rename from spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/xml/XStreamUnmarshallingTests.java
rename to spring-batch-infrastructure/src/test/java/org/springframework/batch/item/xml/XStreamUnmarshallingTests.java
diff --git a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/xml/domain/QualifiedTrade.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/xml/domain/QualifiedTrade.java
similarity index 100%
rename from spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/xml/domain/QualifiedTrade.java
rename to spring-batch-infrastructure/src/test/java/org/springframework/batch/item/xml/domain/QualifiedTrade.java
diff --git a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/xml/domain/Trade.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/xml/domain/Trade.java
similarity index 100%
rename from spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/xml/domain/Trade.java
rename to spring-batch-infrastructure/src/test/java/org/springframework/batch/item/xml/domain/Trade.java
diff --git a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/jms/ExternalRetryInBatchTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/jms/ExternalRetryInBatchTests.java
similarity index 100%
rename from spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/jms/ExternalRetryInBatchTests.java
rename to spring-batch-infrastructure/src/test/java/org/springframework/batch/jms/ExternalRetryInBatchTests.java
diff --git a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/repeat/jms/AsynchronousTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/repeat/jms/AsynchronousTests.java
similarity index 100%
rename from spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/repeat/jms/AsynchronousTests.java
rename to spring-batch-infrastructure/src/test/java/org/springframework/batch/repeat/jms/AsynchronousTests.java
diff --git a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/repeat/jms/SynchronousTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/repeat/jms/SynchronousTests.java
similarity index 98%
rename from spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/repeat/jms/SynchronousTests.java
rename to spring-batch-infrastructure/src/test/java/org/springframework/batch/repeat/jms/SynchronousTests.java
index 77320e779..2cbb470d9 100644
--- a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/repeat/jms/SynchronousTests.java
+++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/repeat/jms/SynchronousTests.java
@@ -169,7 +169,7 @@ public class SynchronousTests implements ApplicationContextAware {
@Transactional
@Test
- public void testPartialRollback() throws Exception {
+ public void JpaNativeQueryProviderIntegrationTeststestPartialRollback() throws Exception {
// The JmsTemplate is used elsewhere outside a transaction, so
// we need to use one here that is transaction aware.
diff --git a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/repeat/support/TaskExecutorRepeatTemplateBulkAsynchronousTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/repeat/support/TaskExecutorRepeatTemplateBulkAsynchronousTests.java
similarity index 100%
rename from spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/repeat/support/TaskExecutorRepeatTemplateBulkAsynchronousTests.java
rename to spring-batch-infrastructure/src/test/java/org/springframework/batch/repeat/support/TaskExecutorRepeatTemplateBulkAsynchronousTests.java
diff --git a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/retry/jms/ExternalRetryTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/retry/jms/ExternalRetryTests.java
similarity index 100%
rename from spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/retry/jms/ExternalRetryTests.java
rename to spring-batch-infrastructure/src/test/java/org/springframework/batch/retry/jms/ExternalRetryTests.java
diff --git a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/retry/jms/SynchronousTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/retry/jms/SynchronousTests.java
similarity index 100%
rename from spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/retry/jms/SynchronousTests.java
rename to spring-batch-infrastructure/src/test/java/org/springframework/batch/retry/jms/SynchronousTests.java
diff --git a/spring-batch-infrastructure-tests/src/test/resources/batch-derby.properties b/spring-batch-infrastructure/src/test/resources/batch-derby.properties
similarity index 100%
rename from spring-batch-infrastructure-tests/src/test/resources/batch-derby.properties
rename to spring-batch-infrastructure/src/test/resources/batch-derby.properties
diff --git a/spring-batch-infrastructure-tests/src/test/resources/batch-hsql.properties b/spring-batch-infrastructure/src/test/resources/batch-hsql.properties
similarity index 100%
rename from spring-batch-infrastructure-tests/src/test/resources/batch-hsql.properties
rename to spring-batch-infrastructure/src/test/resources/batch-hsql.properties
diff --git a/spring-batch-infrastructure-tests/src/test/resources/batch-oracle.properties b/spring-batch-infrastructure/src/test/resources/batch-oracle.properties
similarity index 97%
rename from spring-batch-infrastructure-tests/src/test/resources/batch-oracle.properties
rename to spring-batch-infrastructure/src/test/resources/batch-oracle.properties
index 74c3d8b78..f275145d3 100644
--- a/spring-batch-infrastructure-tests/src/test/resources/batch-oracle.properties
+++ b/spring-batch-infrastructure/src/test/resources/batch-oracle.properties
@@ -1,14 +1,14 @@
-# Placeholders batch.*
-# for Oracle:
-batch.jdbc.driver=oracle.jdbc.OracleDriver
-batch.jdbc.url=jdbc:oracle:thin:@oracle:1521:xe
-batch.jdbc.user=spring
-batch.jdbc.password=spring
-batch.jdbc.testWhileIdle=false
-batch.jdbc.validationQuery=
-batch.schema.script=classpath:org/springframework/batch/item/database/init-foo-schema-oracle.sql
-batch.business.schema.script=classpath:/org/springframework/batch/jms/init.sql
-batch.data.source.init=true
-batch.database.incrementer.class=org.springframework.jdbc.support.incrementer.OracleSequenceMaxValueIncrementer
-batch.database.incrementer.parent=sequenceIncrementerParent
-batch.verify.cursor.position=true
+# Placeholders batch.*
+# for Oracle:
+batch.jdbc.driver=oracle.jdbc.OracleDriver
+batch.jdbc.url=jdbc:oracle:thin:@oracle:1521:xe
+batch.jdbc.user=spring
+batch.jdbc.password=spring
+batch.jdbc.testWhileIdle=false
+batch.jdbc.validationQuery=
+batch.schema.script=classpath:org/springframework/batch/item/database/init-foo-schema-oracle.sql
+batch.business.schema.script=classpath:/org/springframework/batch/jms/init.sql
+batch.data.source.init=true
+batch.database.incrementer.class=org.springframework.jdbc.support.incrementer.OracleSequenceMaxValueIncrementer
+batch.database.incrementer.parent=sequenceIncrementerParent
+batch.verify.cursor.position=true
diff --git a/spring-batch-infrastructure-tests/src/test/resources/batch-postgres.properties b/spring-batch-infrastructure/src/test/resources/batch-postgres.properties
similarity index 97%
rename from spring-batch-infrastructure-tests/src/test/resources/batch-postgres.properties
rename to spring-batch-infrastructure/src/test/resources/batch-postgres.properties
index fa15935f5..fc4eb9f70 100644
--- a/spring-batch-infrastructure-tests/src/test/resources/batch-postgres.properties
+++ b/spring-batch-infrastructure/src/test/resources/batch-postgres.properties
@@ -1,14 +1,14 @@
-# Placeholders batch.*
-# for Oracle:
-batch.jdbc.driver=org.postgresql.Driver
-batch.jdbc.url=jdbc:postgresql://localhost:9432/test
-batch.jdbc.user=test
-batch.jdbc.password=test
-batch.jdbc.testWhileIdle=false
-batch.jdbc.validationQuery=
-batch.schema.script=classpath:org/springframework/batch/item/database/init-foo-schema-postgres.sql
-batch.business.schema.script=classpath:/org/springframework/batch/jms/init.sql
-batch.data.source.init=true
-batch.database.incrementer.class=org.springframework.jdbc.support.incrementer.PostgresSequenceMaxValueIncrementer
-batch.database.incrementer.parent=sequenceIncrementerParent
-batch.verify.cursor.position=true
+# Placeholders batch.*
+# for Oracle:
+batch.jdbc.driver=org.postgresql.Driver
+batch.jdbc.url=jdbc:postgresql://localhost:9432/test
+batch.jdbc.user=test
+batch.jdbc.password=test
+batch.jdbc.testWhileIdle=false
+batch.jdbc.validationQuery=
+batch.schema.script=classpath:org/springframework/batch/item/database/init-foo-schema-postgres.sql
+batch.business.schema.script=classpath:/org/springframework/batch/jms/init.sql
+batch.data.source.init=true
+batch.database.incrementer.class=org.springframework.jdbc.support.incrementer.PostgresSequenceMaxValueIncrementer
+batch.database.incrementer.parent=sequenceIncrementerParent
+batch.verify.cursor.position=true
diff --git a/spring-batch-infrastructure-tests/src/test/resources/data-source-context.xml b/spring-batch-infrastructure/src/test/resources/data-source-context.xml
similarity index 97%
rename from spring-batch-infrastructure-tests/src/test/resources/data-source-context.xml
rename to spring-batch-infrastructure/src/test/resources/data-source-context.xml
index d7faa1953..7f47507c6 100644
--- a/spring-batch-infrastructure-tests/src/test/resources/data-source-context.xml
+++ b/spring-batch-infrastructure/src/test/resources/data-source-context.xml
@@ -5,7 +5,6 @@
-
${batch.business.schema.script}
diff --git a/spring-batch-infrastructure/src/test/resources/org/springframework/batch/item/database/Foo.hbm.xml b/spring-batch-infrastructure/src/test/resources/org/springframework/batch/item/database/Foo.hbm.xml
index b3287cfea..c2c87745c 100644
--- a/spring-batch-infrastructure/src/test/resources/org/springframework/batch/item/database/Foo.hbm.xml
+++ b/spring-batch-infrastructure/src/test/resources/org/springframework/batch/item/database/Foo.hbm.xml
@@ -15,7 +15,6 @@
from Foo
-
from Foo where value >= 2
diff --git a/spring-batch-infrastructure/src/test/resources/org/springframework/batch/item/database/JdbcPagingItemReaderCommonTests-context.xml b/spring-batch-infrastructure/src/test/resources/org/springframework/batch/item/database/JdbcPagingItemReaderCommonTests-context.xml
index 9749efef0..e1efe4b16 100644
--- a/spring-batch-infrastructure/src/test/resources/org/springframework/batch/item/database/JdbcPagingItemReaderCommonTests-context.xml
+++ b/spring-batch-infrastructure/src/test/resources/org/springframework/batch/item/database/JdbcPagingItemReaderCommonTests-context.xml
@@ -17,7 +17,7 @@
-
diff --git a/spring-batch-infrastructure/src/test/resources/org/springframework/batch/item/database/JpaPagingItemReaderParameterTests-context.xml b/spring-batch-infrastructure/src/test/resources/org/springframework/batch/item/database/JpaPagingItemReaderParameterTests-context.xml
deleted file mode 100644
index 1c08d9f66..000000000
--- a/spring-batch-infrastructure/src/test/resources/org/springframework/batch/item/database/JpaPagingItemReaderParameterTests-context.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/spring-batch-infrastructure-tests/src/test/resources/org/springframework/batch/item/database/RepositoryItemReaderCommonTests-context.xml b/spring-batch-infrastructure/src/test/resources/org/springframework/batch/item/database/RepositoryItemReaderCommonTests-context.xml
similarity index 98%
rename from spring-batch-infrastructure-tests/src/test/resources/org/springframework/batch/item/database/RepositoryItemReaderCommonTests-context.xml
rename to spring-batch-infrastructure/src/test/resources/org/springframework/batch/item/database/RepositoryItemReaderCommonTests-context.xml
index 1ae30705d..920aee8e2 100644
--- a/spring-batch-infrastructure-tests/src/test/resources/org/springframework/batch/item/database/RepositoryItemReaderCommonTests-context.xml
+++ b/spring-batch-infrastructure/src/test/resources/org/springframework/batch/item/database/RepositoryItemReaderCommonTests-context.xml
@@ -14,7 +14,6 @@
-
classpath:org/springframework/batch/item/database/init-books-schema.sql
diff --git a/spring-batch-infrastructure-tests/src/test/resources/org/springframework/batch/item/database/init-books-schema.sql b/spring-batch-infrastructure/src/test/resources/org/springframework/batch/item/database/init-books-schema.sql
similarity index 100%
rename from spring-batch-infrastructure-tests/src/test/resources/org/springframework/batch/item/database/init-books-schema.sql
rename to spring-batch-infrastructure/src/test/resources/org/springframework/batch/item/database/init-books-schema.sql
diff --git a/spring-batch-infrastructure/src/test/resources/org/springframework/batch/item/database/init-foo-schema-hsqldb.sql b/spring-batch-infrastructure/src/test/resources/org/springframework/batch/item/database/init-foo-schema-hsqldb.sql
index 9fff8df46..c55870e45 100644
--- a/spring-batch-infrastructure/src/test/resources/org/springframework/batch/item/database/init-foo-schema-hsqldb.sql
+++ b/spring-batch-infrastructure/src/test/resources/org/springframework/batch/item/database/init-foo-schema-hsqldb.sql
@@ -4,6 +4,7 @@ DROP TABLE T_WRITE_FOOS if exists;
CREATE TABLE T_FOOS (
ID BIGINT NOT NULL,
NAME VARCHAR(45),
+ CODE VARCHAR(10),
VALUE INTEGER
);
diff --git a/spring-batch-infrastructure-tests/src/test/resources/org/springframework/batch/item/database/init-foo-schema-oracle.sql b/spring-batch-infrastructure/src/test/resources/org/springframework/batch/item/database/init-foo-schema-oracle.sql
similarity index 100%
rename from spring-batch-infrastructure-tests/src/test/resources/org/springframework/batch/item/database/init-foo-schema-oracle.sql
rename to spring-batch-infrastructure/src/test/resources/org/springframework/batch/item/database/init-foo-schema-oracle.sql
diff --git a/spring-batch-infrastructure-tests/src/test/resources/org/springframework/batch/item/database/init-foo-schema-postgres.sql b/spring-batch-infrastructure/src/test/resources/org/springframework/batch/item/database/init-foo-schema-postgres.sql
similarity index 100%
rename from spring-batch-infrastructure-tests/src/test/resources/org/springframework/batch/item/database/init-foo-schema-postgres.sql
rename to spring-batch-infrastructure/src/test/resources/org/springframework/batch/item/database/init-foo-schema-postgres.sql
diff --git a/spring-batch-infrastructure-tests/src/test/resources/org/springframework/batch/item/json/empty-trades.json b/spring-batch-infrastructure/src/test/resources/org/springframework/batch/item/json/empty-trades.json
similarity index 100%
rename from spring-batch-infrastructure-tests/src/test/resources/org/springframework/batch/item/json/empty-trades.json
rename to spring-batch-infrastructure/src/test/resources/org/springframework/batch/item/json/empty-trades.json
diff --git a/spring-batch-infrastructure-tests/src/test/resources/org/springframework/batch/item/json/expected-trades-gson-pretty-print.json b/spring-batch-infrastructure/src/test/resources/org/springframework/batch/item/json/expected-trades-gson-pretty-print.json
similarity index 100%
rename from spring-batch-infrastructure-tests/src/test/resources/org/springframework/batch/item/json/expected-trades-gson-pretty-print.json
rename to spring-batch-infrastructure/src/test/resources/org/springframework/batch/item/json/expected-trades-gson-pretty-print.json
diff --git a/spring-batch-infrastructure-tests/src/test/resources/org/springframework/batch/item/json/expected-trades-jackson-pretty-print.json b/spring-batch-infrastructure/src/test/resources/org/springframework/batch/item/json/expected-trades-jackson-pretty-print.json
similarity index 100%
rename from spring-batch-infrastructure-tests/src/test/resources/org/springframework/batch/item/json/expected-trades-jackson-pretty-print.json
rename to spring-batch-infrastructure/src/test/resources/org/springframework/batch/item/json/expected-trades-jackson-pretty-print.json
diff --git a/spring-batch-infrastructure-tests/src/test/resources/org/springframework/batch/item/json/expected-trades-with-multiple-writes.json b/spring-batch-infrastructure/src/test/resources/org/springframework/batch/item/json/expected-trades-with-multiple-writes.json
similarity index 100%
rename from spring-batch-infrastructure-tests/src/test/resources/org/springframework/batch/item/json/expected-trades-with-multiple-writes.json
rename to spring-batch-infrastructure/src/test/resources/org/springframework/batch/item/json/expected-trades-with-multiple-writes.json
diff --git a/spring-batch-infrastructure-tests/src/test/resources/org/springframework/batch/item/json/expected-trades-with-wrapper-object.json b/spring-batch-infrastructure/src/test/resources/org/springframework/batch/item/json/expected-trades-with-wrapper-object.json
similarity index 100%
rename from spring-batch-infrastructure-tests/src/test/resources/org/springframework/batch/item/json/expected-trades-with-wrapper-object.json
rename to spring-batch-infrastructure/src/test/resources/org/springframework/batch/item/json/expected-trades-with-wrapper-object.json
diff --git a/spring-batch-infrastructure-tests/src/test/resources/org/springframework/batch/item/json/expected-trades.json b/spring-batch-infrastructure/src/test/resources/org/springframework/batch/item/json/expected-trades.json
similarity index 100%
rename from spring-batch-infrastructure-tests/src/test/resources/org/springframework/batch/item/json/expected-trades.json
rename to spring-batch-infrastructure/src/test/resources/org/springframework/batch/item/json/expected-trades.json
diff --git a/spring-batch-infrastructure-tests/src/test/resources/org/springframework/batch/item/json/expected-trades1.json b/spring-batch-infrastructure/src/test/resources/org/springframework/batch/item/json/expected-trades1.json
similarity index 100%
rename from spring-batch-infrastructure-tests/src/test/resources/org/springframework/batch/item/json/expected-trades1.json
rename to spring-batch-infrastructure/src/test/resources/org/springframework/batch/item/json/expected-trades1.json
diff --git a/spring-batch-infrastructure-tests/src/test/resources/org/springframework/batch/item/json/expected-trades2.json b/spring-batch-infrastructure/src/test/resources/org/springframework/batch/item/json/expected-trades2.json
similarity index 100%
rename from spring-batch-infrastructure-tests/src/test/resources/org/springframework/batch/item/json/expected-trades2.json
rename to spring-batch-infrastructure/src/test/resources/org/springframework/batch/item/json/expected-trades2.json
diff --git a/spring-batch-infrastructure-tests/src/test/resources/org/springframework/batch/item/json/trades.json b/spring-batch-infrastructure/src/test/resources/org/springframework/batch/item/json/trades.json
similarity index 100%
rename from spring-batch-infrastructure-tests/src/test/resources/org/springframework/batch/item/json/trades.json
rename to spring-batch-infrastructure/src/test/resources/org/springframework/batch/item/json/trades.json
diff --git a/spring-batch-infrastructure-tests/src/test/resources/org/springframework/batch/item/xml/domain/trade.xsd b/spring-batch-infrastructure/src/test/resources/org/springframework/batch/item/xml/domain/trade.xsd
similarity index 100%
rename from spring-batch-infrastructure-tests/src/test/resources/org/springframework/batch/item/xml/domain/trade.xsd
rename to spring-batch-infrastructure/src/test/resources/org/springframework/batch/item/xml/domain/trade.xsd
diff --git a/spring-batch-infrastructure-tests/src/test/resources/org/springframework/batch/item/xml/domain/trades.xml b/spring-batch-infrastructure/src/test/resources/org/springframework/batch/item/xml/domain/trades.xml
similarity index 100%
rename from spring-batch-infrastructure-tests/src/test/resources/org/springframework/batch/item/xml/domain/trades.xml
rename to spring-batch-infrastructure/src/test/resources/org/springframework/batch/item/xml/domain/trades.xml
diff --git a/spring-batch-infrastructure-tests/src/test/resources/org/springframework/batch/item/xml/expected-output.xml b/spring-batch-infrastructure/src/test/resources/org/springframework/batch/item/xml/expected-output.xml
similarity index 100%
rename from spring-batch-infrastructure-tests/src/test/resources/org/springframework/batch/item/xml/expected-output.xml
rename to spring-batch-infrastructure/src/test/resources/org/springframework/batch/item/xml/expected-output.xml
diff --git a/spring-batch-infrastructure-tests/src/test/resources/org/springframework/batch/item/xml/expected-qualified-output.xml b/spring-batch-infrastructure/src/test/resources/org/springframework/batch/item/xml/expected-qualified-output.xml
similarity index 100%
rename from spring-batch-infrastructure-tests/src/test/resources/org/springframework/batch/item/xml/expected-qualified-output.xml
rename to spring-batch-infrastructure/src/test/resources/org/springframework/batch/item/xml/expected-qualified-output.xml
diff --git a/spring-batch-infrastructure-tests/src/test/resources/org/springframework/batch/item/xml/input-nested.xml b/spring-batch-infrastructure/src/test/resources/org/springframework/batch/item/xml/input-nested.xml
similarity index 100%
rename from spring-batch-infrastructure-tests/src/test/resources/org/springframework/batch/item/xml/input-nested.xml
rename to spring-batch-infrastructure/src/test/resources/org/springframework/batch/item/xml/input-nested.xml
diff --git a/spring-batch-infrastructure-tests/src/test/resources/org/springframework/batch/item/xml/input.xml b/spring-batch-infrastructure/src/test/resources/org/springframework/batch/item/xml/input.xml
similarity index 100%
rename from spring-batch-infrastructure-tests/src/test/resources/org/springframework/batch/item/xml/input.xml
rename to spring-batch-infrastructure/src/test/resources/org/springframework/batch/item/xml/input.xml
diff --git a/spring-batch-infrastructure-tests/src/test/resources/org/springframework/batch/item/xml/mapping-castor.xml b/spring-batch-infrastructure/src/test/resources/org/springframework/batch/item/xml/mapping-castor.xml
similarity index 100%
rename from spring-batch-infrastructure-tests/src/test/resources/org/springframework/batch/item/xml/mapping-castor.xml
rename to spring-batch-infrastructure/src/test/resources/org/springframework/batch/item/xml/mapping-castor.xml
diff --git a/spring-batch-infrastructure-tests/src/test/resources/org/springframework/batch/jms/destroy.sql b/spring-batch-infrastructure/src/test/resources/org/springframework/batch/jms/destroy.sql
similarity index 100%
rename from spring-batch-infrastructure-tests/src/test/resources/org/springframework/batch/jms/destroy.sql
rename to spring-batch-infrastructure/src/test/resources/org/springframework/batch/jms/destroy.sql
diff --git a/spring-batch-infrastructure-tests/src/test/resources/org/springframework/batch/jms/init.sql b/spring-batch-infrastructure/src/test/resources/org/springframework/batch/jms/init.sql
similarity index 100%
rename from spring-batch-infrastructure-tests/src/test/resources/org/springframework/batch/jms/init.sql
rename to spring-batch-infrastructure/src/test/resources/org/springframework/batch/jms/init.sql
diff --git a/spring-batch-infrastructure-tests/src/test/resources/org/springframework/batch/jms/jms-context.xml b/spring-batch-infrastructure/src/test/resources/org/springframework/batch/jms/jms-context.xml
similarity index 100%
rename from spring-batch-infrastructure-tests/src/test/resources/org/springframework/batch/jms/jms-context.xml
rename to spring-batch-infrastructure/src/test/resources/org/springframework/batch/jms/jms-context.xml