diff --git a/build.gradle b/build.gradle
index a69089a9e..b6d02d40f 100644
--- a/build.gradle
+++ b/build.gradle
@@ -39,6 +39,7 @@ allprojects {
maven { url 'https://repo.spring.io/plugins-release' }
maven { url "https://repo.spring.io/libs-snapshot" }
+ maven { url 'https://m2.neo4j.org/content/repositories/snapshots' }
maven { url 'https://m2.neo4j.org/content/repositories/releases'}
mavenCentral()
}
@@ -55,8 +56,7 @@ allprojects {
springDataGemfireVersion = '2.0.0.BUILD-SNAPSHOT'
springDataJpaVersion = '2.0.0.BUILD-SNAPSHOT'
springDataMongodbVersion = '2.0.0.BUILD-SNAPSHOT'
- springDataNeo4jVersion = '3.4.5.RELEASE'
- springDataNeo4j4Version = '5.0.0.BUILD-SNAPSHOT' //?
+ springDataNeo4jVersion = '5.0.0.BUILD-SNAPSHOT'
springIntegrationVersion = '5.0.0.BUILD-SNAPSHOT'
springLdapVersion = '2.0.4.RELEASE'
@@ -84,7 +84,7 @@ allprojects {
javaxTransactionVersion = '1.2'
jbatchTckSpi = '1.0'
jettisonVersion = '1.2'
- jmsVersion = '1.1-rev-1'
+ jmsVersion = '2.0.1'
jtdsVersion = '1.3.1' //?
junitVersion = '4.12'
log4jVersion = '1.2.17'
@@ -333,7 +333,7 @@ project('spring-batch-infrastructure') {
testRuntime "org.beanshell:bsh:$beanshellVersion"
- optional "javax.jms:jms-api:$jmsVersion"
+ optional "javax.jms:javax.jms-api:$jmsVersion"
optional "org.slf4j:slf4j-log4j12:$slf4jVersion"
optional "org.codehaus.jackson:jackson-mapper-asl:$jacksonVersion"
compile("org.hibernate:hibernate-core:$hibernateVersion") { dep ->
@@ -392,43 +392,6 @@ project('spring-batch-infrastructure') {
}
}
-project('spring-batch-infrastructure-neo4j4') {
-
- merge.into = project(':spring-batch-infrastructure')
-
- dependencies {
- optional ("org.springframework.data:spring-data-neo4j:$springDataNeo4j4Version") {
- exclude group: 'org.springframework', module: 'spring-core'
- exclude group: 'org.springframework', module: 'spring-aspects'
- exclude group: 'org.springframework', module: 'spring-web'
- exclude group: 'org.springframework', module: 'spring-context'
- exclude group: 'org.springframework', module: 'spring-tx'
- exclude group: 'org.springframework', module: 'spring-beans'
- exclude group: 'org.springframework', module: 'spring-aop'
- exclude group: 'org.springframework', module: 'spring-expression'
- }
- optional "org.springframework:spring-core:$springVersion"
- optional "org.springframework:spring-context:$springVersion"
- optional "org.springframework:spring-aspects:$springVersion"
- optional "org.springframework:spring-web:$springVersion"
- optional "org.springframework:spring-tx:$springVersion"
- optional "org.springframework:spring-beans:$springVersion"
- optional "org.springframework:spring-aop:$springVersion"
- optional "org.springframework:spring-expression:$springVersion"
- testCompile "org.mockito:mockito-core:$mockitoVersion"
- testCompile "junit:junit:${junitVersion}"
- }
-
- if (project.hasProperty('platformVersion')) {
- def dataNeo4jVersion = dependencyManagement.springIoTestRuntime.managedVersions['org.springframework.data:spring-data-neo4j']
- if (dataNeo4jVersion?.startsWith('3.')) {
- tasks.withType(Test).matching { it.name =~ "springIoJdk.Test" }.all {
- enabled false
- }
- }
- }
-}
-
project('spring-batch-core-tests') {
description = 'Spring Batch Core Tests'
project.tasks.findByPath("artifactoryPublish")?.enabled = false
@@ -470,7 +433,7 @@ project('spring-batch-infrastructure-tests') {
project.tasks.findByPath("artifactoryPublish")?.enabled = false
dependencies {
compile project(":spring-batch-infrastructure")
- compile "javax.jms:jms-api:1.1-rev-1"
+ compile "javax.jms:javax.jms-api:$jmsVersion"
compile "commons-dbcp:commons-dbcp:$commonsDdbcpVersion"
compile "org.springframework:spring-tx:$springVersion"
compile "org.springframework:spring-aop:$springVersion"
@@ -580,7 +543,7 @@ project('spring-batch-integration') {
}
testCompile "org.springframework.integration:spring-integration-jdbc:$springIntegrationVersion"
- optional "javax.jms:jms-api:$jmsVersion"
+ optional "javax.jms:javax.jms-api:$jmsVersion"
optional "org.slf4j:slf4j-log4j12:$slf4jVersion"
optional "log4j:log4j:$log4jVersion"
optional "org.springframework.integration:spring-integration-jms:$springIntegrationVersion"
diff --git a/settings.gradle b/settings.gradle
index 927693315..6ff4908be 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -3,7 +3,6 @@ rootProject.name = 'spring-batch'
include 'spring-batch-core'
include 'spring-batch-core-tests'
include 'spring-batch-infrastructure'
-include 'spring-batch-infrastructure-neo4j4'
include 'spring-batch-infrastructure-tests'
include 'spring-batch-test'
include 'spring-batch-integration'
diff --git a/spring-batch-infrastructure-neo4j4/src/main/java/org/springframework/batch/item/data/Neo4j4ItemReader.java b/spring-batch-infrastructure-neo4j4/src/main/java/org/springframework/batch/item/data/Neo4j4ItemReader.java
deleted file mode 100644
index 0805bdb02..000000000
--- a/spring-batch-infrastructure-neo4j4/src/main/java/org/springframework/batch/item/data/Neo4j4ItemReader.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright 2016 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
- *
- * http://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.data;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-
-/**
- *
- * Extensions of the {@link AbstractNeo4jItemReader} intended for use with versions of
- * Spring Data Neo4J > 4. Conversions of the results are done using logic based on the
- * target type.
- *
- *
- * @author Michael Minella
- * @author Vince Bickers
- * @since 3.0.7
- */
-public class Neo4j4ItemReader extends AbstractNeo4jItemReader {
-
- @Override
- protected Iterator doPageRead() {
- Iterable queryResults = getTemplate().queryForObjects(
- getTargetType(), generateLimitCypherQuery(), getParameterValues());
-
- if(queryResults != null) {
- return queryResults.iterator();
- }
- else {
- return new ArrayList().iterator();
- }
- }
-}
diff --git a/spring-batch-infrastructure-neo4j4/src/test/java/org/springframework/batch/item/data/Neo4j4ItemReaderTests.java b/spring-batch-infrastructure-neo4j4/src/test/java/org/springframework/batch/item/data/Neo4j4ItemReaderTests.java
deleted file mode 100644
index 917f0a494..000000000
--- a/spring-batch-infrastructure-neo4j4/src/test/java/org/springframework/batch/item/data/Neo4j4ItemReaderTests.java
+++ /dev/null
@@ -1,175 +0,0 @@
-/*
- * Copyright 2013-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
- *
- * http://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.data;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.ArgumentCaptor;
-import org.mockito.Mock;
-import org.mockito.MockitoAnnotations;
-
-import org.springframework.data.neo4j.template.Neo4jOperations;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-import static org.mockito.Matchers.eq;
-import static org.mockito.Matchers.isNull;
-import static org.mockito.Mockito.when;
-
-public class Neo4j4ItemReaderTests {
-
- private Neo4j4ItemReader reader;
- @Mock
- private Neo4jOperations template;
- @Mock
- private Iterable result;
-
- @Before
- public void setUp() throws Exception {
- reader = new Neo4j4ItemReader();
-
- MockitoAnnotations.initMocks(this);
-
- reader.setTemplate(template);
- reader.setTargetType(String.class);
- reader.setStartStatement("n=node(*)");
- reader.setReturnStatement("*");
- reader.setOrderByStatement("n.age");
- reader.setPageSize(50);
- reader.afterPropertiesSet();
- }
-
- @Test
- public void testAfterPropertiesSet() throws Exception {
- reader = new Neo4j4ItemReader();
-
- try {
- reader.afterPropertiesSet();
- fail("Template was not set but exception was not thrown.");
- } catch (IllegalStateException iae) {
- assertEquals("A Neo4JOperations implementation is required", iae.getMessage());
- } catch (Throwable t) {
- fail("Wrong exception was thrown:" + t);
- }
-
- reader.setTemplate(template);
-
- try {
- reader.afterPropertiesSet();
- fail("type was not set but exception was not thrown.");
- } catch (IllegalStateException iae) {
- assertEquals("The type to be returned is required", iae.getMessage());
- } catch (Throwable t) {
- fail("Wrong exception was thrown:" + t);
- }
-
- reader.setTargetType(String.class);
-
- try {
- reader.afterPropertiesSet();
- fail("START was not set but exception was not thrown.");
- } catch (IllegalStateException iae) {
- assertEquals("A START statement is required", iae.getMessage());
- } catch (Throwable t) {
- fail("Wrong exception was thrown:" + t);
- }
-
- reader.setStartStatement("n=node(*)");
-
- try {
- reader.afterPropertiesSet();
- fail("RETURN was not set but exception was not thrown.");
- } catch (IllegalStateException iae) {
- assertEquals("A RETURN statement is required", iae.getMessage());
- } catch (Throwable t) {
- fail("Wrong exception was thrown:" + t);
- }
-
- reader.setReturnStatement("n.name, n.phone");
-
- try {
- reader.afterPropertiesSet();
- fail("ORDER BY was not set but exception was not thrown.");
- } catch (IllegalStateException iae) {
- assertEquals("A ORDER BY statement is required", iae.getMessage());
- } catch (Throwable t) {
- fail("Wrong exception was thrown:" + t);
- }
-
- reader.setOrderByStatement("n.age");
-
- reader.afterPropertiesSet();
- }
-
- @SuppressWarnings("unchecked")
- @Test
- public void testNullResults() {
- ArgumentCaptor query = ArgumentCaptor.forClass(String.class);
-
- when(template.queryForObjects(eq(String.class), query.capture(), (Map) isNull())).thenReturn(null);
-
- assertFalse(reader.doPageRead().hasNext());
- assertEquals("START n=node(*) RETURN * ORDER BY n.age SKIP 0 LIMIT 50", query.getValue());
- }
-
- @SuppressWarnings("unchecked")
- @Test
- public void testNoResults() {
- ArgumentCaptor query = ArgumentCaptor.forClass(String.class);
-
- when(template.queryForObjects(eq(String.class), query.capture(), (Map) isNull())).thenReturn(result);
- when(result.iterator()).thenReturn(Collections.emptyIterator());
-
- assertFalse(reader.doPageRead().hasNext());
- assertEquals("START n=node(*) RETURN * ORDER BY n.age SKIP 0 LIMIT 50", query.getValue());
- }
-
- @SuppressWarnings("serial")
- @Test
- public void testResultsWithMatchAndWhere() throws Exception {
- reader.setMatchStatement("n -- m");
- reader.setWhereStatement("has(n.name)");
- reader.setReturnStatement("m");
- reader.afterPropertiesSet();
- when(template.queryForObjects(String.class, "START n=node(*) MATCH n -- m WHERE has(n.name) RETURN m ORDER BY n.age SKIP 0 LIMIT 50", null)).thenReturn(result);
- when(result.iterator()).thenReturn(Arrays.asList("foo", "bar", "baz").iterator());
-
- assertTrue(reader.doPageRead().hasNext());
- }
-
- @SuppressWarnings("serial")
- @Test
- public void testResultsWithMatchAndWhereWithParameters() throws Exception {
- Map params = new HashMap();
- params.put("foo", "bar");
- reader.setParameterValues(params);
- reader.setMatchStatement("n -- m");
- reader.setWhereStatement("has(n.name)");
- reader.setReturnStatement("m");
- reader.afterPropertiesSet();
- when(template.queryForObjects(String.class, "START n=node(*) MATCH n -- m WHERE has(n.name) RETURN m ORDER BY n.age SKIP 0 LIMIT 50", params)).thenReturn(result);
- when(result.iterator()).thenReturn(Arrays.asList("foo", "bar", "baz").iterator());
-
- assertTrue(reader.doPageRead().hasNext());
- }
-}
diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/data/Neo4jItemReader.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/data/Neo4jItemReader.java
index 305907265..4cf285adb 100644
--- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/data/Neo4jItemReader.java
+++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/data/Neo4jItemReader.java
@@ -18,58 +18,25 @@ package org.springframework.batch.item.data;
import java.util.ArrayList;
import java.util.Iterator;
-import java.util.Map;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import org.springframework.data.neo4j.conversion.DefaultConverter;
-import org.springframework.data.neo4j.conversion.Result;
-import org.springframework.data.neo4j.conversion.ResultConverter;
-import org.springframework.util.ClassUtils;
+//
+//import org.springframework.data.neo4j.conversion.ResultConverter;
/**
*
- * Extensions of the {@link AbstractNeo4jItemReader} intended for use with versions of
- * Spring Data Neo4J < 4. Conversions of the results are done using an external
- * {@link ResultConverter}.
+ * Extensions of the {@link AbstractNeo4jItemReader}.
*
*
* @author Michael Minella
- * @see org.springframework.batch.item.data.Neo4j4ItemReader
*/
public class Neo4jItemReader extends AbstractNeo4jItemReader {
- protected Log logger = LogFactory.getLog(getClass());
-
- private ResultConverter