lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dsmi...@apache.org
Subject svn commit: r1603994 - in /lucene/dev/branches/branch_4x: ./ lucene/ lucene/spatial/ lucene/spatial/src/test/org/apache/lucene/spatial/ lucene/spatial/src/test/org/apache/lucene/spatial/prefix/
Date Thu, 19 Jun 2014 18:40:12 GMT
Author: dsmiley
Date: Thu Jun 19 18:40:11 2014
New Revision: 1603994

URL: http://svn.apache.org/r1603994
Log:
LUCENE-5608: small test improvements. Rename SpatialOpRecursivePrefixTreeTest to RandomSpatialOpFuzzyPrefixTreeTest.

Added:
    lucene/dev/branches/branch_4x/lucene/spatial/src/test/org/apache/lucene/spatial/prefix/RandomSpatialOpFuzzyPrefixTreeTest.java
      - copied, changed from r1603992, lucene/dev/trunk/lucene/spatial/src/test/org/apache/lucene/spatial/prefix/RandomSpatialOpFuzzyPrefixTreeTest.java
    lucene/dev/branches/branch_4x/lucene/spatial/src/test/org/apache/lucene/spatial/prefix/RandomSpatialOpStrategyTestCase.java
      - copied unchanged from r1603992, lucene/dev/trunk/lucene/spatial/src/test/org/apache/lucene/spatial/prefix/RandomSpatialOpStrategyTestCase.java
Modified:
    lucene/dev/branches/branch_4x/   (props changed)
    lucene/dev/branches/branch_4x/lucene/   (props changed)
    lucene/dev/branches/branch_4x/lucene/spatial/   (props changed)
    lucene/dev/branches/branch_4x/lucene/spatial/src/test/org/apache/lucene/spatial/QueryEqualsHashCodeTest.java
    lucene/dev/branches/branch_4x/lucene/spatial/src/test/org/apache/lucene/spatial/StrategyTestCase.java

Modified: lucene/dev/branches/branch_4x/lucene/spatial/src/test/org/apache/lucene/spatial/QueryEqualsHashCodeTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/spatial/src/test/org/apache/lucene/spatial/QueryEqualsHashCodeTest.java?rev=1603994&r1=1603993&r2=1603994&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/spatial/src/test/org/apache/lucene/spatial/QueryEqualsHashCodeTest.java
(original)
+++ lucene/dev/branches/branch_4x/lucene/spatial/src/test/org/apache/lucene/spatial/QueryEqualsHashCodeTest.java
Thu Jun 19 18:40:11 2014
@@ -91,8 +91,10 @@ public class QueryEqualsHashCodeTest ext
     Object second = generator.gen(args1);//should be the same
     assertEquals(first, second);
     assertEquals(first.hashCode(), second.hashCode());
-    second = generator.gen(args2);//now should be different
     assertNotSame(args1, args2);
