2323import static org .hamcrest .MatcherAssert .assertThat ;
2424import static org .hamcrest .Matchers .lessThan ;
2525import static org .hamcrest .Matchers .lessThanOrEqualTo ;
26- import static org .junit .Assert .assertEquals ;
27- import static org .junit .Assert .assertNotNull ;
28- import static org .junit .Assert .assertTrue ;
26+ import static org .junit .jupiter .api .Assertions .assertEquals ;
27+ import static org .junit .jupiter .api .Assertions .assertInstanceOf ;
28+ import static org .junit .jupiter .api .Assertions .assertNotNull ;
29+ import static org .junit .jupiter .api .Assertions .assertTrue ;
2930import static org .neo4j .configuration .GraphDatabaseSettings .DEFAULT_DATABASE_NAME ;
3031import static org .neo4j .gis .spatial .rtree .RTreeIndex .DEFAULT_MAX_NODE_REFERENCES ;
3132import static org .neo4j .internal .helpers .collection .MapUtil .map ;
4950import org .geotools .api .referencing .crs .CoordinateReferenceSystem ;
5051import org .geotools .data .neo4j .Neo4jFeatureBuilder ;
5152import 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 ;
53+ import org .junit .jupiter . api . AfterAll ;
54+ import org .junit .jupiter . api . AfterEach ;
55+ import org .junit .jupiter . api . BeforeEach ;
56+ import org .junit .jupiter . api . Disabled ;
57+ import org .junit .jupiter . api . Test ;
5758import org .locationtech .jts .geom .Coordinate ;
5859import org .locationtech .jts .geom .Geometry ;
5960import org .neo4j .dbms .api .DatabaseManagementService ;
@@ -94,17 +95,17 @@ public class RTreeBulkInsertTest {
9495 // While the current lucene index implmentation is so slow (16n/s) we disable all benchmarks for lucene backed indexes
9596 private static final boolean enableLucene = false ;
9697
97- @ Before
98+ @ BeforeEach
9899 public void before () throws IOException {
99100 restart ();
100101 }
101102
102- @ After
103+ @ AfterEach
103104 public void after () throws IOException {
104105 doCleanShutdown ();
105106 }
106107
107- @ Ignore
108+ @ Disabled
108109 public void shouldDeleteRecursiveTree () {
109110 int depth = 5 ;
110111 int width = 2 ;
@@ -185,7 +186,7 @@ private EditableLayer getOrCreateSimplePointLayer(String name, String index, Str
185186 }
186187 }
187188
188- @ Ignore
189+ @ Disabled
189190 public void shouldInsertSimpleRTree () {
190191 int width = 20 ;
191192 int blockSize = 10000 ;
@@ -603,12 +604,12 @@ public void shouldInsertManyNodesInBulkWithHilbert_small() throws FactoryExcepti
603604 insertManyNodesInBulk (new HilbertIndexMaker ("Coordinates" , "Bulk" , testConfigs .get ("small" )), 5000 );
604605 }
605606
606- @ Ignore // takes too long, change to @Test when benchmarking
607+ @ Disabled // takes too long, change to @Test when benchmarking
607608 public void shouldInsertManyNodesIndividuallyWithQuadraticSplit_small_10 () throws FactoryException , IOException {
608609 insertManyNodesIndividually (RTreeIndex .QUADRATIC_SPLIT , 5000 , 10 , testConfigs .get ("small" ));
609610 }
610611
611- @ Ignore // takes too long, change to @Test when benchmarking
612+ @ Disabled // takes too long, change to @Test when benchmarking
612613 public void shouldInsertManyNodesIndividuallyGreenesSplit_small_10 () throws FactoryException , IOException {
613614 insertManyNodesIndividually (RTreeIndex .GREENES_SPLIT , 5000 , 10 , testConfigs .get ("small" ));
614615 }
@@ -627,12 +628,12 @@ public void shouldInsertManyNodesInBulkWithGreenesSplit_small_10() throws Factor
627628 * Small model 250*250 nodes (shallow tree)
628629 */
629630
630- @ Ignore // takes too long, change to @Test when benchmarking
631+ @ Disabled // takes too long, change to @Test when benchmarking
631632 public void shouldInsertManyNodesIndividuallyWithQuadraticSplit_small_100 () throws FactoryException , IOException {
632633 insertManyNodesIndividually (RTreeIndex .QUADRATIC_SPLIT , 5000 , 100 , testConfigs .get ("small" ));
633634 }
634635
635- @ Ignore // takes too long, change to @Test when benchmarking
636+ @ Disabled // takes too long, change to @Test when benchmarking
636637 public void shouldInsertManyNodesIndividuallyGreenesSplit_small_100 () throws FactoryException , IOException {
637638 insertManyNodesIndividually (RTreeIndex .GREENES_SPLIT , 5000 , 100 , testConfigs .get ("small" ));
638639 }
@@ -681,12 +682,12 @@ public void shouldInsertManyNodesInBulkWithHilbert_medium() throws FactoryExcept
681682 insertManyNodesInBulk (new HilbertIndexMaker ("Coordinates" , "Bulk" , testConfigs .get ("medium" )), 5000 );
682683 }
683684
684- @ Ignore
685+ @ Disabled
685686 public void shouldInsertManyNodesIndividuallyWithQuadraticSplit_medium_10 () throws FactoryException , IOException {
686687 insertManyNodesIndividually (RTreeIndex .QUADRATIC_SPLIT , 5000 , 10 , testConfigs .get ("medium" ));
687688 }
688689
689- @ Ignore
690+ @ Disabled
690691 public void shouldInsertManyNodesIndividuallyGreenesSplit_medium_10 () throws FactoryException , IOException {
691692 insertManyNodesIndividually (RTreeIndex .GREENES_SPLIT , 5000 , 10 , testConfigs .get ("medium" ));
692693 }
@@ -701,12 +702,12 @@ public void shouldInsertManyNodesInBulkWithGreenesSplit_medium_10() throws Facto
701702 insertManyNodesInBulk (RTreeIndex .GREENES_SPLIT , 5000 , 10 , testConfigs .get ("medium" ));
702703 }
703704
704- @ Ignore
705+ @ Disabled
705706 public void shouldInsertManyNodesInBulkWithQuadraticSplit_medium_10_merge () throws FactoryException , IOException {
706707 insertManyNodesInBulk (RTreeIndex .QUADRATIC_SPLIT , 5000 , 10 , testConfigs .get ("medium" ), true );
707708 }
708709
709- @ Ignore
710+ @ Disabled
710711 public void shouldInsertManyNodesInBulkWithGreenesSplit_medium_10_merge () throws FactoryException , IOException {
711712 insertManyNodesInBulk (RTreeIndex .GREENES_SPLIT , 5000 , 10 , testConfigs .get ("medium" ), true );
712713 }
@@ -715,17 +716,17 @@ public void shouldInsertManyNodesInBulkWithGreenesSplit_medium_10_merge() throws
715716 * Medium model 500*500 nodes (shallow tree - factor 100)
716717 */
717718
718- @ Ignore
719+ @ Disabled
719720 public void shouldInsertManyNodesIndividuallyWithQuadraticSplit_medium_100 () throws FactoryException , IOException {
720721 insertManyNodesIndividually (RTreeIndex .QUADRATIC_SPLIT , 5000 , 100 , testConfigs .get ("medium" ));
721722 }
722723
723- @ Ignore
724+ @ Disabled
724725 public void shouldInsertManyNodesIndividuallyGreenesSplit_medium_100 () throws FactoryException , IOException {
725726 insertManyNodesIndividually (RTreeIndex .GREENES_SPLIT , 5000 , 100 , testConfigs .get ("medium" ));
726727 }
727728
728- @ Ignore // takes too long, change to @Test when benchmarking
729+ @ Disabled // takes too long, change to @Test when benchmarking
729730 public void shouldInsertManyNodesInBulkWithQuadraticSplit_medium_100 () throws FactoryException , IOException {
730731 insertManyNodesInBulk (RTreeIndex .QUADRATIC_SPLIT , 5000 , 100 , testConfigs .get ("medium" ));
731732 }
@@ -735,12 +736,12 @@ public void shouldInsertManyNodesInBulkWithGreenesSplit_medium_100() throws Fact
735736 insertManyNodesInBulk (RTreeIndex .GREENES_SPLIT , 5000 , 100 , testConfigs .get ("medium" ));
736737 }
737738
738- @ Ignore
739+ @ Disabled
739740 public void shouldInsertManyNodesInBulkWithQuadraticSplit_medium_100_merge () throws FactoryException , IOException {
740741 insertManyNodesInBulk (RTreeIndex .QUADRATIC_SPLIT , 5000 , 100 , testConfigs .get ("medium" ), true );
741742 }
742743
743- @ Ignore
744+ @ Disabled
744745 public void shouldInsertManyNodesInBulkWithGreenesSplit_medium_100_merge () throws FactoryException , IOException {
745746 insertManyNodesInBulk (RTreeIndex .GREENES_SPLIT , 5000 , 100 , testConfigs .get ("medium" ), true );
746747 }
@@ -779,22 +780,22 @@ public void shouldInsertManyNodesInBulkWithHilbert_large() throws FactoryExcepti
779780 insertManyNodesInBulk (new HilbertIndexMaker ("Coordinates" , "Bulk" , testConfigs .get ("large" )), 5000 );
780781 }
781782
782- @ Ignore // takes too long, change to @Test when benchmarking
783+ @ Disabled // takes too long, change to @Test when benchmarking
783784 public void shouldInsertManyNodesInBulkWithQuadraticSplit_large_10 () throws FactoryException , IOException {
784785 insertManyNodesInBulk (RTreeIndex .QUADRATIC_SPLIT , 5000 , 10 , testConfigs .get ("large" ));
785786 }
786787
787- @ Ignore // takes too long, change to @Test when benchmarking
788+ @ Disabled // takes too long, change to @Test when benchmarking
788789 public void shouldInsertManyNodesInBulkWithGreenesSplit_large_10 () throws FactoryException , IOException {
789790 insertManyNodesInBulk (RTreeIndex .GREENES_SPLIT , 5000 , 10 , testConfigs .get ("large" ));
790791 }
791792
792- @ Ignore // takes too long, change to @Test when benchmarking
793+ @ Disabled // takes too long, change to @Test when benchmarking
793794 public void shouldInsertManyNodesInBulkWithQuadraticSplit_large_100 () throws FactoryException , IOException {
794795 insertManyNodesInBulk (RTreeIndex .QUADRATIC_SPLIT , 5000 , 100 , testConfigs .get ("large" ));
795796 }
796797
797- @ Ignore // takes too long, change to @Test when benchmarking
798+ @ Disabled // takes too long, change to @Test when benchmarking
798799 public void shouldInsertManyNodesInBulkWithGreenesSplit_large_100 () throws FactoryException , IOException {
799800 insertManyNodesInBulk (RTreeIndex .GREENES_SPLIT , 5000 , 100 , testConfigs .get ("large" ));
800801 }
@@ -916,7 +917,7 @@ private void insertManyNodesIndividually(IndexMaker indexMaker, int blockSize) {
916917 * Run this manually to generate images of RTree that can be used for animation.
917918 * ffmpeg -f image2 -r 12 -i rtree-single/rtree-%d.png -r 12 -s 1280x960 rtree-single2_12fps.mp4
918919 */
919- @ Ignore
920+ @ Disabled
920921 public void shouldInsertManyNodesIndividuallyAndGenerateImagesForAnimation () throws FactoryException , IOException {
921922 IndexTestConfig config = testConfigs .get ("medium" );
922923 int blockSize = 5 ;
@@ -1029,7 +1030,7 @@ private void insertManyNodesInBulk(IndexMaker indexMaker, int blockSize) {
10291030 * Run this manually to generate images of RTree that can be used for animation.
10301031 * ffmpeg -f image2 -r 12 -i rtree-single/rtree-%d.png -r 12 -s 1280x960 rtree-single2_12fps.mp4
10311032 */
1032- @ Ignore
1033+ @ Disabled
10331034 public void shouldInsertManyNodesInBulkAndGenerateImagesForAnimation () throws FactoryException , IOException {
10341035 IndexTestConfig config = testConfigs .get ("medium" );
10351036 int blockSize = 1000 ;
@@ -1085,7 +1086,7 @@ public void shouldInsertManyNodesInBulkAndGenerateImagesForAnimation() throws Fa
10851086// debugIndexTree((RTreeIndex) layer.getIndex());
10861087 }
10871088
1088- @ Ignore
1089+ @ Disabled
10891090 public void shouldAccessIndexAfterBulkInsertion () throws Exception {
10901091 // Use these two lines if you want to examine the output.
10911092// File dbPath = new File("target/var/BulkTest");
@@ -1137,7 +1138,7 @@ public void shouldAccessIndexAfterBulkInsertion() throws Exception {
11371138 Result result = tx .execute (cypher );
11381139// System.out.println(result.columns().toString());
11391140 Object obj = result .columnAs ("count" ).next ();
1140- assertTrue ( obj instanceof Long );
1141+ assertInstanceOf ( Long . class , obj );
11411142 assertEquals ((long ) ((Long ) obj ), numNodes );
11421143 tx .commit ();
11431144 }
@@ -1152,14 +1153,14 @@ public void shouldAccessIndexAfterBulkInsertion() throws Exception {
11521153 Result result = tx .execute (cypher );
11531154// System.out.println(result.columns().toString());
11541155 Object obj = result .columnAs ("count" ).next ();
1155- assertTrue ( obj instanceof Long );
1156+ assertInstanceOf ( Long . class , obj );
11561157 assertEquals ((long ) ((Long ) obj ), numNodes );
11571158 tx .commit ();
11581159 }
11591160 System .out .println ("\t " + (System .currentTimeMillis () - start ) + "ms" );
11601161 }
11611162
1162- @ Ignore
1163+ @ Disabled
11631164 public void shouldBuildTreeFromScratch () throws Exception {
11641165 //GraphDatabaseService db = this.databases.database("BultTest2");
11651166 GraphDatabaseService db = this .db ;
@@ -1215,7 +1216,7 @@ public void shouldBuildTreeFromScratch() throws Exception {
12151216 }
12161217 }
12171218
1218- @ Ignore
1219+ @ Disabled
12191220 public void shouldPerformRTreeBulkInsertion () throws Exception {
12201221 // Use this line if you want to examine the output.
12211222 //GraphDatabaseService db = databases.database("BulkTest");
@@ -1492,8 +1493,8 @@ private List<Node> queryIndex(Layer layer, TestStats stats) {
14921493 stats .put ("Indexed" , geometrySize );
14931494 System .out .println ("Index contains " + geometrySize + " geometries" );
14941495 }
1495- assertEquals ("Expected " + config .expectedGeometries + " nodes to be returned" , config . expectedGeometries ,
1496- countGeometries );
1496+ assertEquals (config .expectedGeometries , countGeometries ,
1497+ "Expected " + config . expectedGeometries + " nodes to be returned" );
14971498 return nodes ;
14981499 }
14991500
@@ -1529,7 +1530,8 @@ private void getRTreeIndexStats(RTreeIndex index, TreeMonitor monitor, TestStats
15291530 // unless the polygon is a rectangle, in which case they are not contained, leading to
15301531 // different numbers for expectedGeometries and expectedCount.
15311532 // See https://github.com/locationtech/jts/blob/master/modules/core/src/main/java/org/locationtech/jts/operation/predicate/RectangleContains.java#L70
1532- assertEquals ("Expected " + config .expectedCount + " nodes to be matched" , config .expectedCount , matched );
1533+ assertEquals (config .expectedCount , matched ,
1534+ "Expected " + config .expectedCount + " nodes to be matched" );
15331535 int maxNodeReferences = stats .maxNodeReferences ;
15341536 int maxExpectedGeometriesTouched = matched * maxNodeReferences ;
15351537 if (countGeometries > 1 && assertTouches ) {
@@ -1555,7 +1557,8 @@ private void getExplicitIndexBackedIndexStats(ExplicitIndexBackedPointIndex inde
15551557 // unless the polygon is a rectangle, in which case they are not contained, leading to
15561558 // different numbers for expectedGeometries and expectedCount.
15571559 // See https://github.com/locationtech/jts/blob/master/modules/core/src/main/java/org/locationtech/jts/operation/predicate/RectangleContains.java#L70
1558- assertEquals ("Expected " + config .expectedCount + " nodes to be matched" , config .expectedCount , matched );
1560+ assertEquals (config .expectedCount , matched ,
1561+ "Expected " + config .expectedCount + " nodes to be matched" );
15591562 }
15601563
15611564 private class TimedLogger {
@@ -1599,17 +1602,17 @@ private void log(String line, long number) {
15991602
16001603 private void verifyGeohashIndex (Layer layer ) {
16011604 LayerIndexReader index = layer .getIndex ();
1602- assertTrue ( "Index should be a geohash index" , index instanceof LayerGeohashPointIndex );
1605+ assertInstanceOf ( LayerGeohashPointIndex . class , index , "Index should be a geohash index" );
16031606 }
16041607
16051608 private void verifyHilbertIndex (Layer layer ) {
16061609 LayerIndexReader index = layer .getIndex ();
1607- assertTrue ( "Index should be a hilbert index" , index instanceof LayerHilbertPointIndex );
1610+ assertInstanceOf ( LayerHilbertPointIndex . class , index , "Index should be a hilbert index" );
16081611 }
16091612
16101613 private void verifyZOrderIndex (Layer layer ) {
16111614 LayerIndexReader index = layer .getIndex ();
1612- assertTrue ( "Index should be a Z-Order index" , index instanceof LayerZOrderPointIndex );
1615+ assertInstanceOf ( LayerZOrderPointIndex . class , index , "Index should be a Z-Order index" );
16131616 }
16141617
16151618 private void verifyTreeStructure (Layer layer , String splitMode , TestStats stats ) {
@@ -1650,7 +1653,7 @@ private void verifyTreeStructure(Layer layer, String splitMode, TestStats stats)
16501653 System .out .println ("Tree depth to all geometries: " + depthMap );
16511654 }
16521655 }
1653- assertEquals ("All geometries should be at the same depth" , 1 , balanced );
1656+ assertEquals (1 , balanced , "All geometries should be at the same depth" );
16541657 Map <String , Object > leafMap ;
16551658 try (Transaction tx = db .beginTx ()) {
16561659 Result resultNumChildren = tx .execute (queryNumChildren , params );
@@ -1803,7 +1806,7 @@ public String toString() {
18031806
18041807 private static final LinkedHashSet <TestStats > allStats = new LinkedHashSet <>();
18051808
1806- @ AfterClass
1809+ @ AfterAll
18071810 public static void afterClass () {
18081811 System .out .println ("\n \n Composite stats for " + allStats .size () + " tests run" );
18091812 System .out .println (TestStats .headerString ());
0 commit comments