Skip to content

Commit

Permalink
fix build error
Browse files Browse the repository at this point in the history
  • Loading branch information
Andy2003 committed May 29, 2024
1 parent b20e8e7 commit 3f31b94
Show file tree
Hide file tree
Showing 6 changed files with 214 additions and 208 deletions.
10 changes: 5 additions & 5 deletions src/test/java/org/neo4j/gis/spatial/LayerMergeTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
import java.util.function.BiConsumer;
import java.util.function.BiFunction;
import java.util.function.Consumer;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.locationtech.jts.geom.Coordinate;
import org.locationtech.jts.geom.CoordinateXY;
import org.locationtech.jts.geom.Geometry;
Expand All @@ -60,15 +60,15 @@ public class LayerMergeTest {
private GraphDatabaseService graphDb;
private SpatialDatabaseService spatial;

@Before
@BeforeEach
public void setup() throws KernelException {
databases = new TestDatabaseManagementServiceBuilder(new File("target/layers").toPath()).impermanent().build();
graphDb = databases.database(DEFAULT_DATABASE_NAME);
spatial = new SpatialDatabaseService(
new IndexManager((GraphDatabaseAPI) graphDb, SecurityContext.AUTH_DISABLED));
}

@After
@AfterEach
public void teardown() {
databases.shutdown();
}
Expand Down
2 changes: 0 additions & 2 deletions src/test/java/org/neo4j/gis/spatial/OsmAnalysisTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ public class OsmAnalysisTest extends TestOSMImportBase {

public static final String spatialTestMode = System.getProperty("spatial.test.mode");
public static final boolean usePoints = true;
private final int years;
private final int days;

private static Stream<Arguments> parameters() {
deleteBaseDir();
Expand Down
64 changes: 32 additions & 32 deletions src/test/java/org/neo4j/gis/spatial/RTreeBulkInsertTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@
import org.geotools.api.referencing.crs.CoordinateReferenceSystem;
import org.geotools.data.neo4j.Neo4jFeatureBuilder;
import org.geotools.referencing.crs.DefaultEngineeringCRS;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.locationtech.jts.geom.Coordinate;
import org.locationtech.jts.geom.Geometry;
import org.neo4j.dbms.api.DatabaseManagementService;
Expand Down Expand Up @@ -94,17 +94,17 @@ public class RTreeBulkInsertTest {
// While the current lucene index implmentation is so slow (16n/s) we disable all benchmarks for lucene backed indexes
private static final boolean enableLucene = false;

@Before
@BeforeEach
public void before() throws IOException {
restart();
}

@After
@AfterEach
public void after() throws IOException {
doCleanShutdown();
}

@Ignore
@Disabled
public void shouldDeleteRecursiveTree() {
int depth = 5;
int width = 2;
Expand Down Expand Up @@ -185,7 +185,7 @@ private EditableLayer getOrCreateSimplePointLayer(String name, String index, Str
}
}

@Ignore
@Disabled
public void shouldInsertSimpleRTree() {
int width = 20;
int blockSize = 10000;
Expand Down Expand Up @@ -603,12 +603,12 @@ public void shouldInsertManyNodesInBulkWithHilbert_small() throws FactoryExcepti
insertManyNodesInBulk(new HilbertIndexMaker("Coordinates", "Bulk", testConfigs.get("small")), 5000);
}

@Ignore // takes too long, change to @Test when benchmarking
@Disabled // takes too long, change to @Test when benchmarking
public void shouldInsertManyNodesIndividuallyWithQuadraticSplit_small_10() throws FactoryException, IOException {
insertManyNodesIndividually(RTreeIndex.QUADRATIC_SPLIT, 5000, 10, testConfigs.get("small"));
}

@Ignore // takes too long, change to @Test when benchmarking
@Disabled // takes too long, change to @Test when benchmarking
public void shouldInsertManyNodesIndividuallyGreenesSplit_small_10() throws FactoryException, IOException {
insertManyNodesIndividually(RTreeIndex.GREENES_SPLIT, 5000, 10, testConfigs.get("small"));
}
Expand All @@ -627,12 +627,12 @@ public void shouldInsertManyNodesInBulkWithGreenesSplit_small_10() throws Factor
* Small model 250*250 nodes (shallow tree)
*/

@Ignore // takes too long, change to @Test when benchmarking
@Disabled // takes too long, change to @Test when benchmarking
public void shouldInsertManyNodesIndividuallyWithQuadraticSplit_small_100() throws FactoryException, IOException {
insertManyNodesIndividually(RTreeIndex.QUADRATIC_SPLIT, 5000, 100, testConfigs.get("small"));
}

@Ignore // takes too long, change to @Test when benchmarking
@Disabled // takes too long, change to @Test when benchmarking
public void shouldInsertManyNodesIndividuallyGreenesSplit_small_100() throws FactoryException, IOException {
insertManyNodesIndividually(RTreeIndex.GREENES_SPLIT, 5000, 100, testConfigs.get("small"));
}
Expand Down Expand Up @@ -681,12 +681,12 @@ public void shouldInsertManyNodesInBulkWithHilbert_medium() throws FactoryExcept
insertManyNodesInBulk(new HilbertIndexMaker("Coordinates", "Bulk", testConfigs.get("medium")), 5000);
}

@Ignore
@Disabled
public void shouldInsertManyNodesIndividuallyWithQuadraticSplit_medium_10() throws FactoryException, IOException {
insertManyNodesIndividually(RTreeIndex.QUADRATIC_SPLIT, 5000, 10, testConfigs.get("medium"));
}

@Ignore
@Disabled
public void shouldInsertManyNodesIndividuallyGreenesSplit_medium_10() throws FactoryException, IOException {
insertManyNodesIndividually(RTreeIndex.GREENES_SPLIT, 5000, 10, testConfigs.get("medium"));
}
Expand All @@ -701,12 +701,12 @@ public void shouldInsertManyNodesInBulkWithGreenesSplit_medium_10() throws Facto
insertManyNodesInBulk(RTreeIndex.GREENES_SPLIT, 5000, 10, testConfigs.get("medium"));
}

@Ignore
@Disabled
public void shouldInsertManyNodesInBulkWithQuadraticSplit_medium_10_merge() throws FactoryException, IOException {
insertManyNodesInBulk(RTreeIndex.QUADRATIC_SPLIT, 5000, 10, testConfigs.get("medium"), true);
}

@Ignore
@Disabled
public void shouldInsertManyNodesInBulkWithGreenesSplit_medium_10_merge() throws FactoryException, IOException {
insertManyNodesInBulk(RTreeIndex.GREENES_SPLIT, 5000, 10, testConfigs.get("medium"), true);
}
Expand All @@ -715,17 +715,17 @@ public void shouldInsertManyNodesInBulkWithGreenesSplit_medium_10_merge() throws
* Medium model 500*500 nodes (shallow tree - factor 100)
*/

@Ignore
@Disabled
public void shouldInsertManyNodesIndividuallyWithQuadraticSplit_medium_100() throws FactoryException, IOException {
insertManyNodesIndividually(RTreeIndex.QUADRATIC_SPLIT, 5000, 100, testConfigs.get("medium"));
}

@Ignore
@Disabled
public void shouldInsertManyNodesIndividuallyGreenesSplit_medium_100() throws FactoryException, IOException {
insertManyNodesIndividually(RTreeIndex.GREENES_SPLIT, 5000, 100, testConfigs.get("medium"));
}

@Ignore // takes too long, change to @Test when benchmarking
@Disabled // takes too long, change to @Test when benchmarking
public void shouldInsertManyNodesInBulkWithQuadraticSplit_medium_100() throws FactoryException, IOException {
insertManyNodesInBulk(RTreeIndex.QUADRATIC_SPLIT, 5000, 100, testConfigs.get("medium"));
}
Expand All @@ -735,12 +735,12 @@ public void shouldInsertManyNodesInBulkWithGreenesSplit_medium_100() throws Fact
insertManyNodesInBulk(RTreeIndex.GREENES_SPLIT, 5000, 100, testConfigs.get("medium"));
}

@Ignore
@Disabled
public void shouldInsertManyNodesInBulkWithQuadraticSplit_medium_100_merge() throws FactoryException, IOException {
insertManyNodesInBulk(RTreeIndex.QUADRATIC_SPLIT, 5000, 100, testConfigs.get("medium"), true);
}

@Ignore
@Disabled
public void shouldInsertManyNodesInBulkWithGreenesSplit_medium_100_merge() throws FactoryException, IOException {
insertManyNodesInBulk(RTreeIndex.GREENES_SPLIT, 5000, 100, testConfigs.get("medium"), true);
}
Expand Down Expand Up @@ -779,22 +779,22 @@ public void shouldInsertManyNodesInBulkWithHilbert_large() throws FactoryExcepti
insertManyNodesInBulk(new HilbertIndexMaker("Coordinates", "Bulk", testConfigs.get("large")), 5000);
}

