This is an automated email from the ASF dual-hosted git repository.

andy pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/jena.git

commit 3b8ac4f9fa478abf7cc32d0fce5d407d58211fae
Author: Andy Seaborne <a...@apache.org>
AuthorDate: Sun Jul 20 21:10:23 2025 +0100

    Convert jena-fuseki-mod-geosparql to JUnit5
---
 .../mod/geosparql/TestFMod_SpatialIndexer.java     | 29 +++++++++++-----------
 .../mod/geosparql/TestSpatialIndexerTasks.java     | 22 ++++++++--------
 2 files changed, 27 insertions(+), 24 deletions(-)

diff --git 
a/jena-fuseki2/jena-fuseki-mod-geosparql/src/test/java/org/apache/jena/fuseki/mod/geosparql/TestFMod_SpatialIndexer.java
 
b/jena-fuseki2/jena-fuseki-mod-geosparql/src/test/java/org/apache/jena/fuseki/mod/geosparql/TestFMod_SpatialIndexer.java
index 30e0a449a5..7480be116e 100644
--- 
a/jena-fuseki2/jena-fuseki-mod-geosparql/src/test/java/org/apache/jena/fuseki/mod/geosparql/TestFMod_SpatialIndexer.java
+++ 
b/jena-fuseki2/jena-fuseki-mod-geosparql/src/test/java/org/apache/jena/fuseki/mod/geosparql/TestFMod_SpatialIndexer.java
@@ -18,12 +18,20 @@
 
 package org.apache.jena.fuseki.mod.geosparql;
 
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
 import java.io.IOException;
 import java.time.Duration;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.stream.Stream;
 
+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 io.github.bonigarcia.wdm.WebDriverManager;
 import org.apache.jena.atlas.iterator.Iter;
 import org.apache.jena.fuseki.main.FusekiServer;
 import org.apache.jena.fuseki.main.cmds.FusekiMain;
@@ -38,11 +46,6 @@ import org.apache.jena.graph.NodeFactory;
 import org.apache.jena.sparql.core.DatasetGraph;
 import org.apache.jena.sparql.core.DatasetGraphFactory;
 import org.apache.jena.sparql.core.Quad;
-import org.junit.After;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Ignore;
-import org.junit.Test;
 import org.locationtech.jts.geom.Envelope;
 import org.openqa.selenium.By;
 import org.openqa.selenium.JavascriptExecutor;
@@ -52,16 +55,14 @@ import org.openqa.selenium.chrome.ChromeDriver;
 import org.openqa.selenium.chrome.ChromeOptions;
 import org.openqa.selenium.support.ui.WebDriverWait;
 
-import io.github.bonigarcia.wdm.WebDriverManager;
-
 /**
  * Test cases that interact with the spatial indexer web UI via Selenium.
  *
- * This class is currently set to "ignore" because it requires local browser.
+ * This class is currently set to "disabled" because it requires a local 
browser.
  * Although, a headless Chrome should be started automatically,
  * this step turns out to not yet work reliable across all environments.
  */
