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 2015/05/06 16:24:45 UTC

svn commit: r1678005 - in /lucene/dev/trunk: ./ lucene/ lucene/spatial/ lucene/spatial/src/java/org/apache/lucene/spatial/spatial4j/ lucene/spatial/src/test/org/apache/lucene/spatial/prefix/ lucene/spatial/src/test/org/apache/lucene/spatial/spatial4j/

Author: dsmiley
Date: Wed May  6 14:24:44 2015
New Revision: 1678005

URL: http://svn.apache.org/r1678005
Log:
LUCENE-6196: Geo3d API, 3d planar geometry for surface of a sphere.
This merge commit renames a couple test utilities that appeared to be tests but weren't.

Added:
    lucene/dev/trunk/lucene/spatial/src/java/org/apache/lucene/spatial/spatial4j/
      - copied from r1678001, lucene/dev/branches/lucene6196/lucene/spatial/src/java/org/apache/lucene/spatial/spatial4j/
    lucene/dev/trunk/lucene/spatial/src/test/org/apache/lucene/spatial/spatial4j/
      - copied from r1678001, lucene/dev/branches/lucene6196/lucene/spatial/src/test/org/apache/lucene/spatial/spatial4j/
    lucene/dev/trunk/lucene/spatial/src/test/org/apache/lucene/spatial/spatial4j/LogRule.java
      - copied, changed from r1678001, lucene/dev/branches/lucene6196/lucene/spatial/src/test/org/apache/lucene/spatial/spatial4j/TestLog.java
    lucene/dev/trunk/lucene/spatial/src/test/org/apache/lucene/spatial/spatial4j/RandomizedShapeTestCase.java
      - copied, changed from r1678001, lucene/dev/branches/lucene6196/lucene/spatial/src/test/org/apache/lucene/spatial/spatial4j/RandomizedShapeTest.java
Removed:
    lucene/dev/trunk/lucene/spatial/src/test/org/apache/lucene/spatial/spatial4j/RandomizedShapeTest.java
    lucene/dev/trunk/lucene/spatial/src/test/org/apache/lucene/spatial/spatial4j/TestLog.java
Modified:
    lucene/dev/trunk/   (props changed)
    lucene/dev/trunk/lucene/   (props changed)
    lucene/dev/trunk/lucene/CHANGES.txt
    lucene/dev/trunk/lucene/spatial/   (props changed)
    lucene/dev/trunk/lucene/spatial/src/test/org/apache/lucene/spatial/prefix/RandomSpatialOpStrategyTestCase.java
    lucene/dev/trunk/lucene/spatial/src/test/org/apache/lucene/spatial/spatial4j/Geo3dShapeRectRelationTest.java
    lucene/dev/trunk/lucene/spatial/src/test/org/apache/lucene/spatial/spatial4j/RectIntersectionTestHelper.java

Modified: lucene/dev/trunk/lucene/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/CHANGES.txt?rev=1678005&r1=1678004&r2=1678005&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/CHANGES.txt (original)
+++ lucene/dev/trunk/lucene/CHANGES.txt Wed May  6 14:24:44 2015
@@ -92,6 +92,12 @@ New Features
   expression helper VariableContext
   (Jack Conradson via Ryan Ernst)
 
+* LUCENE-6196: New Spatial "Geo3d" API with partial Spatial4j integration.
+  It is a set of shapes implemented using 3D planar geometry for calculating
+  spatial relations on the surface of a sphere. Shapes include Point, BBox,
+  Circle, Path (buffered line string), and Polygon.
+  (Karl Wright via David Smiley)
+
 Optimizations
 
 * LUCENE-6379: IndexWriter.deleteDocuments(Query...) now detects if