@Ignore // takes too long, change to @Test when benchmarking
@Disabled // takes too long, change to @Test when benchmarking
public void shouldInsertManyNodesInBulkWithQuadraticSplit_large_10() throws FactoryException, IOException {
insertManyNodesInBulk(RTreeIndex.QUADRATIC_SPLIT, 5000, 10, testConfigs.get("large"));
}

@Ignore // takes too long, change to @Test when benchmarking
@Disabled // takes too long, change to @Test when benchmarking
public void shouldInsertManyNodesInBulkWithGreenesSplit_large_10() throws FactoryException, IOException {
insertManyNodesInBulk(RTreeIndex.GREENES_SPLIT, 5000, 10, testConfigs.get("large"));
}

@Ignore // takes too long, change to @Test when benchmarking
@Disabled // takes too long, change to @Test when benchmarking
public void shouldInsertManyNodesInBulkWithQuadraticSplit_large_100() throws FactoryException, IOException {
insertManyNodesInBulk(RTreeIndex.QUADRATIC_SPLIT, 5000, 100, testConfigs.get("large"));
}

@Ignore // takes too long, change to @Test when benchmarking
@Disabled // takes too long, change to @Test when benchmarking
public void shouldInsertManyNodesInBulkWithGreenesSplit_large_100() throws FactoryException, IOException {
insertManyNodesInBulk(RTreeIndex.GREENES_SPLIT, 5000, 100, testConfigs.get("large"));
}
Expand Down Expand Up @@ -916,7 +916,7 @@ private void insertManyNodesIndividually(IndexMaker indexMaker, int blockSize) {
* Run this manually to generate images of RTree that can be used for animation.
* ffmpeg -f image2 -r 12 -i rtree-single/rtree-%d.png -r 12 -s 1280x960 rtree-single2_12fps.mp4
*/
@Ignore
@Disabled
public void shouldInsertManyNodesIndividuallyAndGenerateImagesForAnimation() throws FactoryException, IOException {
IndexTestConfig config = testConfigs.get("medium");
int blockSize = 5;
Expand Down Expand Up @@ -1029,7 +1029,7 @@ private void insertManyNodesInBulk(IndexMaker indexMaker, int blockSize) {
* Run this manually to generate images of RTree that can be used for animation.
* ffmpeg -f image2 -r 12 -i rtree-single/rtree-%d.png -r 12 -s 1280x960 rtree-single2_12fps.mp4
*/
@Ignore
@Disabled
public void shouldInsertManyNodesInBulkAndGenerateImagesForAnimation() throws FactoryException, IOException {
IndexTestConfig config = testConfigs.get("medium");
int blockSize = 1000;
Expand Down Expand Up @@ -1085,7 +1085,7 @@ public void shouldInsertManyNodesInBulkAndGenerateImagesForAnimation() throws Fa
// debugIndexTree((RTreeIndex) layer.getIndex());
}

@Ignore
@Disabled
public void shouldAccessIndexAfterBulkInsertion() throws Exception {
// Use these two lines if you want to examine the output.
// File dbPath = new File("target/var/BulkTest");
Expand Down Expand Up @@ -1159,7 +1159,7 @@ public void shouldAccessIndexAfterBulkInsertion() throws Exception {
System.out.println("\t" + (System.currentTimeMillis() - start) + "ms");
}

@Ignore
@Disabled
public void shouldBuildTreeFromScratch() throws Exception {
//GraphDatabaseService db = this.databases.database("BultTest2");
GraphDatabaseService db = this.db;
Expand Down Expand Up @@ -1215,7 +1215,7 @@ public void shouldBuildTreeFromScratch() throws Exception {
}
}

@Ignore
@Disabled
public void shouldPerformRTreeBulkInsertion() throws Exception {
// Use this line if you want to examine the output.
//GraphDatabaseService db = databases.database("BulkTest");
Expand Down Expand Up @@ -1803,7 +1803,7 @@ public String toString() {

private static final LinkedHashSet<TestStats> allStats = new LinkedHashSet<>();

@AfterClass
@AfterAll
public static void afterClass() {
System.out.println("\n\nComposite stats for " + allStats.size() + " tests run");
System.out.println(TestStats.headerString());
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/org/neo4j/gis/spatial/TestOSMImport.java
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public void buildDataModel() {
debugNode(n2);
tx.commit();
} catch (Exception e) {
throw new SpatialDatabaseException("Failed to check OSM layer '" + layerName + "':" + e.getMessage(), e);
throw new SpatialDatabaseException("Failed to check OSM layer:" + e.getMessage(), e);
}
try (Transaction tx = this.graphDb().beginTx()) {
for (Node n : tx.getAllNodes()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1004,11 +1004,11 @@ private void assertWKTGeometryEquals(EditableLayerImpl layer, GeoPipeline pipeli
WKTReader reader = new WKTReader(layer.getGeometryFactory());
Geometry expected = reader.read(expectedWKT);
Geometry actual = reader.read(pipeline.next().getProperty(tx, "WellKnownText").toString());
assertEquals("Expected matching geometry types", expected.getGeometryType(), actual.getGeometryType());
assertEquals("Expected matching geometry areas", expected.getArea(), actual.getArea(), 0.000001);
assertEquals(expected.getGeometryType(), actual.getGeometryType(), "Expected matching geometry types");
assertEquals(expected.getArea(), actual.getArea(), 0.000001, "Expected matching geometry areas");
// JTS will handle different starting coordinates for matching geometries, so we check with JTS first, and only if that fails run the assertion to get the appropriate error message
if (!expected.equals(actual)) {
assertEquals("Expected matching geometries", expected, actual);
assertEquals(expected, actual, "Expected matching geometries");
}
}

Expand Down
Loading

0 comments on commit 3f31b94

Please sign in to comment.