Skip to content

Commit

Permalink
Fixes IllegalArgumentException thrown when an index is loaded more th…
Browse files Browse the repository at this point in the history
…an once
  • Loading branch information
luanne committed May 28, 2013
1 parent 5d59e2c commit 2156622
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion src/test/java/org/neo4j/gis/spatial/IndexProviderTest.java
Expand Up @@ -76,9 +76,33 @@ public void testLoadIndex()
Map<String, String> config = SpatialIndexProvider.SIMPLE_POINT_CONFIG;
IndexManager indexMan = db.index();
Index<Node> index = indexMan.forNodes( "layer1", config );
// index = indexMan.forNodes( "layer1", config );
assertNotNull( index );

//Load the an existing index again
index = indexMan.forNodes( "layer1", config );
assertNotNull( index );


//Try a different config
Map<String, String> config2 = SpatialIndexProvider.SIMPLE_POINT_CONFIG_WKT;
index=indexMan.forNodes("layer2",config2);
assertNotNull( index );

//Load the index again
index=indexMan.forNodes("layer2",config2);
assertNotNull( index );

//Try loading the same index with a different config
boolean exceptionThrown=false;
try {
index=indexMan.forNodes("layer2",config);
}
catch(IllegalArgumentException iae) {
exceptionThrown=true;
}
assertTrue(exceptionThrown);


}

@Test
Expand Down

0 comments on commit 2156622

Please sign in to comment.