Modified: lucene/dev/trunk/lucene/spatial/src/test/org/apache/lucene/spatial/prefix/RandomSpatialOpStrategyTestCase.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/spatial/src/test/org/apache/lucene/spatial/prefix/RandomSpatialOpStrategyTestCase.java?rev=1678005&r1=1678004&r2=1678005&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/spatial/src/test/org/apache/lucene/spatial/prefix/RandomSpatialOpStrategyTestCase.java (original)
+++ lucene/dev/trunk/lucene/spatial/src/test/org/apache/lucene/spatial/prefix/RandomSpatialOpStrategyTestCase.java Wed May  6 14:24:44 2015
@@ -113,12 +113,12 @@ public abstract class RandomSpatialOpStr
       for (SearchResult result : got.results) {
         String id = result.getId();
         if (!remainingExpectedIds.remove(id)) {
-          fail("Shouldn't match", id, indexedShapes, queryShape, operation);
+          fail("qIdx:" + queryIdx + " Shouldn't match", id, indexedShapes, queryShape, operation);
         }
       }
       if (!remainingExpectedIds.isEmpty()) {
         String id = remainingExpectedIds.iterator().next();
-        fail("Should have matched", id, indexedShapes, queryShape, operation);
+        fail("qIdx:" + queryIdx + " Should have matched", id, indexedShapes, queryShape, operation);
       }
     }
   }

Modified: lucene/dev/trunk/lucene/spatial/src/test/org/apache/lucene/spatial/spatial4j/Geo3dShapeRectRelationTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/spatial/src/test/org/apache/lucene/spatial/spatial4j/Geo3dShapeRectRelationTest.java?rev=1678005&r1=1678001&r2=1678005&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/spatial/src/test/org/apache/lucene/spatial/spatial4j/Geo3dShapeRectRelationTest.java (original)
+++ lucene/dev/trunk/lucene/spatial/src/test/org/apache/lucene/spatial/spatial4j/Geo3dShapeRectRelationTest.java Wed May  6 14:24:44 2015
@@ -39,9 +39,9 @@ import org.junit.Test;
 
 import static com.spatial4j.core.distance.DistanceUtils.DEGREES_TO_RADIANS;
 
