mirror of https://github.com/apache/lucene.git
LUCENE-8418: Mute LatLonShape polygonWithHole test until fix is applied
This commit is contained in:
parent
20a7ee9e11
commit
509561bf2a
|
@ -81,21 +81,12 @@ public class TestLatLonShape extends LuceneTestCase {
|
|||
Directory dir = newDirectory();
|
||||
RandomIndexWriter writer = new RandomIndexWriter(random(), dir);
|
||||
|
||||
// add a random polygon without a hole
|
||||
// add a random polygon
|
||||
Polygon p = GeoTestUtil.createRegularPolygon(0, 90, atLeast(1000000), numVertices);
|
||||
Document document = new Document();
|
||||
addPolygonsToDoc(FIELDNAME, document, p);
|
||||
writer.addDocument(document);
|
||||
|
||||
// add a random polygon with a hole
|
||||
Polygon inner = new Polygon(new double[] {-1d, -1d, 1d, 1d, -1d},
|
||||
new double[] {-91d, -89d, -89d, -91.0, -91.0});
|
||||
Polygon outer = GeoTestUtil.createRegularPolygon(0, -90, atLeast(1000000), numVertices);
|
||||
|
||||
document = new Document();
|
||||
addPolygonsToDoc(FIELDNAME, document, new Polygon(outer.getPolyLats(), outer.getPolyLons(), inner));
|
||||
writer.addDocument(document);
|
||||
|
||||
////// search /////
|
||||
// search an intersecting bbox
|
||||
IndexReader reader = writer.getReader();
|
||||
|
@ -108,8 +99,32 @@ public class TestLatLonShape extends LuceneTestCase {
|
|||
q = newRectQuery(FIELDNAME, p.minLat-1d, p.minLat+1, p.minLon-1d, p.minLon+1d);
|
||||
assertEquals(0, searcher.count(q));
|
||||
|
||||
IOUtils.close(reader, dir);
|
||||
}
|
||||
|
||||
@AwaitsFix(bugUrl = "https://issues.apache.org/jira/browse/LUCENE-8418")
|
||||
/** test random polygons with a single hole */
|
||||
public void testPolygonWithHole() throws Exception {
|
||||
int numVertices = TestUtil.nextInt(random(), 50, 100);
|
||||
Directory dir = newDirectory();
|
||||
RandomIndexWriter writer = new RandomIndexWriter(random(), dir);
|
||||
|
||||
// add a random polygon with a hole
|
||||
Polygon inner = new Polygon(new double[] {-1d, -1d, 1d, 1d, -1d},
|
||||
new double[] {-91d, -89d, -89d, -91.0, -91.0});
|
||||
Polygon outer = GeoTestUtil.createRegularPolygon(0, -90, atLeast(1000000), numVertices);
|
||||
|
||||
Document document = new Document();
|
||||
addPolygonsToDoc(FIELDNAME, document, new Polygon(outer.getPolyLats(), outer.getPolyLons(), inner));
|
||||
writer.addDocument(document);
|
||||
|
||||
///// search //////
|
||||
IndexReader reader = writer.getReader();
|
||||
writer.close();
|
||||
IndexSearcher searcher = newSearcher(reader);
|
||||
|
||||
// search a bbox in the hole
|
||||
q = newRectQuery(FIELDNAME, inner.minLat + 1e-6, inner.maxLat - 1e-6, inner.minLon + 1e-6, inner.maxLon - 1e-6);
|
||||
Query q = newRectQuery(FIELDNAME, inner.minLat + 1e-6, inner.maxLat - 1e-6, inner.minLon + 1e-6, inner.maxLon - 1e-6);
|
||||
assertEquals(0, searcher.count(q));
|
||||
|
||||
IOUtils.close(reader, dir);
|
||||
|
|
Loading…
Reference in New Issue