You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ds...@apache.org on 2012/09/08 20:30:10 UTC

svn commit: r1382337 - /lucene/dev/trunk/lucene/spatial/src/test/org/apache/lucene/spatial/prefix/TestRecursivePrefixTreeStrategy.java

Author: dsmiley
Date: Sat Sep  8 18:30:09 2012
New Revision: 1382337

URL: http://svn.apache.org/viewvc?rev=1382337&view=rev
Log:
LUCENE-4351 fix edge case in test; removing @Ignore now.

Modified:
    lucene/dev/trunk/lucene/spatial/src/test/org/apache/lucene/spatial/prefix/TestRecursivePrefixTreeStrategy.java

Modified: lucene/dev/trunk/lucene/spatial/src/test/org/apache/lucene/spatial/prefix/TestRecursivePrefixTreeStrategy.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/spatial/src/test/org/apache/lucene/spatial/prefix/TestRecursivePrefixTreeStrategy.java?rev=1382337&r1=1382336&r2=1382337&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/spatial/src/test/org/apache/lucene/spatial/prefix/TestRecursivePrefixTreeStrategy.java (original)
+++ lucene/dev/trunk/lucene/spatial/src/test/org/apache/lucene/spatial/prefix/TestRecursivePrefixTreeStrategy.java Sat Sep  8 18:30:09 2012
@@ -32,7 +32,6 @@ import org.apache.lucene.spatial.Strateg
 import org.apache.lucene.spatial.prefix.tree.GeohashPrefixTree;
 import org.apache.lucene.spatial.query.SpatialArgs;
 import org.apache.lucene.spatial.query.SpatialOperation;
-import org.junit.Ignore;
 import org.junit.Test;
 
 import java.io.IOException;
@@ -109,12 +108,12 @@ public class TestRecursivePrefixTreeStra
     checkHits(q(qPt, 34 * KM2DEG, distErrPct), 0, null);
   }
 
-  @Test @Ignore /* LUCENE-4351 ignore this test until I figure out why it failed (as reported by Jenkins) */
+  @Test
   public void geohashRecursiveRandom() throws IOException {
     init(12);
 
     //1. Iterate test with the cluster at some worldly point of interest
-    Point[] clusterCenters = new Point[]{ctx.makePoint(0,0), ctx.makePoint(0,90), ctx.makePoint(0,-90)};
+    Point[] clusterCenters = new Point[]{ctx.makePoint(-180,0), ctx.makePoint(0,90), ctx.makePoint(0,-90)};
     for (Point clusterCenter : clusterCenters) {
       //2. Iterate on size of cluster (a really small one and a large one)
       String hashCenter = GeohashUtils.encodeLatLon(clusterCenter.getY(), clusterCenter.getX(), maxLength);
@@ -144,10 +143,10 @@ public class TestRecursivePrefixTreeStra
         //3. Use some query centers. Each is twice the cluster's radius away.
         for(int ri = 0; ri < 4; ri++) {
           Point queryCenter = ctx.getDistCalc().pointOnBearing(clusterCenter,
-              radiusDeg*2, random().nextInt() * 360, ctx, null);
+              radiusDeg*2, random().nextInt(360), ctx, null);
           queryCenter = alignGeohash(queryCenter);
           //4.1 Query a small box getting nothing
-          checkHits(q(queryCenter, radiusDeg*0.99), 0, null);
+          checkHits(q(queryCenter, radiusDeg - smallRadius/2), 0, null);
           //4.2 Query a large box enclosing the cluster, getting everything
           checkHits(q(queryCenter, radiusDeg*3*1.01), points.size(), null);
           //4.3 Query a medium box getting some (calculate the correct solution and verify)