diff --git a/pom.xml b/pom.xml index 83fa7af36..bd0a8eb56 100644 --- a/pom.xml +++ b/pom.xml @@ -31,7 +31,6 @@ 1.12.0.BUILD-SNAPSHOT 1.10.0.BUILD-SNAPSHOT 1.9.0.BUILD-SNAPSHOT - 3.5.0.BUILD-SNAPSHOT 1.8.0.BUILD-SNAPSHOT 1.6.0.BUILD-SNAPSHOT 1.4.0.BUILD-SNAPSHOT diff --git a/spring-data-rest-webmvc/pom.xml b/spring-data-rest-webmvc/pom.xml index b2c86f2b1..5cb7edf45 100644 --- a/spring-data-rest-webmvc/pom.xml +++ b/spring-data-rest-webmvc/pom.xml @@ -145,24 +145,6 @@ - - neo4j - - - true - - - - - org.springframework.data - spring-data-neo4j - ${springdata.neo4j} - test - - - - - gemfire diff --git a/spring-data-rest-webmvc/src/test/java/org/springframework/data/rest/webmvc/neo4j/AbstractEntity.java b/spring-data-rest-webmvc/src/test/java/org/springframework/data/rest/webmvc/neo4j/AbstractEntity.java deleted file mode 100644 index 0c5b1bb05..000000000 --- a/spring-data-rest-webmvc/src/test/java/org/springframework/data/rest/webmvc/neo4j/AbstractEntity.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2012-2013 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.data.rest.webmvc.neo4j; - -import org.springframework.data.neo4j.annotation.GraphId; - -public abstract class AbstractEntity { - - @GraphId// - private Long id; - - public Long getId() { - return id; - } - - @Override - public boolean equals(Object obj) { - - if (this == obj) { - return true; - } - - if (id == null || obj == null || !getClass().equals(obj.getClass())) { - return false; - } - return id.equals(((AbstractEntity) obj).id); - - } - - @Override - public int hashCode() { - return id == null ? 0 : id.hashCode(); - } -} diff --git a/spring-data-rest-webmvc/src/test/java/org/springframework/data/rest/webmvc/neo4j/Address.java b/spring-data-rest-webmvc/src/test/java/org/springframework/data/rest/webmvc/neo4j/Address.java deleted file mode 100644 index 81c2f275c..000000000 --- a/spring-data-rest-webmvc/src/test/java/org/springframework/data/rest/webmvc/neo4j/Address.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2012-2013 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.data.rest.webmvc.neo4j; - -import org.springframework.data.neo4j.annotation.NodeEntity; - -@NodeEntity -public class Address extends AbstractEntity { - - private String street, city; - private Country country; - - public Address(String street, String city, Country country) { - - this.street = street; - this.city = city; - this.country = country; - } - - public Address() { - - } - - public String getStreet() { - return street; - } - - public String getCity() { - return city; - } - - public Country getCountry() { - return country; - } -} diff --git a/spring-data-rest-webmvc/src/test/java/org/springframework/data/rest/webmvc/neo4j/Country.java b/spring-data-rest-webmvc/src/test/java/org/springframework/data/rest/webmvc/neo4j/Country.java deleted file mode 100644 index 78f1ace34..000000000 --- a/spring-data-rest-webmvc/src/test/java/org/springframework/data/rest/webmvc/neo4j/Country.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2012-2013 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.data.rest.webmvc.neo4j; - -import org.springframework.data.neo4j.annotation.Indexed; -import org.springframework.data.neo4j.annotation.NodeEntity; - -@NodeEntity -public class Country extends AbstractEntity { - - @Indexed(unique = true) String code; - String name; - - public Country(String code, String name) { - this.code = code; - this.name = name; - } - - public Country() {} -} diff --git a/spring-data-rest-webmvc/src/test/java/org/springframework/data/rest/webmvc/neo4j/Customer.java b/spring-data-rest-webmvc/src/test/java/org/springframework/data/rest/webmvc/neo4j/Customer.java deleted file mode 100644 index c75c765f8..000000000 --- a/spring-data-rest-webmvc/src/test/java/org/springframework/data/rest/webmvc/neo4j/Customer.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright 2012-2013 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.data.rest.webmvc.neo4j; - -import java.util.Collections; -import java.util.HashSet; -import java.util.Set; - -import org.springframework.data.neo4j.annotation.Indexed; -import org.springframework.data.neo4j.annotation.NodeEntity; -import org.springframework.data.neo4j.annotation.RelatedTo; -import org.springframework.util.Assert; - -@NodeEntity -public class Customer extends AbstractEntity { - - private String firstName, lastName; - - @Indexed(unique = true)// - private String emailAddress; - @RelatedTo(type = "ADDRESS")// - private Set
addresses = new HashSet
(); - - public Customer(String firstName, String lastName, String emailAddress) { - - Assert.hasText(firstName); - Assert.hasText(lastName); - Assert.hasText(emailAddress); - - this.firstName = firstName; - this.lastName = lastName; - this.emailAddress = emailAddress; - } - - protected Customer() { - - } - - public void add(Address address) { - this.addresses.add(address); - } - - public String getFirstName() { - return firstName; - } - - public String getLastName() { - return lastName; - } - - public void setLastName(String lastName) { - this.lastName = lastName; - } - - public String getEmailAddress() { - return emailAddress; - } - - public void setEmailAddress(String emailAddress) { - this.emailAddress = emailAddress; - } - - public Set
getAddresses() { - return Collections.unmodifiableSet(addresses); - } - - public boolean hasAddress(Address address) { - return addresses.contains(address); - } - - @Override - public String toString() { - return String.format("%s %s <%s>", firstName, lastName, emailAddress); - } -} diff --git a/spring-data-rest-webmvc/src/test/java/org/springframework/data/rest/webmvc/neo4j/CustomerRepository.java b/spring-data-rest-webmvc/src/test/java/org/springframework/data/rest/webmvc/neo4j/CustomerRepository.java deleted file mode 100644 index 88566d49c..000000000 --- a/spring-data-rest-webmvc/src/test/java/org/springframework/data/rest/webmvc/neo4j/CustomerRepository.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2012-2013 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.data.rest.webmvc.neo4j; - -import org.springframework.data.neo4j.repository.GraphRepository; - -public interface CustomerRepository extends GraphRepository { - - Customer findByEmailAddress(String emailAddress); -} diff --git a/spring-data-rest-webmvc/src/test/java/org/springframework/data/rest/webmvc/neo4j/Neo4jWebTests.java b/spring-data-rest-webmvc/src/test/java/org/springframework/data/rest/webmvc/neo4j/Neo4jWebTests.java deleted file mode 100644 index d207732db..000000000 --- a/spring-data-rest-webmvc/src/test/java/org/springframework/data/rest/webmvc/neo4j/Neo4jWebTests.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright 2013 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.data.rest.webmvc.neo4j; - -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*; - -import java.util.Arrays; - -import org.junit.Before; -import org.junit.Ignore; -import org.junit.Test; -import org.neo4j.graphdb.GraphDatabaseService; -import org.neo4j.graphdb.factory.GraphDatabaseFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.context.annotation.Configuration; -import org.springframework.data.neo4j.config.EnableNeo4jRepositories; -import org.springframework.data.neo4j.config.Neo4jConfiguration; -import org.springframework.data.rest.webmvc.CommonWebTests; -import org.springframework.hateoas.Link; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.transaction.annotation.EnableTransactionManagement; - -/** - * Integration tests for exposed Neo4j repositories. - * - * @author Oliver Gierke - */ -@ContextConfiguration -@Ignore -public class Neo4jWebTests extends CommonWebTests { - - @Configuration - @ComponentScan - @EnableNeo4jRepositories - @EnableTransactionManagement - static class TestConfig extends Neo4jConfiguration { - - public TestConfig() { - setBasePackage(Neo4jWebTests.class.getPackage().getName()); - } - - @Bean(destroyMethod = "shutdown") - public GraphDatabaseService graphDatabaseService() { - return new GraphDatabaseFactory().newEmbeddedDatabase("target/graphdb"); - } - - } - - @Autowired TestDataPopulator populator; - - @Before - @Override - public void setUp() { - this.populator.populate(); - super.setUp(); - } - - /* - * (non-Javadoc) - * @see org.springframework.data.rest.webmvc.AbstractWebIntegrationTests#expectedRootLinkRels() - */ - @Override - protected Iterable expectedRootLinkRels() { - return Arrays.asList("customers"); - } - - /** - * @see DATAREST-184 - */ - @Test - public void deletesCustomer() throws Exception { - - // Lookup customer - Link customers = client.discoverUnique("customers"); - Link customerLink = assertHasContentLinkWithRel("self", client.request(customers)); - - // Delete customer - mvc.perform(delete(customerLink.getHref())); - - // Assert no customers anymore - assertDoesNotHaveContentLinkWithRel("self", client.request(customers)); - } -} diff --git a/spring-data-rest-webmvc/src/test/java/org/springframework/data/rest/webmvc/neo4j/TestDataPopulator.java b/spring-data-rest-webmvc/src/test/java/org/springframework/data/rest/webmvc/neo4j/TestDataPopulator.java deleted file mode 100644 index 1d6d53540..000000000 --- a/spring-data-rest-webmvc/src/test/java/org/springframework/data/rest/webmvc/neo4j/TestDataPopulator.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2013 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.data.rest.webmvc.neo4j; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; -import org.springframework.transaction.annotation.Transactional; - -/** - * Simple component to populate the Neo4j repositories with sample data. - * - * @author Oliver Gierke - */ -@Component -public class TestDataPopulator { - - @Autowired CustomerRepository repository; - - @Transactional - public void populate() { - - if (repository.count() > 0) { - return; - } - - repository.save(new Customer("Oliver", "Gierke", "ogierke@gopivotal.com")); - } -}