You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ab...@apache.org on 2017/07/03 11:58:28 UTC

[48/58] [abbrv] lucene-solr:jira/solr-10879: SOLR-10864: Fixup: Restore the DV vs trie vs points intent of TestRandomDVFaceting

SOLR-10864: Fixup: Restore the DV vs trie vs points intent of TestRandomDVFaceting


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/f3c851a0
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/f3c851a0
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/f3c851a0

Branch: refs/heads/jira/solr-10879
Commit: f3c851a015e5d8c775f0fb28ffbd8f5725f2f11b
Parents: 26d2ed7
Author: Chris Hostetter <ho...@apache.org>
Authored: Fri Jun 30 11:23:28 2017 -0700
Committer: Chris Hostetter <ho...@apache.org>
Committed: Fri Jun 30 11:23:28 2017 -0700

----------------------------------------------------------------------
 .../org/apache/solr/TestRandomDVFaceting.java   | 28 +++++++++++++++++---
 1 file changed, 24 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f3c851a0/solr/core/src/test/org/apache/solr/TestRandomDVFaceting.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/TestRandomDVFaceting.java b/solr/core/src/test/org/apache/solr/TestRandomDVFaceting.java
index 46762ea..aaeab54 100644
--- a/solr/core/src/test/org/apache/solr/TestRandomDVFaceting.java
+++ b/solr/core/src/test/org/apache/solr/TestRandomDVFaceting.java
@@ -28,6 +28,8 @@ import org.apache.lucene.util.LuceneTestCase.Slow;
 import org.apache.solr.common.params.ModifiableSolrParams;
 import org.apache.solr.request.SolrQueryRequest;
 import org.apache.solr.schema.SchemaField;
+import org.apache.solr.schema.TrieIntField;
+import org.apache.solr.schema.IntPointField;
 import org.junit.BeforeClass;
 import org.junit.Test;
 import org.slf4j.Logger;
@@ -39,18 +41,36 @@ import org.slf4j.LoggerFactory;
  * to the indexed facet results as if it were just another faceting method.
  */
 @Slow
+@SolrTestCaseJ4.SuppressPointFields(bugUrl="Test explicitly compares Trie to Points, randomization defeats the point")
 public class TestRandomDVFaceting extends SolrTestCaseJ4 {
 
   private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
 
   @BeforeClass
   public static void beforeTests() throws Exception {
-    // we need DVs on point fields to compute stats & facets
-    // but test also has hard coded assumptions about these field types *NOT* having DV when *NOT* points
-    // so use docvalue if and only if we are using points...
-    System.setProperty(NUMERIC_DOCVALUES_SYSPROP, System.getProperty(NUMERIC_POINTS_SYSPROP));
+    // This tests explicitly compares Trie DV with non-DV Trie with DV Points
+    // so we don't want randomized DocValues on all Trie fields
+    System.setProperty(NUMERIC_DOCVALUES_SYSPROP, "false");
     
     initCore("solrconfig-basic.xml","schema-docValuesFaceting.xml");
+
+    assertEquals("DocValues: Schema assumptions are broken",
+                 false, h.getCore().getLatestSchema().getField("foo_i").hasDocValues());
+    assertEquals("DocValues: Schema assumptions are broken",
+                 true, h.getCore().getLatestSchema().getField("foo_i_dv").hasDocValues());
+    assertEquals("DocValues: Schema assumptions are broken",
+                 true, h.getCore().getLatestSchema().getField("foo_i_p").hasDocValues());
+    
+    assertEquals("Type: Schema assumptions are broken",
+                 TrieIntField.class,
+                 h.getCore().getLatestSchema().getField("foo_i").getType().getClass());
+    assertEquals("Type: Schema assumptions are broken",
+                 TrieIntField.class,
+                 h.getCore().getLatestSchema().getField("foo_i_dv").getType().getClass());
+    assertEquals("Type: Schema assumptions are broken",
+                 IntPointField.class,
+                 h.getCore().getLatestSchema().getField("foo_i_p").getType().getClass());
+    
   }
 
   int indexSize;