+    second = generator.gen(args2);//now should be different
+    assertNotSame(first, second);
+    assertNotSame(first.hashCode(), second.hashCode());
   }
 
   private SpatialArgs makeArgs1() {

Modified: lucene/dev/branches/branch_4x/lucene/spatial/src/test/org/apache/lucene/spatial/StrategyTestCase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/spatial/src/test/org/apache/lucene/spatial/StrategyTestCase.java?rev=1603994&r1=1603993&r2=1603994&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/spatial/src/test/org/apache/lucene/spatial/StrategyTestCase.java
(original)
+++ lucene/dev/branches/branch_4x/lucene/spatial/src/test/org/apache/lucene/spatial/StrategyTestCase.java
Thu Jun 19 18:40:11 2014
@@ -20,13 +20,10 @@ package org.apache.lucene.spatial;
 
 import com.spatial4j.core.context.SpatialContext;
 import com.spatial4j.core.shape.Shape;
-import org.apache.lucene.codecs.Codec;
-import org.apache.lucene.codecs.lucene45.Lucene45DocValuesFormat;
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.Field;
 import org.apache.lucene.document.StoredField;
 import org.apache.lucene.document.StringField;
-import org.apache.lucene.index.IndexWriterConfig;
 import org.apache.lucene.index.Term;
 import org.apache.lucene.queries.function.FunctionQuery;
 import org.apache.lucene.queries.function.ValueSource;
@@ -38,9 +35,6 @@ import org.apache.lucene.search.TopDocs;
 import org.apache.lucene.spatial.query.SpatialArgs;
 import org.apache.lucene.spatial.query.SpatialArgsParser;
 import org.apache.lucene.spatial.query.SpatialOperation;
-import org.apache.lucene.spatial.serialized.SerializedDVStrategy;
-import org.apache.lucene.util.TestUtil;
-import org.junit.Assert;
 
 import java.io.FileNotFoundException;
 import java.io.IOException;
@@ -52,7 +46,6 @@ import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
-import java.util.Random;
 import java.util.Set;
 import java.util.logging.Logger;
 
@@ -231,6 +224,7 @@ public abstract class StrategyTestCase e
 //    }
 //    CheckHits.checkHits(random(), q, "", indexSearcher, expectedDocs);
 
+    //TopDocs is sorted but we actually don't care about the order
     TopDocs docs = indexSearcher.search(q, 1000);//calculates the score
     for (int i = 0; i < docs.scoreDocs.length; i++) {
       ScoreDoc gotSD = docs.scoreDocs[i];

Copied: lucene/dev/branches/branch_4x/lucene/spatial/src/test/org/apache/lucene/spatial/prefix/RandomSpatialOpFuzzyPrefixTreeTest.java
(from r1603992, lucene/dev/trunk/lucene/spatial/src/test/org/apache/lucene/spatial/prefix/RandomSpatialOpFuzzyPrefixTreeTest.java)
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/spatial/src/test/org/apache/lucene/spatial/prefix/RandomSpatialOpFuzzyPrefixTreeTest.java?p2=lucene/dev/branches/branch_4x/lucene/spatial/src/test/org/apache/lucene/spatial/prefix/RandomSpatialOpFuzzyPrefixTreeTest.java&p1=lucene/dev/trunk/lucene/spatial/src/test/org/apache/lucene/spatial/prefix/RandomSpatialOpFuzzyPrefixTreeTest.java&r1=1603992&r2=1603994&rev=1603994&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/spatial/src/test/org/apache/lucene/spatial/prefix/RandomSpatialOpFuzzyPrefixTreeTest.java
(original)
+++ lucene/dev/branches/branch_4x/lucene/spatial/src/test/org/apache/lucene/spatial/prefix/RandomSpatialOpFuzzyPrefixTreeTest.java
Thu Jun 19 18:40:11 2014
@@ -33,13 +33,11 @@ import org.apache.lucene.document.String
 import org.apache.lucene.search.Query;
 import org.apache.lucene.spatial.StrategyTestCase;
 import org.apache.lucene.spatial.prefix.tree.Cell;
-import org.apache.lucene.spatial.prefix.tree.CellIterator;
 import org.apache.lucene.spatial.prefix.tree.GeohashPrefixTree;
 import org.apache.lucene.spatial.prefix.tree.QuadPrefixTree;
 import org.apache.lucene.spatial.prefix.tree.SpatialPrefixTree;
 import org.apache.lucene.spatial.query.SpatialArgs;
 import org.apache.lucene.spatial.query.SpatialOperation;
-import org.apache.lucene.uninverting.UninvertingReader;
 import org.junit.Before;
 import org.junit.Test;
 
@@ -77,7 +75,7 @@ public class RandomSpatialOpFuzzyPrefixT
   public void setUp() throws Exception {
     super.setUp();
     //Only for Disjoint.  Ugh; need to find a better way.  LUCENE-5692
-    uninvertMap.put(getClass().getSimpleName(), UninvertingReader.Type.SORTED);
+    //uninvertMap.put(getClass().getSimpleName(), UninvertingReader.Type.SORTED);
   }
 
   public void setupGrid(int maxLevels) throws IOException {
@@ -89,7 +87,7 @@ public class RandomSpatialOpFuzzyPrefixT
 
     //((PrefixTreeStrategy) strategy).setDistErrPct(0);//fully precise to grid
 
-    ((RecursivePrefixTreeStrategy)strategy).setPruneLeafyBranches(randomBoolean());
+    //((RecursivePrefixTreeStrategy)strategy).setPruneLeafyBranches(randomBoolean());
 
     System.out.println("Strategy: " + strategy.toString());
   }
@@ -409,7 +407,7 @@ public class RandomSpatialOpFuzzyPrefixT
     double distErrPct = ((PrefixTreeStrategy) strategy).getDistErrPct();
     double distErr = SpatialArgs.calcDistanceFromErrPct(snapMe, distErrPct, ctx);
     int detailLevel = grid.getLevelForDistance(distErr);
-    CellIterator cells = grid.getTreeCellIterator(snapMe, detailLevel);
+    Iterator<Cell> cells = grid.getCells(snapMe, detailLevel, false, false).iterator();
 
     //calc bounding box of cells.
     List<Shape> cellShapes = new ArrayList<>(1024);



Mime
View raw message