From commits-return-102445-archive-asf-public=cust-asf.ponee.io@lucene.apache.org Sat Jul 28 06:49:27 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 3DC95180677 for ; Sat, 28 Jul 2018 06:49:27 +0200 (CEST) Received: (qmail 63191 invoked by uid 500); 28 Jul 2018 04:49:25 -0000 Mailing-List: contact commits-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@lucene.apache.org Delivered-To: mailing list commits@lucene.apache.org Received: (qmail 62782 invoked by uid 99); 28 Jul 2018 04:49:25 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 28 Jul 2018 04:49:25 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id EA8A5E090E; Sat, 28 Jul 2018 04:49:24 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: shalin@apache.org To: commits@lucene.apache.org Date: Sat, 28 Jul 2018 04:49:27 -0000 Message-Id: In-Reply-To: <4cf611223e9848ea9aed676541fc733c@git.apache.org> References: <4cf611223e9848ea9aed676541fc733c@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [04/50] [abbrv] lucene-solr:jira/solr-11990: LUCENE-8418: Mute LatLonShape polygonWithHole test until fix is applied LUCENE-8418: Mute LatLonShape polygonWithHole test until fix is applied Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/509561bf Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/509561bf Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/509561bf Branch: refs/heads/jira/solr-11990 Commit: 509561bf2a9effe4fce19551c9ec037975cf9c02 Parents: 20a7ee9 Author: Nicholas Knize Authored: Fri Jul 20 11:18:58 2018 -0500 Committer: Nicholas Knize Committed: Fri Jul 20 11:36:47 2018 -0500 ---------------------------------------------------------------------- .../apache/lucene/document/TestLatLonShape.java | 37 ++++++++++++++------ 1 file changed, 26 insertions(+), 11 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/509561bf/lucene/sandbox/src/test/org/apache/lucene/document/TestLatLonShape.java ---------------------------------------------------------------------- diff --git a/lucene/sandbox/src/test/org/apache/lucene/document/TestLatLonShape.java b/lucene/sandbox/src/test/org/apache/lucene/document/TestLatLonShape.java index d0a4b32..ac11e1b 100644 --- a/lucene/sandbox/src/test/org/apache/lucene/document/TestLatLonShape.java +++ b/lucene/sandbox/src/test/org/apache/lucene/document/TestLatLonShape.java @@ -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);