-public class Geo3dShapeRectRelationTest extends RandomizedShapeTest {
+public class Geo3dShapeRectRelationTest extends RandomizedShapeTestCase {
   @Rule
-  public final TestLog testLog = TestLog.instance;
+  public final LogRule testLog = LogRule.instance;
 
   static Random random() {
     return RandomizedContext.current().getRandom();

Copied: lucene/dev/trunk/lucene/spatial/src/test/org/apache/lucene/spatial/spatial4j/LogRule.java (from r1678001, lucene/dev/branches/lucene6196/lucene/spatial/src/test/org/apache/lucene/spatial/spatial4j/TestLog.java)
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/spatial/src/test/org/apache/lucene/spatial/spatial4j/LogRule.java?p2=lucene/dev/trunk/lucene/spatial/src/test/org/apache/lucene/spatial/spatial4j/LogRule.java&p1=lucene/dev/branches/lucene6196/lucene/spatial/src/test/org/apache/lucene/spatial/spatial4j/TestLog.java&r1=1678001&r2=1678005&rev=1678005&view=diff
==============================================================================
--- lucene/dev/branches/lucene6196/lucene/spatial/src/test/org/apache/lucene/spatial/spatial4j/TestLog.java (original)
+++ lucene/dev/trunk/lucene/spatial/src/test/org/apache/lucene/spatial/spatial4j/LogRule.java Wed May  6 14:24:44 2015
@@ -28,15 +28,15 @@ import com.carrotsearch.randomizedtestin
  * test failure only.  Add this to a JUnit based test class with a {@link org.junit.Rule}
  * annotation.
  */
-public class TestLog extends TestRuleAdapter {
+public class LogRule extends TestRuleAdapter {
 
   //TODO does this need to be threadsafe (such as via thread-local state)?
   private static ArrayList<LogEntry> logStack = new ArrayList<LogEntry>();
   private static final int MAX_LOGS = 1000;
 
-  public static final TestLog instance = new TestLog();
+  public static final LogRule instance = new LogRule();
 
-  private TestLog() {}
+  private LogRule() {}
 
   @Override
   protected void before() throws Throwable {

Copied: lucene/dev/trunk/lucene/spatial/src/test/org/apache/lucene/spatial/spatial4j/RandomizedShapeTestCase.java (from r1678001, lucene/dev/branches/lucene6196/lucene/spatial/src/test/org/apache/lucene/spatial/spatial4j/RandomizedShapeTest.java)
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/spatial/src/test/org/apache/lucene/spatial/spatial4j/RandomizedShapeTestCase.java?p2=lucene/dev/trunk/lucene/spatial/src/test/org/apache/lucene/spatial/spatial4j/RandomizedShapeTestCase.java&p1=lucene/dev/branches/lucene6196/lucene/spatial/src/test/org/apache/lucene/spatial/spatial4j/RandomizedShapeTest.java&r1=1678001&r2=1678005&rev=1678005&view=diff
==============================================================================
--- lucene/dev/branches/lucene6196/lucene/spatial/src/test/org/apache/lucene/spatial/spatial4j/RandomizedShapeTest.java (original)
+++ lucene/dev/trunk/lucene/spatial/src/test/org/apache/lucene/spatial/spatial4j/RandomizedShapeTestCase.java Wed May  6 14:24:44 2015
@@ -35,7 +35,7 @@ import static com.spatial4j.core.shape.S
  * A base test class with utility methods to help test shapes.
  * Extends from RandomizedTest.
  */
-public abstract class RandomizedShapeTest extends RandomizedTest {
+public abstract class RandomizedShapeTestCase extends RandomizedTest {
 
   protected static final double EPS = 10e-9;
 
@@ -47,10 +47,10 @@ public abstract class RandomizedShapeTes
    */
   protected final double DIVISIBLE = 2;// even coordinates; (not always used)
 
-  protected RandomizedShapeTest() {
+  protected RandomizedShapeTestCase() {
   }
 
-  public RandomizedShapeTest(SpatialContext ctx) {
+  public RandomizedShapeTestCase(SpatialContext ctx) {
     this.ctx = ctx;
   }
 

Modified: lucene/dev/trunk/lucene/spatial/src/test/org/apache/lucene/spatial/spatial4j/RectIntersectionTestHelper.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/spatial/src/test/org/apache/lucene/spatial/spatial4j/RectIntersectionTestHelper.java?rev=1678005&r1=1678001&r2=1678005&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/spatial/src/test/org/apache/lucene/spatial/spatial4j/RectIntersectionTestHelper.java (original)
+++ lucene/dev/trunk/lucene/spatial/src/test/org/apache/lucene/spatial/spatial4j/RectIntersectionTestHelper.java Wed May  6 14:24:44 2015
@@ -28,7 +28,7 @@ import com.spatial4j.core.shape.impl.Poi
 import static com.spatial4j.core.shape.SpatialRelation.CONTAINS;
 import static com.spatial4j.core.shape.SpatialRelation.DISJOINT;
 
-public abstract class RectIntersectionTestHelper<S extends Shape> extends RandomizedShapeTest {
+public abstract class RectIntersectionTestHelper<S extends Shape> extends RandomizedShapeTestCase {
 
   public RectIntersectionTestHelper(SpatialContext ctx) {
     super(ctx);
@@ -90,7 +90,7 @@ public abstract class RectIntersectionTe
         || (!isRandomShapeRectangular() && i_D < getDisjointMinimum(MINLAPS)) || i_bboxD < getBoundingMinimum(MINLAPS)) {
       laps++;
 
-      TestLog.clear();
+      LogRule.clear();
 
       if (laps > MINLAPS) {
         fail("Did not find enough contains/within/intersection/disjoint/bounds cases in a reasonable number" +
@@ -111,7 +111,7 @@ public abstract class RectIntersectionTe
 
       SpatialRelation ic = s.relate(r);
 
-      TestLog.log("S-R Rel: {}, Shape {}, Rectangle {}", ic, s, r);
+      LogRule.log("S-R Rel: {}, Shape {}, Rectangle {}", ic, s, r);
 
       if (ic != DISJOINT) {
         assertTrue("if not disjoint then the shape's bbox shouldn't be disjoint",