-@Ignore
+@Disabled
 public class TestFMod_SpatialIndexer {
     private WebDriver driver;
     private JavascriptExecutor js;
@@ -71,7 +72,7 @@ public class TestFMod_SpatialIndexer {
     private SpatialIndex spatialIndex;
     private Node graphName1 = 
NodeFactory.createURI("http://www.example.org/graph1";);
 
-    @Before
+    @BeforeEach
     public void setUp() throws IOException, SpatialIndexException {
         dsg = DatasetGraphFactory.create();
         setupTestData(dsg);
@@ -126,8 +127,8 @@ public class TestFMod_SpatialIndexer {
         WebElement button = driver.findElement(By.id("apply-action"));
         button.click();
         awaitEvent();
-        Assert.assertEquals(1, spatialIndex.query(queryEnvelope, 
Quad.defaultGraphIRI).size());
-        Assert.assertEquals(2, spatialIndex.query(queryEnvelope, 
graphName1).size());
+        assertEquals(1, spatialIndex.query(queryEnvelope, 
Quad.defaultGraphIRI).size());
+        assertEquals(2, spatialIndex.query(queryEnvelope, graphName1).size());
         clearLastEvent();
 
         // Remove the named graph and update the index.
@@ -143,7 +144,7 @@ public class TestFMod_SpatialIndexer {
         try (Stream<?> s = Iter.asStream(dsg.listGraphNodes())) {
             numGraphsInDataset = s.count() + 1; // Add one for the default 
graph.
         }
-        Assert.assertEquals(numGraphsInIndex, numGraphsInDataset);
+        assertEquals(numGraphsInIndex, numGraphsInDataset);
         clearLastEvent();
     }
 
@@ -159,7 +160,7 @@ public class TestFMod_SpatialIndexer {
         js.executeScript("window.lastEvent = null");
     }
 
-    @After
+    @AfterEach
     public void tearDown() {
         if (driver != null) {
             driver.quit();
diff --git 
a/jena-fuseki2/jena-fuseki-mod-geosparql/src/test/java/org/apache/jena/fuseki/mod/geosparql/TestSpatialIndexerTasks.java
 
b/jena-fuseki2/jena-fuseki-mod-geosparql/src/test/java/org/apache/jena/fuseki/mod/geosparql/TestSpatialIndexerTasks.java
index 29c91a725d..f0b57a3880 100644
--- 
a/jena-fuseki2/jena-fuseki-mod-geosparql/src/test/java/org/apache/jena/fuseki/mod/geosparql/TestSpatialIndexerTasks.java
+++ 
b/jena-fuseki2/jena-fuseki-mod-geosparql/src/test/java/org/apache/jena/fuseki/mod/geosparql/TestSpatialIndexerTasks.java
@@ -18,6 +18,8 @@
 
 package org.apache.jena.fuseki.mod.geosparql;
 
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
 import java.util.Collection;
 import java.util.List;
 import java.util.Map;
@@ -25,12 +27,14 @@ import java.util.Set;
 import java.util.concurrent.ExecutionException;
 import java.util.function.Predicate;
 
+import org.junit.jupiter.api.Test;
+
 import org.apache.jena.geosparql.implementation.vocabulary.SRS_URI;
 import org.apache.jena.geosparql.spatial.SpatialIndexException;
 import org.apache.jena.geosparql.spatial.index.v2.GeometryGenerator;
 import 
org.apache.jena.geosparql.spatial.index.v2.GeometryGenerator.GeometryType;
-import org.apache.jena.geosparql.spatial.index.v2.SpatialIndexPerGraph;
 import org.apache.jena.geosparql.spatial.index.v2.SpatialIndexLib;
+import org.apache.jena.geosparql.spatial.index.v2.SpatialIndexPerGraph;
 import org.apache.jena.geosparql.spatial.index.v2.SpatialIndexerComputation;
 import org.apache.jena.graph.Graph;
 import org.apache.jena.graph.Node;
@@ -38,8 +42,6 @@ import org.apache.jena.graph.NodeFactory;
 import org.apache.jena.sparql.core.DatasetGraph;
 import org.apache.jena.sparql.core.DatasetGraphFactory;
 import org.apache.jena.sparql.core.Quad;
-import org.junit.Assert;
-import org.junit.Test;
 import org.locationtech.jts.geom.Envelope;
 
 /** Test cases that check for whether the correct graphs are indexed - also 
when a user is only authorized to a certain subset of graphs. */
@@ -112,7 +114,7 @@ public class TestSpatialIndexerTasks {
         SpatialIndexPerGraph spatialIndex = updateSpatialIndex(dsg, null, 
SRS_URI.DEFAULT_WKT_CRS84, updateGraphs);
 
         Set<Node> indexedGraphNodes = 
spatialIndex.getIndex().getTreeMap().keySet();
-        Assert.assertEquals(allGraphs, indexedGraphNodes);
+        assertEquals(allGraphs, indexedGraphNodes);
     }
 
     @Test
@@ -125,7 +127,7 @@ public class TestSpatialIndexerTasks {
         SpatialIndexPerGraph spatialIndex = replaceSpatialIndex(dsg, null, 
SRS_URI.DEFAULT_WKT_CRS84, expectedGraphSet);
 
         Set<Node> actualGraphSet = 
spatialIndex.getIndex().getTreeMap().keySet();
-        Assert.assertEquals(expectedGraphSet, actualGraphSet);
+        assertEquals(expectedGraphSet, actualGraphSet);
     }
 
     @Test
@@ -139,7 +141,7 @@ public class TestSpatialIndexerTasks {
         SpatialIndexPerGraph spatialIndex = clean(dsg, null);
         Set<Node> actual = spatialIndex.getIndex().getTreeMap().keySet();
         Set<Node> expected = Set.of(dg, g4);;
-        Assert.assertEquals(expected, actual);
+        assertEquals(expected, actual);
     }
 
     @Test
@@ -155,7 +157,7 @@ public class TestSpatialIndexerTasks {
         SpatialIndexPerGraph spatialIndex = updateSpatialIndex(dsg, 
authorizedGraph::contains, SRS_URI.DEFAULT_WKT_CRS84, updateGraphs);
 
         Set<Node> indexedGraphNodes = 
spatialIndex.getIndex().getTreeMap().keySet();
-        Assert.assertEquals(allGraphs, indexedGraphNodes);
+        assertEquals(allGraphs, indexedGraphNodes);
     }
 
     @Test
@@ -173,7 +175,7 @@ public class TestSpatialIndexerTasks {
         SpatialIndexPerGraph spatialIndex = replaceSpatialIndex(dsg, 
authorizedGraphs::contains, SRS_URI.DEFAULT_WKT_CRS84, replaceGraphs);
 
         Set<Node> indexedGraphNodes = 
spatialIndex.getIndex().getTreeMap().keySet();
-        Assert.assertEquals(expectedGraphs, indexedGraphNodes);
+        assertEquals(expectedGraphs, indexedGraphNodes);
     }
 
     @Test
@@ -189,7 +191,7 @@ public class TestSpatialIndexerTasks {
         SpatialIndexPerGraph spatialIndex = clean(dsg, 
authorizedGraphs::contains);
         Set<Node> actual = spatialIndex.getIndex().getTreeMap().keySet();
         Set<Node> expected = Set.of(dg, g1, g2, g3);
-        Assert.assertEquals(expected, actual);
+        assertEquals(expected, actual);
     }
 
     @Test
@@ -204,6 +206,6 @@ public class TestSpatialIndexerTasks {
         SpatialIndexPerGraph spatialIndex = clean(dsg, 
authorizedGraphs::contains);
         Set<Node> actual = spatialIndex.getIndex().getTreeMap().keySet();
         Set<Node> expected = Set.of(dg, g1, g2, g4);
-        Assert.assertEquals(expected, actual);
+        assertEquals(expected, actual);
     }
 }

Reply via email to