You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ho...@apache.org on 2015/08/04 19:48:41 UTC
svn commit: r1694092 - in /lucene/dev/branches/branch_5x: ./ solr/ solr/core/
solr/core/src/test/org/apache/solr/search/function/SortByFunctionTest.java
solr/core/src/test/org/apache/solr/search/function/TestSortByMinMaxFunction.java
Author: hossman
Date: Tue Aug 4 17:48:41 2015
New Revision: 1694092
URL: http://svn.apache.org/r1694092
Log:
LUCENE-6609: refactor Solr tests to isolate SortedSetSelector dependent code into a test that SuppressCodecs the problematic docvalues formats (merge r1694090)
Added:
lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/search/function/TestSortByMinMaxFunction.java
- copied unchanged from r1694090, lucene/dev/trunk/solr/core/src/test/org/apache/solr/search/function/TestSortByMinMaxFunction.java
Modified:
lucene/dev/branches/branch_5x/ (props changed)
lucene/dev/branches/branch_5x/solr/ (props changed)
lucene/dev/branches/branch_5x/solr/core/ (props changed)
lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/search/function/SortByFunctionTest.java
Modified: lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/search/function/SortByFunctionTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/search/function/SortByFunctionTest.java?rev=1694092&r1=1694091&r2=1694092&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/search/function/SortByFunctionTest.java (original)
+++ lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/search/function/SortByFunctionTest.java Tue Aug 4 17:48:41 2015
@@ -22,7 +22,7 @@ import org.junit.BeforeClass;
/**
*
- *
+ * @see TestSortByMinMaxFunction
**/
public class SortByFunctionTest extends AbstractSolrTestCase {
@@ -129,11 +129,23 @@ public class SortByFunctionTest extends
"//result/doc[4]/int[@name='id'][.='1']"
);
}
+
+ /**
+ * The sort clauses to test in <code>testFieldSortSpecifiedAsFunction</code>.
+ *
+ * @see #testFieldSortSpecifiedAsFunction
+ */
+ protected String[] getFieldFunctionClausesToTest() {
+ return new String[] { "primary_tl1", "field(primary_tl1)" };
+ }
+
/**
* Sort by function normally compares the double value, but if a function is specified that identifies
* a single field, we should use the underlying field's SortField to save of a lot of type converstion
* (and RAM), and keep the sort precision as high as possible
+ *
+ * @see #getFieldFunctionClausesToTest
*/
public void testFieldSortSpecifiedAsFunction() throws Exception {
final long A = Long.MIN_VALUE;
@@ -170,8 +182,9 @@ public class SortByFunctionTest extends
assertU(commit());
// all of these sorts should result in the exact same order
- for (String primarySort : new String[] { "primary_tl1", "field(primary_tl1)",
- "field(multi_l_dv,max)", "field(multi_l_dv,min)" }) {
+ // min/max of a field is tested in TestSortByMinMaxFunction
+ for (String primarySort : getFieldFunctionClausesToTest()) {
+
assertQ(req("q", "*:*",
"sort", primarySort + " asc, secondary_tl1 asc")
, "//*[@numFound='9']"