Skip to content

Commit 3f31b94

Browse files
committed
fix build error
1 parent b20e8e7 commit 3f31b94

File tree

6 files changed

+214
-208
lines changed

6 files changed

+214
-208
lines changed

src/test/java/org/neo4j/gis/spatial/LayerMergeTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@
3131
import java.util.function.BiConsumer;
3232
import java.util.function.BiFunction;
3333
import java.util.function.Consumer;
34-
import org.junit.After;
35-
import org.junit.Before;
36-
import org.junit.Test;
34+
import org.junit.jupiter.api.AfterEach;
35+
import org.junit.jupiter.api.BeforeEach;
36+
import org.junit.jupiter.api.Test;
3737
import org.locationtech.jts.geom.Coordinate;
3838
import org.locationtech.jts.geom.CoordinateXY;
3939
import org.locationtech.jts.geom.Geometry;
@@ -60,15 +60,15 @@ public class LayerMergeTest {
6060
private GraphDatabaseService graphDb;
6161
private SpatialDatabaseService spatial;
6262

63-
@Before
63+
@BeforeEach
6464
public void setup() throws KernelException {
6565
databases = new TestDatabaseManagementServiceBuilder(new File("target/layers").toPath()).impermanent().build();
6666
graphDb = databases.database(DEFAULT_DATABASE_NAME);
6767
spatial = new SpatialDatabaseService(
6868
new IndexManager((GraphDatabaseAPI) graphDb, SecurityContext.AUTH_DISABLED));
6969
}
7070

71-
@After
71+
@AfterEach
7272
public void teardown() {
7373
databases.shutdown();
7474
}

src/test/java/org/neo4j/gis/spatial/OsmAnalysisTest.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,6 @@ public class OsmAnalysisTest extends TestOSMImportBase {
6363

6464
public static final String spatialTestMode = System.getProperty("spatial.test.mode");
6565
public static final boolean usePoints = true;
66-
private final int years;
67-
private final int days;
6866

6967
private static Stream<Arguments> parameters() {
7068
deleteBaseDir();

src/test/java/org/neo4j/gis/spatial/RTreeBulkInsertTest.java

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@
4949
import org.geotools.api.referencing.crs.CoordinateReferenceSystem;
5050
import org.geotools.data.neo4j.Neo4jFeatureBuilder;
5151
import org.geotools.referencing.crs.DefaultEngineeringCRS;
52-
import org.junit.After;
53-
import org.junit.AfterClass;
54-
import org.junit.Before;
55-
import org.junit.Ignore;
56-
import org.junit.Test;
52+
import org.junit.jupiter.api.AfterAll;
53+
import org.junit.jupiter.api.AfterEach;
54+
import org.junit.jupiter.api.BeforeEach;
55+
import org.junit.jupiter.api.Disabled;
56+
import org.junit.jupiter.api.Test;
5757
import org.locationtech.jts.geom.Coordinate;
5858
import org.locationtech.jts.geom.Geometry;
5959
import org.neo4j.dbms.api.DatabaseManagementService;
@@ -94,17 +94,17 @@ public class RTreeBulkInsertTest {
9494
// While the current lucene index implmentation is so slow (16n/s) we disable all benchmarks for lucene backed indexes
9595
private static final boolean enableLucene = false;
9696

97-
@Before
97+
@BeforeEach
9898
public void before() throws IOException {
9999
restart();
100100
}
101101

102-
@After
102+
@AfterEach
103103
public void after() throws IOException {
104104
doCleanShutdown();
105105
}
106106

107-
@Ignore
107+
@Disabled
108108
public void shouldDeleteRecursiveTree() {
109109
int depth = 5;
110110
int width = 2;
@@ -185,7 +185,7 @@ private EditableLayer getOrCreateSimplePointLayer(String name, String index, Str
185185
}
186186
}
187187

188-
@Ignore
188+
@Disabled
189189
public void shouldInsertSimpleRTree() {
190190
int width = 20;
191191
int blockSize = 10000;
@@ -603,12 +603,12 @@ public void shouldInsertManyNodesInBulkWithHilbert_small() throws FactoryExcepti
603603
insertManyNodesInBulk(new HilbertIndexMaker("Coordinates", "Bulk", testConfigs.get("small")), 5000);
604604
}
605605

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

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

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

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

684-
@Ignore
684+
@Disabled
685685
public void shouldInsertManyNodesIndividuallyWithQuadraticSplit_medium_10() throws FactoryException, IOException {
686686
insertManyNodesIndividually(RTreeIndex.QUADRATIC_SPLIT, 5000, 10, testConfigs.get("medium"));
687687
}
688688

689-
@Ignore
689+
@Disabled
690690
public void shouldInsertManyNodesIndividuallyGreenesSplit_medium_10() throws FactoryException, IOException {
691691
insertManyNodesIndividually(RTreeIndex.GREENES_SPLIT, 5000, 10, testConfigs.get("medium"));
692692
}
@@ -701,12 +701,12 @@ public void shouldInsertManyNodesInBulkWithGreenesSplit_medium_10() throws Facto
701701
insertManyNodesInBulk(RTreeIndex.GREENES_SPLIT, 5000, 10, testConfigs.get("medium"));
702702
}
703703

704-
@Ignore
704+
@Disabled
705705
public void shouldInsertManyNodesInBulkWithQuadraticSplit_medium_10_merge() throws FactoryException, IOException {
706706
insertManyNodesInBulk(RTreeIndex.QUADRATIC_SPLIT, 5000, 10, testConfigs.get("medium"), true);
707707
}
708708

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

718-
@Ignore
718+
@Disabled
719719
public void shouldInsertManyNodesIndividuallyWithQuadraticSplit_medium_100() throws FactoryException, IOException {
720720
insertManyNodesIndividually(RTreeIndex.QUADRATIC_SPLIT, 5000, 100, testConfigs.get("medium"));
721721
}
722722

723-
@Ignore
723+
@Disabled
724724
public void shouldInsertManyNodesIndividuallyGreenesSplit_medium_100() throws FactoryException, IOException {
725725
insertManyNodesIndividually(RTreeIndex.GREENES_SPLIT, 5000, 100, testConfigs.get("medium"));
726726
}
727727

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

738-
@Ignore
738+
@Disabled
739739
public void shouldInsertManyNodesInBulkWithQuadraticSplit_medium_100_merge() throws FactoryException, IOException {
740740
insertManyNodesInBulk(RTreeIndex.QUADRATIC_SPLIT, 5000, 100, testConfigs.get("medium"), true);
741741
}
742742

743-
@Ignore
743+
@Disabled
744744
public void shouldInsertManyNodesInBulkWithGreenesSplit_medium_100_merge() throws FactoryException, IOException {
745745
insertManyNodesInBulk(RTreeIndex.GREENES_SPLIT, 5000, 100, testConfigs.get("medium"), true);
746746
}
@@ -779,22 +779,22 @@ public void shouldInsertManyNodesInBulkWithHilbert_large() throws FactoryExcepti
779779
insertManyNodesInBulk(new HilbertIndexMaker("Coordinates", "Bulk", testConfigs.get("large")), 5000);
780780
}
781781

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

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

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

797-
@Ignore // takes too long, change to @Test when benchmarking
797+
@Disabled // takes too long, change to @Test when benchmarking
798798
public void shouldInsertManyNodesInBulkWithGreenesSplit_large_100() throws FactoryException, IOException {
799799
insertManyNodesInBulk(RTreeIndex.GREENES_SPLIT, 5000, 100, testConfigs.get("large"));
800800
}
@@ -916,7 +916,7 @@ private void insertManyNodesIndividually(IndexMaker indexMaker, int blockSize) {
916916
* Run this manually to generate images of RTree that can be used for animation.
917917
* ffmpeg -f image2 -r 12 -i rtree-single/rtree-%d.png -r 12 -s 1280x960 rtree-single2_12fps.mp4
918918
*/
919-
@Ignore
919+
@Disabled
920920
public void shouldInsertManyNodesIndividuallyAndGenerateImagesForAnimation() throws FactoryException, IOException {
921921
IndexTestConfig config = testConfigs.get("medium");
922922
int blockSize = 5;
@@ -1029,7 +1029,7 @@ private void insertManyNodesInBulk(IndexMaker indexMaker, int blockSize) {
10291029
* Run this manually to generate images of RTree that can be used for animation.
10301030
* ffmpeg -f image2 -r 12 -i rtree-single/rtree-%d.png -r 12 -s 1280x960 rtree-single2_12fps.mp4
10311031
*/
1032-
@Ignore
1032+
@Disabled
10331033
public void shouldInsertManyNodesInBulkAndGenerateImagesForAnimation() throws FactoryException, IOException {
10341034
IndexTestConfig config = testConfigs.get("medium");
10351035
int blockSize = 1000;
@@ -1085,7 +1085,7 @@ public void shouldInsertManyNodesInBulkAndGenerateImagesForAnimation() throws Fa
10851085
// debugIndexTree((RTreeIndex) layer.getIndex());
10861086
}
10871087

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

1162-
@Ignore
1162+
@Disabled
11631163
public void shouldBuildTreeFromScratch() throws Exception {
11641164
//GraphDatabaseService db = this.databases.database("BultTest2");
11651165
GraphDatabaseService db = this.db;
@@ -1215,7 +1215,7 @@ public void shouldBuildTreeFromScratch() throws Exception {
12151215
}
12161216
}
12171217

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

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

1806-
@AfterClass
1806+
@AfterAll
18071807
public static void afterClass() {
18081808
System.out.println("\n\nComposite stats for " + allStats.size() + " tests run");
18091809
System.out.println(TestStats.headerString());

src/test/java/org/neo4j/gis/spatial/TestOSMImport.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public void buildDataModel() {
106106
debugNode(n2);
107107
tx.commit();
108108
} catch (Exception e) {
109-
throw new SpatialDatabaseException("Failed to check OSM layer '" + layerName + "':" + e.getMessage(), e);
109+
throw new SpatialDatabaseException("Failed to check OSM layer:" + e.getMessage(), e);
110110
}
111111
try (Transaction tx = this.graphDb().beginTx()) {
112112
for (Node n : tx.getAllNodes()) {

src/test/java/org/neo4j/gis/spatial/pipes/GeoPipesDocTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,11 +1004,11 @@ private void assertWKTGeometryEquals(EditableLayerImpl layer, GeoPipeline pipeli
10041004
WKTReader reader = new WKTReader(layer.getGeometryFactory());
10051005
Geometry expected = reader.read(expectedWKT);
10061006
Geometry actual = reader.read(pipeline.next().getProperty(tx, "WellKnownText").toString());
1007-
assertEquals("Expected matching geometry types", expected.getGeometryType(), actual.getGeometryType());
1008-
assertEquals("Expected matching geometry areas", expected.getArea(), actual.getArea(), 0.000001);
1007+
assertEquals(expected.getGeometryType(), actual.getGeometryType(), "Expected matching geometry types");
1008+
assertEquals(expected.getArea(), actual.getArea(), 0.000001, "Expected matching geometry areas");
10091009
// 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
10101010
if (!expected.equals(actual)) {
1011-
assertEquals("Expected matching geometries", expected, actual);
1011+
assertEquals(expected, actual, "Expected matching geometries");
10121012
}
10131013
}
10141014

0 commit comments

Comments
 (0)