You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by kw...@apache.org on 2019/02/25 08:37:02 UTC
[lucene-solr] branch branch_7x updated: OSQ-8696: Come up with a
simple test case that exercises the random failure
This is an automated email from the ASF dual-hosted git repository.
kwright pushed a commit to branch branch_7x
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git
The following commit(s) were added to refs/heads/branch_7x by this push:
new 0be23fb OSQ-8696: Come up with a simple test case that exercises the random failure
0be23fb is described below
commit 0be23fbf3cb4eebc3026968e52961e95309863c7
Author: Karl Wright <Da...@gmail.com>
AuthorDate: Mon Feb 25 03:33:35 2019 -0500
OSQ-8696: Come up with a simple test case that exercises the random failure
---
.../apache/lucene/spatial3d/geom/GeoPathTest.java | 27 +++++++++++++++++++++-
1 file changed, 26 insertions(+), 1 deletion(-)
diff --git a/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/GeoPathTest.java b/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/GeoPathTest.java
index 93f90f4..f1c2f42 100755
--- a/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/GeoPathTest.java
+++ b/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/GeoPathTest.java
@@ -23,7 +23,9 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
-public class GeoPathTest {
+import org.apache.lucene.util.LuceneTestCase;
+
+public class GeoPathTest extends LuceneTestCase {
@Test
public void testPathDistance() {
@@ -402,4 +404,27 @@ public class GeoPathTest {
}
+ @Test
+ @AwaitsFix(bugUrl="https://issues.apache.org/jira/browse/LUCENE-8696")
+ public void testLUCEN8696() {
+ GeoPoint[] points = new GeoPoint[4];
+ points[0] = new GeoPoint(PlanetModel.WGS84, 2.4457272005608357E-47, 0.017453291479645996);
+ points[1] = new GeoPoint(PlanetModel.WGS84, 2.4457272005608357E-47, 0.8952476719156919);
+ points[2] = new GeoPoint(PlanetModel.WGS84, 2.4457272005608357E-47, 0.6491968536639036);
+ points[3] = new GeoPoint(PlanetModel.WGS84, -0.7718789008737459, 0.9236607495528212);
+ GeoPath path = GeoPathFactory.makeGeoPath(PlanetModel.WGS84, 1.3439035240356338, points);
+ GeoPoint check = new GeoPoint(0.02071783020158524, 0.9523290535474472, 0.30699177256064203);
+ // Construct a bounding box from the shape
+ XYZBounds bounds = new XYZBounds();
+ path.getBounds(bounds);
+ XYZSolid solid = XYZSolidFactory.makeXYZSolid(PlanetModel.WGS84, bounds);
+
+ // If point is within solid, it must be within shape
+ assertTrue(solid.isWithin(check));
+ assertTrue(path.isWithin(check));
+
+ //GeoPoint surfaceCheck = PlanetModel.WGS84.createSurfacePoint(check);
+
+ }
+
}