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 2014/03/21 23:07:04 UTC
svn commit: r1580070 -
/lucene/dev/trunk/lucene/spatial/src/test/org/apache/lucene/spatial/prefix/SpatialOpRecursivePrefixTreeTest.java
Author: dsmiley
Date: Fri Mar 21 22:07:04 2014
New Revision: 1580070
URL: http://svn.apache.org/r1580070
Log:
LUCENE-5549: punting on this test bug for now
Modified:
lucene/dev/trunk/lucene/spatial/src/test/org/apache/lucene/spatial/prefix/SpatialOpRecursivePrefixTreeTest.java
Modified: lucene/dev/trunk/lucene/spatial/src/test/org/apache/lucene/spatial/prefix/SpatialOpRecursivePrefixTreeTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/spatial/src/test/org/apache/lucene/spatial/prefix/SpatialOpRecursivePrefixTreeTest.java?rev=1580070&r1=1580069&r2=1580070&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/spatial/src/test/org/apache/lucene/spatial/prefix/SpatialOpRecursivePrefixTreeTest.java (original)
+++ lucene/dev/trunk/lucene/spatial/src/test/org/apache/lucene/spatial/prefix/SpatialOpRecursivePrefixTreeTest.java Fri Mar 21 22:07:04 2014
@@ -20,6 +20,7 @@ package org.apache.lucene.spatial.prefix
import com.carrotsearch.randomizedtesting.annotations.Repeat;
import com.spatial4j.core.context.SpatialContext;
import com.spatial4j.core.context.SpatialContextFactory;
+import com.spatial4j.core.shape.Point;
import com.spatial4j.core.shape.Rectangle;
import com.spatial4j.core.shape.Shape;
import com.spatial4j.core.shape.ShapeCollection;
@@ -270,11 +271,13 @@ public class SpatialOpRecursivePrefixTre
final Shape queryShape;
switch (randomInt(10)) {
case 0: queryShape = randomPoint(); break;
- case 1:case 2:case 3:
- if (!indexedAtLeastOneShapePair) { // avoids ShapePair.relate(ShapePair), which isn't reliable
- queryShape = randomShapePairRect(!biasContains);//invert biasContains for query side
- break;
- }
+// LUCENE-5549
+//TODO debug: -Dtests.method=testWithin -Dtests.multiplier=3 -Dtests.seed=5F5294CE2E075A3E:AAD2F0F79288CA64
+// case 1:case 2:case 3:
+// if (!indexedAtLeastOneShapePair) { // avoids ShapePair.relate(ShapePair), which isn't reliable
+// queryShape = randomShapePairRect(!biasContains);//invert biasContains for query side
+// break;
+// }
default: queryShape = randomRectangle();
}
final Shape queryShapeGS = gridSnap(queryShape);
@@ -368,6 +371,13 @@ public class SpatialOpRecursivePrefixTre
ShapePair me = (ShapePair) snapMe;
return new ShapePair(gridSnap(me.shape1), gridSnap(me.shape2), me.biasContainsThenWithin);
}
+ if (ctx.isGeo()) {
+ //A hack; works around issue with (dateline) wrap-around when the point or rect is exactly
+ // adjacent to the dateline.
+ if (snapMe instanceof Point) {
+ snapMe = snapMe.getBoundingBox();
+ }
+ }
//The next 4 lines mimic PrefixTreeStrategy.createIndexableFields()
double distErrPct = ((PrefixTreeStrategy) strategy).getDistErrPct();
double distErr = SpatialArgs.calcDistanceFromErrPct(snapMe, distErrPct, ctx);