Replaced snapshot versions and addressed deprications

This commit moves all SNAPSHOT dependencies to the latest available
released versions.  It also addresses a number of deprications in the
Spring Data realm.  Specifically around the deprication of the
Neo4JOperations and the package reorganization within Hibernate.
This commit is contained in:
Michael Minella
2016-12-30 14:04:58 -06:00
parent e8a59846aa
commit 26b02fb836
21 changed files with 360 additions and 83 deletions

View File

@@ -15,17 +15,14 @@
*/
package org.springframework.batch.core.resource;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import java.util.ArrayList;
import java.util.List;
import javax.sql.DataSource;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.batch.item.ExecutionContext;
import org.springframework.batch.item.database.JdbcCursorItemReader;
import org.springframework.batch.item.database.support.ListPreparedStatementSetter;
@@ -34,6 +31,9 @@ import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.transaction.annotation.Transactional;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = "/org/springframework/batch/core/repository/dao/data-source-context.xml")
public class JdbcCursorItemReaderPreparedStatementIntegrationTests {
@@ -50,7 +50,7 @@ public class JdbcCursorItemReaderPreparedStatementIntegrationTests {
@Before
public void onSetUpInTransaction() throws Exception {
itemReader = new JdbcCursorItemReader<Foo>();
itemReader = new JdbcCursorItemReader<>();
itemReader.setDataSource(dataSource);
itemReader.setSql("select ID, NAME, VALUE from T_FOOS where ID > ? and ID < ?");
itemReader.setIgnoreWarnings(true);
@@ -61,12 +61,11 @@ public class JdbcCursorItemReaderPreparedStatementIntegrationTests {
itemReader.setMaxRows(100);
itemReader.setQueryTimeout(1000);
itemReader.setSaveState(true);
ListPreparedStatementSetter pss = new ListPreparedStatementSetter();
List<Long> parameters = new ArrayList<Long>();
List<Long> parameters = new ArrayList<>();
parameters.add(1L);
parameters.add(4L);
pss.setParameters(parameters);
ListPreparedStatementSetter pss = new ListPreparedStatementSetter(parameters);
itemReader.setPreparedStatementSetter(pss);
}

View File

@@ -75,11 +75,10 @@ public class ListPreparedStatementSetterTests {
@Before
public void onSetUpInTransaction() throws Exception {
pss = new ListPreparedStatementSetter();
List<Long> parameters = new ArrayList<Long>();
parameters.add(1L);
parameters.add(4L);
pss.setParameters(parameters);
pss = new ListPreparedStatementSetter(parameters);
}
@Transactional
@@ -103,7 +102,7 @@ public class ListPreparedStatementSetterTests {
@Transactional
@Test(expected = IllegalArgumentException.class)
public void testAfterPropertiesSet() throws Exception {
pss.setParameters(null);
pss = new ListPreparedStatementSetter(null);
pss.afterPropertiesSet();
}
@@ -133,7 +132,7 @@ public class ListPreparedStatementSetterTests {
}
public static class FooStoringItemWriter implements ItemWriter<Foo> {
private List<Foo> foos = new ArrayList<Foo>();
private List<Foo> foos = new ArrayList<>();
@Override
public void write(List<? extends Foo> items) throws Exception {