Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/0.15-neo4j-2.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
craigtaverner committed Apr 4, 2016
2 parents ca7bb0f + d3f2cf2 commit 4007320
Show file tree
Hide file tree
Showing 4 changed files with 94 additions and 105 deletions.
8 changes: 8 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,11 @@ language: java
jdk:
- openjdk7
- oraclejdk7
- oraclejdk8

# Patch for buffer overflow bug, see https://github.com/travis-ci/travis-ci/issues/5227
before_install:
- cat /etc/hosts # optionally check the content *before*
- sudo hostname "$(hostname | cut -c1-63)"
- sed -e "s/^\\(127\\.0\\.0\\.1.*\\)/\\1 $(hostname | cut -c1-63)/" /etc/hosts | sudo tee /etc/hosts
- cat /etc/hosts # optionally check the content *after*
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ now do
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-spatial</artifactId>
<version>0.15-neo4j-2.3.0</version>
<version>0.15-neo4j-2.3.1</version>
</dependency>
</dependencies>
</profile>
Expand Down Expand Up @@ -215,9 +215,11 @@ Precompiled versions of that ZIP file ready for download and use:
* [for Neo4j 1.8.2](http://dist.neo4j.org.s3.amazonaws.com/spatial/neo4j-spatial-0.9.1-neo4j-1.8.2-server-plugin.zip)
* [for Neo4j 1.9](http://dist.neo4j.org.s3.amazonaws.com/spatial/neo4j-spatial-0.11-neo4j-1.9-server-plugin.zip)
* [for Neo4j 2.0.4](https://github.com/neo4j-contrib/m2/blob/master/releases/org/neo4j/neo4j-spatial/0.12-neo4j-2.0.4/neo4j-spatial-0.12-neo4j-2.0.4-server-plugin.zip?raw=true)
* [for Neo4j 2.1.2](https://github.com/neo4j-contrib/m2/blob/master/releases/org/neo4j/neo4j-spatial/0.13-neo4j-2.1.2/neo4j-spatial-0.13-neo4j-2.1.2-server-plugin.zip?raw=true)
* [for Neo4j 2.2.6](https://github.com/neo4j-contrib/m2/blob/master/releases/org/neo4j/neo4j-spatial/0.15-neo4j-2.2.6/neo4j-spatial-0.15-neo4j-2.2.6-server-plugin.zip?raw=true)
* [for Neo4j 2.1.8](https://github.com/neo4j-contrib/m2/blob/master/releases/org/neo4j/neo4j-spatial/0.13-neo4j-2.1.8/neo4j-spatial-0.13-neo4j-2.1.8-server-plugin.zip?raw=true)
* [for Neo4j 2.2.6](https://github.com/neo4j-contrib/m2/blob/master/releases/org/neo4j/neo4j-spatial/0.14-neo4j-2.2.6/neo4j-spatial-0.14-neo4j-2.2.6-server-plugin.zip?raw=true)
* [for Neo4j 2.2.7](https://github.com/neo4j-contrib/m2/blob/master/releases/org/neo4j/neo4j-spatial/0.14-neo4j-2.2.7/neo4j-spatial-0.14-neo4j-2.2.7-server-plugin.zip?raw=true)
* [for Neo4j 2.3.0](https://github.com/neo4j-contrib/m2/blob/master/releases/org/neo4j/neo4j-spatial/0.15-neo4j-2.3.0/neo4j-spatial-0.15-neo4j-2.3.0-server-plugin.zip?raw=true)
* [for Neo4j 2.3.1](https://github.com/neo4j-contrib/m2/blob/master/releases/org/neo4j/neo4j-spatial/0.15-neo4j-2.3.1/neo4j-spatial-0.15-neo4j-2.3.1-server-plugin.zip?raw=true)

~~~bash
#install the plugin
Expand Down Expand Up @@ -278,7 +280,7 @@ Add the following repositories and dependency to your project's pom.xml:
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-spatial</artifactId>
<version>0.15-neo4j-2.3.0</version>
<version>0.15-neo4j-2.3.1</version>
</dependency>
~~~

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,12 @@

import static junit.framework.Assert.assertEquals;
import static junit.framework.TestCase.assertFalse;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;

import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.List;
import java.util.Map;

import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;

import junit.framework.Assert;
import org.codehaus.jackson.JsonNode;
import org.codehaus.jackson.map.ObjectMapper;
import org.json.simple.JSONArray;
Expand Down Expand Up @@ -86,12 +80,11 @@ public GraphDatabaseService graphdb() {
}

/**
* The Neo4j Spatial Server plugin, if
* installed, will be announced in the root representation
* for the Neo4j Server REST API.
* The Neo4j Spatial Server plugin, if installed, will be announced in the
* root representation for the Neo4j Server REST API.
*/
@Test
@Documented
@Documented("finding_the_plugin")
public void finding_the_plugin() throws UnsupportedEncodingException
{
gen.get().expectedStatus( Status.OK.getStatusCode() );
Expand All @@ -103,7 +96,7 @@ public void finding_the_plugin() throws UnsupportedEncodingException
* This allows cypher querying a bounding box
*/
@Test
@Documented
@Documented("querying_with_cypher")
public void querying_with_cypher() throws UnsupportedEncodingException, ParseException {
data.get();
String response = post(Status.OK,"{\"layer\":\"geom\", \"lat\":\"lat\", \"lon\":\"lon\"}", ENDPOINT + "/graphdb/addSimplePointLayer");
Expand Down Expand Up @@ -136,19 +129,18 @@ private int getNodeId(String response) throws ParseException {
* spatial information.
*/
@Test
@Documented
@Documented("create_a_pointlayer")
public void create_a_pointlayer() throws UnsupportedEncodingException
{
data.get();
String response = post(Status.OK,"{\"layer\":\"geom\", \"lat\":\"lat\", \"lon\":\"lon\"}", ENDPOINT + "/graphdb/addSimplePointLayer");
}

/**
* Find a layer by its name, returning th layer
* .
* Find a layer by its name, returning the layer.
*/
@Test
@Documented
@Documented("find_layer")
public void find_layer() throws UnsupportedEncodingException
{
data.get();
Expand All @@ -162,23 +154,21 @@ public void find_layer() throws UnsupportedEncodingException
}

/**
* Add that node to the spatial
* layer.
* Add that node to the spatial layer.
*/
@Test
@Documented
@Documented("create_a_spatial_index")
public void create_a_spatial_index() throws UnsupportedEncodingException
{
data.get();
String response = post(Status.OK,"{\"layer\":\"geom\", \"lat\":\"lat\", \"lon\":\"lon\"}", ENDPOINT + "/graphdb/addSimplePointLayer");
response = post(Status.CREATED,"{\"name\":\"geom\", \"config\":{\"provider\":\"spatial\", \"geometry_type\":\"point\",\"lat\":\"lat\",\"lon\":\"lon\"}}", "http://localhost:"+PORT+"/db/data/index/node/");
}
/**
* Create a node with some spatial data like `lon` and `lat`
* attached.
* Create a node with some spatial data like `lon` and `lat` attached.
*/
@Test
@Documented
@Documented("create_a_node_with_spatial_data")
public void create_a_node_with_spatial_data() throws UnsupportedEncodingException
{
data.get();
Expand All @@ -188,11 +178,10 @@ public void create_a_node_with_spatial_data() throws UnsupportedEncodingExceptio
}

/**
* Add the node we created to the spatial
* index.
* Add the node we created to the spatial index.
*/
@Test
@Documented
@Documented("add_a_node_to_the_spatial_index")
public void add_a_node_to_the_spatial_index() throws Exception {
data.get();
String response = post(Status.OK,"{\"layer\":\"geom\", \"lat\":\"lat\", \"lon\":\"lon\"}", ENDPOINT + "/graphdb/addSimplePointLayer");
Expand All @@ -206,7 +195,7 @@ public void add_a_node_to_the_spatial_index() throws Exception {
* Add multiple nodes to the spatial layer.
*/
@Test
@Documented
@Documented("add_many_nodes_to_the_spatial_layer")
public void add_many_nodes_to_the_spatial_layer() throws Exception {
data.get();
String response = post(Status.OK,"{\"layer\":\"geom\", \"lat\":\"lat\", \"lon\":\"lon\"}", ENDPOINT + "/graphdb/addSimplePointLayer");
Expand All @@ -221,10 +210,10 @@ public void add_many_nodes_to_the_spatial_layer() throws Exception {
}

/**
* Add a node to an index created as a WKT
* Add a node to an index created as a WKT.
*/
@Test
@Documented
@Documented("add_a_wkt_node_to_the_spatial_index")
public void add_a_wkt_node_to_the_spatial_index() throws Exception {
data.get();
String response = post(Status.OK,"{\"layer\":\"geom\", \"lat\":\"lat\", \"lon\":\"lon\"}", ENDPOINT + "/graphdb/addSimplePointLayer");
Expand All @@ -244,11 +233,10 @@ public void add_a_wkt_node_to_the_spatial_index() throws Exception {
}

/**
* Find geometries in a bounding
* box.
* Find geometries in a bounding box.
*/
@Test
@Documented
@Documented("find_geometries_in_a_bounding_box")
public void find_geometries_in_a_bounding_box() throws Exception
{
data.get();
Expand All @@ -263,12 +251,11 @@ public void find_geometries_in_a_bounding_box() throws Exception


/**
* Creates a layer with nodes that have a
* property containing WKT or WKB, returns the layer node containing the configuration for the newly
* created layer.
* Creates a layer with nodes that have a property containing WKT or WKB,
* returns the layer node containing the configuration for the newly created layer.
*/
@Test
@Documented
@Documented("create_a_WKT_layer")
public void create_a_WKT_layer() throws Exception
{
data.get();
Expand All @@ -279,11 +266,10 @@ public void create_a_WKT_layer() throws Exception
}

/**
* Add a geometry, encoded in WKT, to a
* layer.
* Add a geometry, encoded in WKT, to a layer.
*/
@Test
@Documented
@Documented("add_a_WKT_geometry_to_a_layer")
public void add_a_WKT_geometry_to_a_layer() throws Exception
{
data.get();
Expand All @@ -296,11 +282,10 @@ public void add_a_WKT_geometry_to_a_layer() throws Exception
}

/**
* Update a geometry, encoded in WKT, on an existing geometry in a
* layer.
* Update a geometry, encoded in WKT, on an existing geometry in a layer.
*/
@Test
@Documented
@Documented("update_a_WKT_geometry_in_a_layer")
public void update_a_WKT_geometry_in_a_layer() throws Exception
{
data.get();
Expand All @@ -319,11 +304,10 @@ public void update_a_WKT_geometry_in_a_layer() throws Exception
}

/**
* Find geometries which clostest edges are less than a certain distance from a
* point.
* Find geometries which clostest edges are less than a certain distance from a point.
*/
@Test
@Documented
@Documented("find_geometries_close_to_a_point")
public void find_geometries_close_to_a_point() throws Exception
{
data.get();
Expand All @@ -349,11 +333,10 @@ private String findNodeInBox(String layer_name, double lon1, double lon2, double
}

/**
* Find geometries within a
* distance.
* Find geometries within a distance.
*/
@Test
@Documented
@Documented("find_geometries_within__distance")
public void find_geometries_within__distance() throws Exception
{
data.get();
Expand All @@ -367,11 +350,10 @@ public void find_geometries_within__distance() throws Exception
}

/**
* Find geometries in a bounding
* box.
* Find geometries in a bounding box.
*/
@Test
@Documented
@Documented("Find geometries in a bounding box.")
public void find_geometries_in_a_bounding_box_using_cypher() throws Exception
{
data.get();
Expand All @@ -391,11 +373,10 @@ public void find_geometries_in_a_bounding_box_using_cypher() throws Exception
}

/**
* Find geometries within a distance, using
* Cypher.
* Find geometries within a distance, using Cypher.
*/
@Test
@Documented
@Documented("find_geometries_within__distance_using_cypher")
public void find_geometries_within__distance_using_cypher() throws Exception
{
data.get();
Expand Down
Loading

0 comments on commit 4007320

Please sign in to comment.