OSQ-8696: Come up with a simple test case that exercises the random failure

This commit is contained in:
Karl Wright 2019-02-25 03:33:35 -05:00
parent f5a4159d75
commit 3754959797
1 changed files with 26 additions and 1 deletions

View File

@ -23,7 +23,9 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertTrue;
public class GeoPathTest { import org.apache.lucene.util.LuceneTestCase;
public class GeoPathTest extends LuceneTestCase {
@Test @Test
public void testPathDistance() { 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);
}
} }