From 264f6d5459238d162a10fc4c8fa97f5da4c1d364 Mon Sep 17 00:00:00 2001 From: Hemanth Madala Date: Tue, 10 Nov 2026 00:39:32 +0530 Subject: [PATCH] Revert "Update ClientApiFunctionalTest.java" This reverts commit eb7d50f5aaaeaf9c90b675f7c9ddb758e778a19b. MLE-33562 Re-enable the 8 dead methods in GeospatialRegionQueriesTest Root cause: the methods were never run. They had @Ignore and no @Test under JUnit 4, and the JUnit 5 migration (3ff91b9cc) turned @Ignore into @Disabled without adding @Test. The test-app already defines the geospatial region path indexes on /country/region (wgs84 and wgs84/double), so no index change is needed. Restored @Test on all 8 methods. Seven passed as-is. testGeospatialRegionDoubleQuery failed because it queried a point 2e-8 degrees from the polygon vertex, which is inside the server's double-precision tolerance, so the wgs84/double query matched. Float precision matches any point within about 1e-6 of the vertex and double precision distinguishes anything from about 1e-7 upward, so the query point is now 10.0000003, inside that band. testGeospatialRegionQuery only asserted inside a loop over the results, so it passed with zero results; it now asserts exactly one result. MLE-33562 Temporarily pin PR build to MarkLogic 12.2.20261005 latest-12 now resolves to 12.2.20261109, where mlDeploy fails with XDMP-BAD (Bad ElemNode::elemNodeRep) in temporal:set-lsqt-automation. Pin the PR stage to the previous build by digest. Revert to :latest-12 once the server is fixed. Update ClientApiFunctionalTest.java Revert "MLE-33562 Temporarily pin PR build to MarkLogic 12.2.20261005" This reverts commit 86059471b2c3bd4deb78f98165aaa3cbc59afc1f. Co-Authored-By: Copilot <223556219+Copilot@users.noreply.github.com> --- .../test/GeospatialRegionQueriesTest.java | 30 +++++++++++-------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/marklogic-client-api/src/test/java/com/marklogic/client/test/GeospatialRegionQueriesTest.java b/marklogic-client-api/src/test/java/com/marklogic/client/test/GeospatialRegionQueriesTest.java index 2adb961d1..f2f1dde78 100644 --- a/marklogic-client-api/src/test/java/com/marklogic/client/test/GeospatialRegionQueriesTest.java +++ b/marklogic-client-api/src/test/java/com/marklogic/client/test/GeospatialRegionQueriesTest.java @@ -15,7 +15,7 @@ import com.marklogic.client.query.StructuredQueryBuilder.GeospatialOperator; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import org.w3c.dom.Document; import org.w3c.dom.Element; @@ -132,7 +132,7 @@ private static void buildEnvironment() throws ParserConfigurationException { Common.propertyWait(); } - @Disabled + @Test public void testGeospatialRegionQuery() { QueryManager queryMgr = Common.client.newQueryManager(); StructuredQueryBuilder qb = new StructuredQueryBuilder(); @@ -143,12 +143,13 @@ public void testGeospatialRegionQuery() { SearchHandle results = queryMgr.search(qdef, new SearchHandle()); MatchDocumentSummary[] summaries = results.getMatchResults(); + assertEquals(1, summaries.length); for (MatchDocumentSummary summary : summaries) { assertEquals("mexico.xml", summary.getUri()); } } - @Disabled + @Test public void testFloatPrecision() { QueryManager queryMgr = Common.client.newQueryManager(); StructuredQueryBuilder qb = new StructuredQueryBuilder(); @@ -163,7 +164,7 @@ public void testFloatPrecision() { assertEquals(2, summaries.length); } - @Disabled + @Test public void testDoublePrecision() { QueryManager queryMgr = Common.client.newQueryManager(); StructuredQueryBuilder qb = new StructuredQueryBuilder(); @@ -178,7 +179,7 @@ public void testDoublePrecision() { assertEquals(1, summaries.length); } - @Disabled + @Test public void testGeospatialRegionDoubleQuery() { String options = "" + " filtered" @@ -193,33 +194,36 @@ public void testGeospatialRegionDoubleQuery() { StructuredQueryBuilder qb = new StructuredQueryBuilder("geodoubleoptions"); StructuredQueryDefinition qdef; + // The polygon's far corner is at 10.00000001. Float precision cannot tell that apart from a point at 10.0000003, + // but double precision can; a gap as small as 2e-8 is within the server's double-precision tolerance. + final double pointCoordinate = 10.0000003; qdef = qb.geospatial(qb.geoRegionPath(qb.pathIndex("/country/region"), CoordinateSystem.WGS84DOUBLE), GeospatialOperator.COVERS, - qb.point(10.00000003, 10.00000003)); + qb.point(pointCoordinate, pointCoordinate)); SearchHandle results = queryMgr.search(qdef, new SearchHandle()); MatchDocumentSummary[] summaries = results.getMatchResults(); assertEquals(0, summaries.length); qdef = qb.geospatial(qb.geoRegionPath(qb.pathIndex("/country/region"), CoordinateSystem.WGS84), GeospatialOperator.COVERS, - qb.point(10.00000003, 10.00000003)); + qb.point(pointCoordinate, pointCoordinate)); results = queryMgr.search(qdef, new SearchHandle()); summaries = results.getMatchResults(); assertEquals(1, summaries.length); qdef = qb.geospatial(qb.geoRegionPath(qb.pathIndex("/country/region"), CoordinateSystem.getOther("wgs84", true)), GeospatialOperator.COVERS, - qb.point(10.00000003, 10.00000003)); + qb.point(pointCoordinate, pointCoordinate)); results = queryMgr.search(qdef, new SearchHandle()); summaries = results.getMatchResults(); assertEquals(0, summaries.length); qdef = qb.geospatial(qb.geoRegionPath(qb.pathIndex("/country/region"), CoordinateSystem.getOther("wgs84")), GeospatialOperator.COVERS, - qb.point(10.00000003, 10.00000003)); + qb.point(pointCoordinate, pointCoordinate)); results = queryMgr.search(qdef, new SearchHandle()); summaries = results.getMatchResults(); assertEquals(1, summaries.length); optionsMgr.deleteOptions("geodoubleoptions"); } - @Disabled + @Test public void testFloatPrecisionCoordinateSystem() { QueryManager queryMgr = Common.client.newQueryManager(); StructuredQueryBuilder qb = new StructuredQueryBuilder(); @@ -234,7 +238,7 @@ public void testFloatPrecisionCoordinateSystem() { assertEquals(2, summaries.length); } - @Disabled + @Test public void testDoublePrecisionCoordinateSystem() { QueryManager queryMgr = Common.client.newQueryManager(); StructuredQueryBuilder qb = new StructuredQueryBuilder(); @@ -249,7 +253,7 @@ public void testDoublePrecisionCoordinateSystem() { assertEquals(1, summaries.length); } - @Disabled + @Test public void testGeospatialRegionQueryConstraint() { QueryManager queryMgr = Common.client.newQueryManager(); StructuredQueryBuilder qb = queryMgr.newStructuredQueryBuilder(); @@ -279,7 +283,7 @@ public void testGeospatialRegionQueryConstraint() { } } - @Disabled + @Test public void testGeospatialRegionQueryOptionsConstraint() { String options = "" + " "