lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rm...@apache.org
Subject svn commit: r1621828 - in /lucene/dev/branches/lucene5858: lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene40/ lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene42/ lucene/backward-codecs/src/test/org/apache/lucene/codecs/lu...
Date Mon, 01 Sep 2014 15:26:10 GMT
Author: rmuir
Date: Mon Sep  1 15:26:09 2014
New Revision: 1621828

URL: http://svn.apache.org/r1621828
Log:
LUCENE-5858: remove conditionals around codec features

Modified:
    lucene/dev/branches/lucene5858/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene40/TestLucene40DocValuesFormat.java
    lucene/dev/branches/lucene5858/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene42/TestLucene42DocValuesFormat.java
    lucene/dev/branches/lucene5858/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene45/TestLucene45DocValuesFormat.java
    lucene/dev/branches/lucene5858/lucene/core/src/test/org/apache/lucene/index/TestDocValuesIndexing.java
    lucene/dev/branches/lucene5858/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java
    lucene/dev/branches/lucene5858/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterExceptions.java
    lucene/dev/branches/lucene5858/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterExceptions2.java
    lucene/dev/branches/lucene5858/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterOutOfMemory.java
    lucene/dev/branches/lucene5858/lucene/core/src/test/org/apache/lucene/index/TestMultiDocValues.java
    lucene/dev/branches/lucene5858/lucene/core/src/test/org/apache/lucene/search/TestFieldCacheTermsFilter.java
    lucene/dev/branches/lucene5858/lucene/core/src/test/org/apache/lucene/search/TestSortRandom.java
    lucene/dev/branches/lucene5858/lucene/facet/src/test/org/apache/lucene/facet/TestDrillSideways.java
    lucene/dev/branches/lucene5858/lucene/facet/src/test/org/apache/lucene/facet/range/TestRangeFacetCounts.java
    lucene/dev/branches/lucene5858/lucene/facet/src/test/org/apache/lucene/facet/sortedset/TestSortedSetDocValuesFacets.java
    lucene/dev/branches/lucene5858/lucene/misc/src/test/org/apache/lucene/index/sorter/SorterTestBase.java
    lucene/dev/branches/lucene5858/lucene/misc/src/test/org/apache/lucene/index/sorter/TestSortingMergePolicy.java
    lucene/dev/branches/lucene5858/lucene/misc/src/test/org/apache/lucene/uninverting/TestFieldCache.java
    lucene/dev/branches/lucene5858/lucene/misc/src/test/org/apache/lucene/uninverting/TestFieldCacheVsDocValues.java
    lucene/dev/branches/lucene5858/lucene/test-framework/src/java/org/apache/lucene/index/BaseDocValuesFormatTestCase.java
    lucene/dev/branches/lucene5858/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java
    lucene/dev/branches/lucene5858/solr/core/src/test/org/apache/solr/CursorPagingTest.java
    lucene/dev/branches/lucene5858/solr/core/src/test/org/apache/solr/cloud/DistribCursorPagingTest.java

Modified: lucene/dev/branches/lucene5858/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene40/TestLucene40DocValuesFormat.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5858/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene40/TestLucene40DocValuesFormat.java?rev=1621828&r1=1621827&r2=1621828&view=diff
==============================================================================
--- lucene/dev/branches/lucene5858/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene40/TestLucene40DocValuesFormat.java (original)
+++ lucene/dev/branches/lucene5858/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene40/TestLucene40DocValuesFormat.java Mon Sep  1 15:26:09 2014
@@ -37,4 +37,20 @@ public class TestLucene40DocValuesFormat
     return false;
   }
 
+  // this codec doesnt support missing (its the same as empty string)
+  @Override
+  protected boolean codecSupportsDocsWithField() {
+    return false;
+  }
+
+  @Override
+  protected boolean codecSupportsSortedSet() {
+    return false;
+  }
+
+  @Override
+  protected boolean codecSupportsSortedNumeric() {
+    return false;
+  }
+
 }

Modified: lucene/dev/branches/lucene5858/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene42/TestLucene42DocValuesFormat.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5858/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene42/TestLucene42DocValuesFormat.java?rev=1621828&r1=1621827&r2=1621828&view=diff
==============================================================================
--- lucene/dev/branches/lucene5858/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene42/TestLucene42DocValuesFormat.java (original)
+++ lucene/dev/branches/lucene5858/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene42/TestLucene42DocValuesFormat.java Mon Sep  1 15:26:09 2014
@@ -36,4 +36,15 @@ public class TestLucene42DocValuesFormat
   protected boolean codecAcceptsHugeBinaryValues(String field) {
     return false;
   }
+  
+  // this codec doesnt support missing (its the same as empty string)
+  @Override
+  protected boolean codecSupportsDocsWithField() {
+    return false;
+  }
+  
+  @Override
+  protected boolean codecSupportsSortedNumeric() {
+    return false;
+  }
 }

Modified: lucene/dev/branches/lucene5858/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene45/TestLucene45DocValuesFormat.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5858/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene45/TestLucene45DocValuesFormat.java?rev=1621828&r1=1621827&r2=1621828&view=diff
==============================================================================
--- lucene/dev/branches/lucene5858/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene45/TestLucene45DocValuesFormat.java (original)
+++ lucene/dev/branches/lucene5858/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene45/TestLucene45DocValuesFormat.java Mon Sep  1 15:26:09 2014
@@ -31,4 +31,9 @@ public class TestLucene45DocValuesFormat
   protected Codec getCodec() {
     return codec;
   }
+  
+  @Override
+  protected boolean codecSupportsSortedNumeric() {
+    return false;
+  }
 }

Modified: lucene/dev/branches/lucene5858/lucene/core/src/test/org/apache/lucene/index/TestDocValuesIndexing.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5858/lucene/core/src/test/org/apache/lucene/index/TestDocValuesIndexing.java?rev=1621828&r1=1621827&r2=1621828&view=diff
==============================================================================
--- lucene/dev/branches/lucene5858/lucene/core/src/test/org/apache/lucene/index/TestDocValuesIndexing.java (original)
+++ lucene/dev/branches/lucene5858/lucene/core/src/test/org/apache/lucene/index/TestDocValuesIndexing.java Mon Sep  1 15:26:09 2014
@@ -378,7 +378,6 @@ public class TestDocValuesIndexing exten
   }
   
   public void testTooLargeTermSortedSetBytes() throws IOException {
-    assumeTrue("codec does not support SORTED_SET", defaultCodecSupportsSortedSet());
     Analyzer analyzer = new MockAnalyzer(random());
 
     Directory directory = newDirectory();

Modified: lucene/dev/branches/lucene5858/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5858/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java?rev=1621828&r1=1621827&r2=1621828&view=diff
==============================================================================
--- lucene/dev/branches/lucene5858/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java (original)
+++ lucene/dev/branches/lucene5858/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java Mon Sep  1 15:26:09 2014
@@ -1037,14 +1037,10 @@ public class TestIndexWriter extends Luc
       doc.add(new BinaryDocValuesField("binarydv", new BytesRef("500")));
       doc.add(new NumericDocValuesField("numericdv", 500));
       doc.add(new SortedDocValuesField("sorteddv", new BytesRef("500")));
-      if (defaultCodecSupportsSortedSet()) {
-        doc.add(new SortedSetDocValuesField("sortedsetdv", new BytesRef("one")));
-        doc.add(new SortedSetDocValuesField("sortedsetdv", new BytesRef("two")));
-      }
-      if (defaultCodecSupportsSortedNumeric()) {
-        doc.add(new SortedNumericDocValuesField("sortednumericdv", 4));
-        doc.add(new SortedNumericDocValuesField("sortednumericdv", 3));
-      }
+      doc.add(new SortedSetDocValuesField("sortedsetdv", new BytesRef("one")));
+      doc.add(new SortedSetDocValuesField("sortedsetdv", new BytesRef("two")));
+      doc.add(new SortedNumericDocValuesField("sortednumericdv", 4));
+      doc.add(new SortedNumericDocValuesField("sortednumericdv", 3));
       w.addDocument(doc);
       doc = new Document();
       doc.add(newStringField(random, "id", "501", Field.Store.NO));
@@ -1052,14 +1048,10 @@ public class TestIndexWriter extends Luc
       doc.add(new BinaryDocValuesField("binarydv", new BytesRef("501")));
       doc.add(new NumericDocValuesField("numericdv", 501));
       doc.add(new SortedDocValuesField("sorteddv", new BytesRef("501")));
-      if (defaultCodecSupportsSortedSet()) {
-        doc.add(new SortedSetDocValuesField("sortedsetdv", new BytesRef("two")));
-        doc.add(new SortedSetDocValuesField("sortedsetdv", new BytesRef("three")));
-      }
-      if (defaultCodecSupportsSortedNumeric()) {
-        doc.add(new SortedNumericDocValuesField("sortednumericdv", 6));
-        doc.add(new SortedNumericDocValuesField("sortednumericdv", 1));
-      }
+      doc.add(new SortedSetDocValuesField("sortedsetdv", new BytesRef("two")));
+      doc.add(new SortedSetDocValuesField("sortedsetdv", new BytesRef("three")));
+      doc.add(new SortedNumericDocValuesField("sortednumericdv", 6));
+      doc.add(new SortedNumericDocValuesField("sortednumericdv", 1));
       w.addDocument(doc);
       w.deleteDocuments(new Term("id", "500"));
       w.close();
@@ -1108,9 +1100,7 @@ public class TestIndexWriter extends Luc
             doc.add(binaryDVField);
             doc.add(numericDVField);
             doc.add(sortedDVField);
-            if (defaultCodecSupportsSortedSet()) {
-              doc.add(sortedSetDVField);
-            }
+            doc.add(sortedSetDVField);
             for(int i=0;i<100;i++) {
               idField.setStringValue(Integer.toString(i));
               binaryDVField.setBytesValue(new BytesRef(idField.stringValue()));
@@ -2893,11 +2883,7 @@ public class TestIndexWriter extends Luc
     assertNotNull(id1);
     
     String id2 = sis.info(0).info.getId();
-    if (defaultCodecSupportsSegmentIds()) {
-      assertNotNull(id2);
-    } else {
-      assertNull(id2);
-    }
+    assertNotNull(id2);
 
     // Make sure CheckIndex includes id output:
     ByteArrayOutputStream bos = new ByteArrayOutputStream(1024);
@@ -2912,12 +2898,7 @@ public class TestIndexWriter extends Luc
     // Commit id is always stored:
     assertTrue("missing id=" + id1 + " in:\n" + s, s.contains("id=" + id1));
 
-    // Per-segment id may or may not be stored depending on the codec:
-    if (defaultCodecSupportsSegmentIds()) {
-      assertTrue("missing id=" + id2 + " in:\n" + s, s.contains("id=" + id2));
-    } else {
-      assertTrue("missing id=null in:\n" + s, s.contains("id=null"));
-    }
+    assertTrue("missing id=" + id2 + " in:\n" + s, s.contains("id=" + id2));
     d.close();
 
     Set<String> ids = new HashSet<>();

Modified: lucene/dev/branches/lucene5858/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterExceptions.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5858/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterExceptions.java?rev=1621828&r1=1621827&r2=1621828&view=diff
==============================================================================
--- lucene/dev/branches/lucene5858/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterExceptions.java (original)
+++ lucene/dev/branches/lucene5858/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterExceptions.java Mon Sep  1 15:26:09 2014
@@ -156,14 +156,10 @@ public class TestIndexWriterExceptions e
       doc.add(new NumericDocValuesField("numericdv", 5));
       doc.add(new BinaryDocValuesField("binarydv", new BytesRef("hello")));
       doc.add(new SortedDocValuesField("sorteddv", new BytesRef("world")));
-      if (defaultCodecSupportsSortedSet()) {
-        doc.add(new SortedSetDocValuesField("sortedsetdv", new BytesRef("hellllo")));
-        doc.add(new SortedSetDocValuesField("sortedsetdv", new BytesRef("again")));
-      }
-      if (defaultCodecSupportsSortedNumeric()) {
-        doc.add(new SortedNumericDocValuesField("sortednumericdv", 10));
-        doc.add(new SortedNumericDocValuesField("sortednumericdv", 5));
-      }
+      doc.add(new SortedSetDocValuesField("sortedsetdv", new BytesRef("hellllo")));
+      doc.add(new SortedSetDocValuesField("sortedsetdv", new BytesRef("again")));
+      doc.add(new SortedNumericDocValuesField("sortednumericdv", 10));
+      doc.add(new SortedNumericDocValuesField("sortednumericdv", 5));
 
       doc.add(newField(r, "content7", "aaa bbb ccc ddd", DocCopyIterator.custom4));
 
@@ -2054,10 +2050,9 @@ public class TestIndexWriterExceptions e
       shouldFail.set(true);
       boolean doClose = false;
       try {
-        boolean defaultCodecSupportsFieldUpdates = defaultCodecSupportsFieldUpdates();
         for(int i=0;i<numDocs;i++) {
           if (random().nextInt(10) == 7) {
-            boolean fieldUpdate = defaultCodecSupportsFieldUpdates && random().nextBoolean();
+            boolean fieldUpdate = random().nextBoolean();
             int docid = docBase + i;
             if (fieldUpdate) {
               long value = iter;

Modified: lucene/dev/branches/lucene5858/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterExceptions2.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5858/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterExceptions2.java?rev=1621828&r1=1621827&r2=1621828&view=diff
==============================================================================
--- lucene/dev/branches/lucene5858/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterExceptions2.java (original)
+++ lucene/dev/branches/lucene5858/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterExceptions2.java Mon Sep  1 15:26:09 2014
@@ -106,14 +106,10 @@ public class TestIndexWriterExceptions2 
         doc.add(new NumericDocValuesField("dv", i));
         doc.add(new BinaryDocValuesField("dv2", new BytesRef(Integer.toString(i))));
         doc.add(new SortedDocValuesField("dv3", new BytesRef(Integer.toString(i))));
-        if (defaultCodecSupportsSortedSet()) {
-          doc.add(new SortedSetDocValuesField("dv4", new BytesRef(Integer.toString(i))));
-          doc.add(new SortedSetDocValuesField("dv4", new BytesRef(Integer.toString(i-1))));
-        }
-        if (defaultCodecSupportsSortedNumeric()) {
-          doc.add(new SortedNumericDocValuesField("dv5", i));
-          doc.add(new SortedNumericDocValuesField("dv5", i-1));
-        }
+        doc.add(new SortedSetDocValuesField("dv4", new BytesRef(Integer.toString(i))));
+        doc.add(new SortedSetDocValuesField("dv4", new BytesRef(Integer.toString(i-1))));
+        doc.add(new SortedNumericDocValuesField("dv5", i));
+        doc.add(new SortedNumericDocValuesField("dv5", i-1));
         doc.add(newTextField("text1", TestUtil.randomAnalysisString(random(), 20, true), Field.Store.NO));
         // ensure we store something
         doc.add(new StoredField("stored1", "foo"));
@@ -133,9 +129,9 @@ public class TestIndexWriterExceptions2 
             int thingToDo = random().nextInt(4);
             if (thingToDo == 0) {
               iw.deleteDocuments(new Term("id", Integer.toString(i)));
-            } else if (thingToDo == 1 && defaultCodecSupportsFieldUpdates()) {
+            } else if (thingToDo == 1) {
               iw.updateNumericDocValue(new Term("id", Integer.toString(i)), "dv", i+1L);
-            } else if (thingToDo == 2 && defaultCodecSupportsFieldUpdates()) {
+            } else if (thingToDo == 2) {
               iw.updateBinaryDocValue(new Term("id", Integer.toString(i)), "dv2", new BytesRef(Integer.toString(i+1)));
             }
           } catch (Exception e) {

Modified: lucene/dev/branches/lucene5858/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterOutOfMemory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5858/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterOutOfMemory.java?rev=1621828&r1=1621827&r2=1621828&view=diff
==============================================================================
--- lucene/dev/branches/lucene5858/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterOutOfMemory.java (original)
+++ lucene/dev/branches/lucene5858/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterOutOfMemory.java Mon Sep  1 15:26:09 2014
@@ -127,14 +127,10 @@ public class TestIndexWriterOutOfMemory 
           doc.add(new NumericDocValuesField("dv", i));
           doc.add(new BinaryDocValuesField("dv2", new BytesRef(Integer.toString(i))));
           doc.add(new SortedDocValuesField("dv3", new BytesRef(Integer.toString(i))));
-          if (defaultCodecSupportsSortedSet()) {
-            doc.add(new SortedSetDocValuesField("dv4", new BytesRef(Integer.toString(i))));
-            doc.add(new SortedSetDocValuesField("dv4", new BytesRef(Integer.toString(i-1))));
-          }
-          if (defaultCodecSupportsSortedNumeric()) {
-            doc.add(new SortedNumericDocValuesField("dv5", i));
-            doc.add(new SortedNumericDocValuesField("dv5", i-1));
-          }
+          doc.add(new SortedSetDocValuesField("dv4", new BytesRef(Integer.toString(i))));
+          doc.add(new SortedSetDocValuesField("dv4", new BytesRef(Integer.toString(i-1))));
+          doc.add(new SortedNumericDocValuesField("dv5", i));
+          doc.add(new SortedNumericDocValuesField("dv5", i-1));
           doc.add(newTextField("text1", TestUtil.randomAnalysisString(random(), 20, true), Field.Store.NO));
           // ensure we store something
           doc.add(new StoredField("stored1", "foo"));
@@ -154,9 +150,9 @@ public class TestIndexWriterOutOfMemory 
               int thingToDo = random().nextInt(4);
               if (thingToDo == 0) {
                 iw.deleteDocuments(new Term("id", Integer.toString(i)));
-              } else if (thingToDo == 1 && defaultCodecSupportsFieldUpdates()) {
+              } else if (thingToDo == 1) {
                 iw.updateNumericDocValue(new Term("id", Integer.toString(i)), "dv", i+1L);
-              } else if (thingToDo == 2 && defaultCodecSupportsFieldUpdates()) {
+              } else if (thingToDo == 2) {
                 iw.updateBinaryDocValue(new Term("id", Integer.toString(i)), "dv2", new BytesRef(Integer.toString(i+1)));
               }
             } catch (OutOfMemoryError e) {

Modified: lucene/dev/branches/lucene5858/lucene/core/src/test/org/apache/lucene/index/TestMultiDocValues.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5858/lucene/core/src/test/org/apache/lucene/index/TestMultiDocValues.java?rev=1621828&r1=1621827&r2=1621828&view=diff
==============================================================================
--- lucene/dev/branches/lucene5858/lucene/core/src/test/org/apache/lucene/index/TestMultiDocValues.java (original)
+++ lucene/dev/branches/lucene5858/lucene/core/src/test/org/apache/lucene/index/TestMultiDocValues.java Mon Sep  1 15:26:09 2014
@@ -120,7 +120,7 @@ public class TestMultiDocValues extends 
     for (int i = 0; i < numDocs; i++) {
       BytesRef ref = new BytesRef(TestUtil.randomUnicodeString(random()));
       field.setBytesValue(ref);
-      if (defaultCodecSupportsDocsWithField() && random().nextInt(7) == 0) {
+      if (random().nextInt(7) == 0) {
         iw.addDocument(new Document());
       }
       iw.addDocument(doc);
@@ -193,7 +193,6 @@ public class TestMultiDocValues extends 
   }
   
   public void testSortedSet() throws Exception {
-    assumeTrue("codec does not support SORTED_SET", defaultCodecSupportsSortedSet());
     Directory dir = newDirectory();
     
     IndexWriterConfig iwc = newIndexWriterConfig(random(), null);
@@ -256,7 +255,6 @@ public class TestMultiDocValues extends 
   
   // tries to make more dups than testSortedSet
   public void testSortedSetWithDups() throws Exception {
-    assumeTrue("codec does not support SORTED_SET", defaultCodecSupportsSortedSet());
     Directory dir = newDirectory();
     
     IndexWriterConfig iwc = newIndexWriterConfig(random(), null);
@@ -318,7 +316,6 @@ public class TestMultiDocValues extends 
   }
   
   public void testSortedNumeric() throws Exception {
-    assumeTrue("codec does not support SORTED_NUMERIC", defaultCodecSupportsSortedNumeric());
     Directory dir = newDirectory();
     
     IndexWriterConfig iwc = newIndexWriterConfig(random(), null);
@@ -370,7 +367,6 @@ public class TestMultiDocValues extends 
   }
   
   public void testDocsWithField() throws Exception {
-    assumeTrue("codec does not support docsWithField", defaultCodecSupportsDocsWithField());
     Directory dir = newDirectory();
     
     IndexWriterConfig iwc = newIndexWriterConfig(random(), null);

Modified: lucene/dev/branches/lucene5858/lucene/core/src/test/org/apache/lucene/search/TestFieldCacheTermsFilter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5858/lucene/core/src/test/org/apache/lucene/search/TestFieldCacheTermsFilter.java?rev=1621828&r1=1621827&r2=1621828&view=diff
==============================================================================
--- lucene/dev/branches/lucene5858/lucene/core/src/test/org/apache/lucene/search/TestFieldCacheTermsFilter.java (original)
+++ lucene/dev/branches/lucene5858/lucene/core/src/test/org/apache/lucene/search/TestFieldCacheTermsFilter.java Mon Sep  1 15:26:09 2014
@@ -37,7 +37,6 @@ import java.util.List;
  */
 public class TestFieldCacheTermsFilter extends LuceneTestCase {
   public void testMissingTerms() throws Exception {
-    assumeTrue("requires support for missing values", defaultCodecSupportsMissingDocValues());
     String fieldName = "field1";
     Directory rd = newDirectory();
     RandomIndexWriter w = new RandomIndexWriter(random(), rd);

Modified: lucene/dev/branches/lucene5858/lucene/core/src/test/org/apache/lucene/search/TestSortRandom.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5858/lucene/core/src/test/org/apache/lucene/search/TestSortRandom.java?rev=1621828&r1=1621827&r2=1621828&view=diff
==============================================================================
--- lucene/dev/branches/lucene5858/lucene/core/src/test/org/apache/lucene/search/TestSortRandom.java (original)
+++ lucene/dev/branches/lucene5858/lucene/core/src/test/org/apache/lucene/search/TestSortRandom.java Mon Sep  1 15:26:09 2014
@@ -133,10 +133,7 @@ public class TestSortRandom extends Luce
       final boolean sortMissingLast;
       final boolean missingIsNull;
       sf = new SortField("stringdv", type, reverse);
-      // Can only use sort missing if the DVFormat
-      // supports docsWithField:
-      sortMissingLast = defaultCodecSupportsDocsWithField() && random().nextBoolean();
-      missingIsNull = defaultCodecSupportsDocsWithField();
+      sortMissingLast = random().nextBoolean();
 
       if (sortMissingLast) {
         sf.setMissingValue(SortField.STRING_LAST);
@@ -206,9 +203,6 @@ public class TestSortRandom extends Luce
         System.out.println("  expected:");
         for(int idx=0;idx<expected.size();idx++) {
           BytesRef br = expected.get(idx);
-          if (br == null && missingIsNull == false) {
-            br = new BytesRef();
-          }
           System.out.println("    " + idx + ": " + (br == null ? "<missing>" : br.utf8ToString()));
           if (idx == hitCount-1) {
             break;
@@ -228,20 +222,8 @@ public class TestSortRandom extends Luce
       for(int hitIDX=0;hitIDX<hits.scoreDocs.length;hitIDX++) {
         final FieldDoc fd = (FieldDoc) hits.scoreDocs[hitIDX];
         BytesRef br = expected.get(hitIDX);
-        if (br == null && missingIsNull == false) {
-          br = new BytesRef();
-        }
 
-        // Normally, the old codecs (that don't support
-        // docsWithField via doc values) will always return
-        // an empty BytesRef for the missing case; however,
-        // if all docs in a given segment were missing, in
-        // that case it will return null!  So we must map
-        // null here, too:
         BytesRef br2 = (BytesRef) fd.fields[0];
-        if (br2 == null && missingIsNull == false) {
-          br2 = new BytesRef();
-        }
         
         assertEquals(br, br2);
       }

Modified: lucene/dev/branches/lucene5858/lucene/facet/src/test/org/apache/lucene/facet/TestDrillSideways.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5858/lucene/facet/src/test/org/apache/lucene/facet/TestDrillSideways.java?rev=1621828&r1=1621827&r2=1621828&view=diff
==============================================================================
--- lucene/dev/branches/lucene5858/lucene/facet/src/test/org/apache/lucene/facet/TestDrillSideways.java (original)
+++ lucene/dev/branches/lucene5858/lucene/facet/src/test/org/apache/lucene/facet/TestDrillSideways.java Mon Sep  1 15:26:09 2014
@@ -401,8 +401,6 @@ public class TestDrillSideways extends F
 
   public void testRandom() throws Exception {
 
-    boolean canUseDV = defaultCodecSupportsSortedSet();
-
     while (aChance == 0.0) {
       aChance = random().nextDouble();
     }
@@ -490,7 +488,7 @@ public class TestDrillSideways extends F
       config.setMultiValued("dim"+i, true);
     }
 
-    boolean doUseDV = canUseDV && random().nextBoolean();
+    boolean doUseDV = random().nextBoolean();
 
     for(Doc rawDoc : docs) {
       Document doc = new Document();

Modified: lucene/dev/branches/lucene5858/lucene/facet/src/test/org/apache/lucene/facet/range/TestRangeFacetCounts.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5858/lucene/facet/src/test/org/apache/lucene/facet/range/TestRangeFacetCounts.java?rev=1621828&r1=1621827&r2=1621828&view=diff
==============================================================================
--- lucene/dev/branches/lucene5858/lucene/facet/src/test/org/apache/lucene/facet/range/TestRangeFacetCounts.java (original)
+++ lucene/dev/branches/lucene5858/lucene/facet/src/test/org/apache/lucene/facet/range/TestRangeFacetCounts.java Mon Sep  1 15:26:09 2014
@@ -824,7 +824,6 @@ public class TestRangeFacetCounts extend
 
   // LUCENE-5178
   public void testMissingValues() throws Exception {
-    assumeTrue("codec does not support docsWithField", defaultCodecSupportsDocsWithField());
     Directory d = newDirectory();
     RandomIndexWriter w = new RandomIndexWriter(random(), d);
     Document doc = new Document();

Modified: lucene/dev/branches/lucene5858/lucene/facet/src/test/org/apache/lucene/facet/sortedset/TestSortedSetDocValuesFacets.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5858/lucene/facet/src/test/org/apache/lucene/facet/sortedset/TestSortedSetDocValuesFacets.java?rev=1621828&r1=1621827&r2=1621828&view=diff
==============================================================================
--- lucene/dev/branches/lucene5858/lucene/facet/src/test/org/apache/lucene/facet/sortedset/TestSortedSetDocValuesFacets.java (original)
+++ lucene/dev/branches/lucene5858/lucene/facet/src/test/org/apache/lucene/facet/sortedset/TestSortedSetDocValuesFacets.java Mon Sep  1 15:26:09 2014
@@ -49,7 +49,6 @@ public class TestSortedSetDocValuesFacet
   // randomly uses SortedSetDV
 
   public void testBasic() throws Exception {
-    assumeTrue("Test requires SortedSetDV support", defaultCodecSupportsSortedSet());
     Directory dir = newDirectory();
 
     FacetsConfig config = new FacetsConfig();
@@ -99,7 +98,6 @@ public class TestSortedSetDocValuesFacet
   // LUCENE-5090
   @SuppressWarnings("unused")
   public void testStaleState() throws Exception {
-    assumeTrue("Test requires SortedSetDV support", defaultCodecSupportsSortedSet());
     Directory dir = newDirectory();
 
     RandomIndexWriter writer = new RandomIndexWriter(random(), dir);
@@ -142,7 +140,6 @@ public class TestSortedSetDocValuesFacet
 
   // LUCENE-5333
   public void testSparseFacets() throws Exception {
-    assumeTrue("Test requires SortedSetDV support", defaultCodecSupportsSortedSet());
     Directory dir = newDirectory();
 
     RandomIndexWriter writer = new RandomIndexWriter(random(), dir);
@@ -196,7 +193,6 @@ public class TestSortedSetDocValuesFacet
   }
 
   public void testSomeSegmentsMissing() throws Exception {
-    assumeTrue("Test requires SortedSetDV support", defaultCodecSupportsSortedSet());
     Directory dir = newDirectory();
 
     RandomIndexWriter writer = new RandomIndexWriter(random(), dir);
@@ -236,7 +232,6 @@ public class TestSortedSetDocValuesFacet
   }
 
   public void testSlowCompositeReaderWrapper() throws Exception {
-    assumeTrue("Test requires SortedSetDV support", defaultCodecSupportsSortedSet());
     Directory dir = newDirectory();
 
     RandomIndexWriter writer = new RandomIndexWriter(random(), dir);
@@ -272,7 +267,6 @@ public class TestSortedSetDocValuesFacet
 
 
   public void testRandom() throws Exception {
-    assumeTrue("Test requires SortedSetDV support", defaultCodecSupportsSortedSet());
     String[] tokens = getRandomTokens(10);
     Directory indexDir = newDirectory();
     Directory taxoDir = newDirectory();

Modified: lucene/dev/branches/lucene5858/lucene/misc/src/test/org/apache/lucene/index/sorter/SorterTestBase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5858/lucene/misc/src/test/org/apache/lucene/index/sorter/SorterTestBase.java?rev=1621828&r1=1621827&r2=1621828&view=diff
==============================================================================
--- lucene/dev/branches/lucene5858/lucene/misc/src/test/org/apache/lucene/index/sorter/SorterTestBase.java (original)
+++ lucene/dev/branches/lucene5858/lucene/misc/src/test/org/apache/lucene/index/sorter/SorterTestBase.java Mon Sep  1 15:26:09 2014
@@ -182,14 +182,10 @@ public abstract class SorterTestBase ext
     doc.add(norms);
     doc.add(new BinaryDocValuesField(BINARY_DV_FIELD, new BytesRef(Integer.toString(id))));
     doc.add(new SortedDocValuesField(SORTED_DV_FIELD, new BytesRef(Integer.toString(id))));
-    if (defaultCodecSupportsSortedSet()) {
-      doc.add(new SortedSetDocValuesField(SORTED_SET_DV_FIELD, new BytesRef(Integer.toString(id))));
-      doc.add(new SortedSetDocValuesField(SORTED_SET_DV_FIELD, new BytesRef(Integer.toString(id + 1))));
-    }
-    if (defaultCodecSupportsSortedNumeric()) {
-      doc.add(new SortedNumericDocValuesField(SORTED_NUMERIC_DV_FIELD, id));
-      doc.add(new SortedNumericDocValuesField(SORTED_NUMERIC_DV_FIELD, id + 1));
-    }
+    doc.add(new SortedSetDocValuesField(SORTED_SET_DV_FIELD, new BytesRef(Integer.toString(id))));
+    doc.add(new SortedSetDocValuesField(SORTED_SET_DV_FIELD, new BytesRef(Integer.toString(id + 1))));
+    doc.add(new SortedNumericDocValuesField(SORTED_NUMERIC_DV_FIELD, id));
+    doc.add(new SortedNumericDocValuesField(SORTED_NUMERIC_DV_FIELD, id + 1));
     doc.add(new Field(TERM_VECTORS_FIELD, Integer.toString(id), TERM_VECTORS_TYPE));
     return doc;
   }
@@ -381,7 +377,6 @@ public abstract class SorterTestBase ext
   
   @Test
   public void testSortedSetDocValuesField() throws Exception {
-    assumeTrue("default codec does not support SORTED_SET", defaultCodecSupportsSortedSet());
     SortedSetDocValues dv = reader.getSortedSetDocValues(SORTED_SET_DV_FIELD);
     int maxDoc = reader.maxDoc();
     for (int i = 0; i < maxDoc; i++) {
@@ -397,7 +392,6 @@ public abstract class SorterTestBase ext
   
   @Test
   public void testSortedNumericDocValuesField() throws Exception {
-    assumeTrue("default codec does not support SORTED_NUMERIC", defaultCodecSupportsSortedNumeric());
     SortedNumericDocValues dv = reader.getSortedNumericDocValues(SORTED_NUMERIC_DV_FIELD);
     int maxDoc = reader.maxDoc();
     for (int i = 0; i < maxDoc; i++) {

Modified: lucene/dev/branches/lucene5858/lucene/misc/src/test/org/apache/lucene/index/sorter/TestSortingMergePolicy.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5858/lucene/misc/src/test/org/apache/lucene/index/sorter/TestSortingMergePolicy.java?rev=1621828&r1=1621827&r2=1621828&view=diff
==============================================================================
--- lucene/dev/branches/lucene5858/lucene/misc/src/test/org/apache/lucene/index/sorter/TestSortingMergePolicy.java (original)
+++ lucene/dev/branches/lucene5858/lucene/misc/src/test/org/apache/lucene/index/sorter/TestSortingMergePolicy.java Mon Sep  1 15:26:09 2014
@@ -135,13 +135,11 @@ public class TestSortingMergePolicy exte
     iw1.w.addDocument(doc);
     iw2.w.addDocument(doc);
 
-    if (defaultCodecSupportsFieldUpdates()) {
-      // update NDV of docs belonging to one term (covers many documents)
-      final long value = random().nextLong();
-      final String term = RandomPicks.randomFrom(random(), terms);
-      iw1.w.updateNumericDocValue(new Term("s", term), "ndv", value);
-      iw2.w.updateNumericDocValue(new Term("s", term), "ndv", value);
-    }
+    // update NDV of docs belonging to one term (covers many documents)
+    final long value = random().nextLong();
+    final String term = RandomPicks.randomFrom(random(), terms);
+    iw1.w.updateNumericDocValue(new Term("s", term), "ndv", value);
+    iw2.w.updateNumericDocValue(new Term("s", term), "ndv", value);
     
     iw1.forceMerge(1);
     iw2.forceMerge(1);

Modified: lucene/dev/branches/lucene5858/lucene/misc/src/test/org/apache/lucene/uninverting/TestFieldCache.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5858/lucene/misc/src/test/org/apache/lucene/uninverting/TestFieldCache.java?rev=1621828&r1=1621827&r2=1621828&view=diff
==============================================================================
--- lucene/dev/branches/lucene5858/lucene/misc/src/test/org/apache/lucene/uninverting/TestFieldCache.java (original)
+++ lucene/dev/branches/lucene5858/lucene/misc/src/test/org/apache/lucene/uninverting/TestFieldCache.java Mon Sep  1 15:26:09 2014
@@ -430,10 +430,8 @@ public class TestFieldCache extends Luce
     doc.add(new BinaryDocValuesField("binary", new BytesRef("binary value")));
     doc.add(new SortedDocValuesField("sorted", new BytesRef("sorted value")));
     doc.add(new NumericDocValuesField("numeric", 42));
-    if (defaultCodecSupportsSortedSet()) {
-      doc.add(new SortedSetDocValuesField("sortedset", new BytesRef("sortedset value1")));
-      doc.add(new SortedSetDocValuesField("sortedset", new BytesRef("sortedset value2")));
-    }
+    doc.add(new SortedSetDocValuesField("sortedset", new BytesRef("sortedset value1")));
+    doc.add(new SortedSetDocValuesField("sortedset", new BytesRef("sortedset value2")));
     iw.addDocument(doc);
     DirectoryReader ir = iw.getReader();
     iw.close();
@@ -525,37 +523,35 @@ public class TestFieldCache extends Luce
     assertTrue(bits.get(0));
     
     // SortedSet type: can be retrieved via getDocTermOrds() 
-    if (defaultCodecSupportsSortedSet()) {
-      try {
-        FieldCache.DEFAULT.getNumerics(ar, "sortedset", FieldCache.NUMERIC_UTILS_INT_PARSER, false);
-        fail();
-      } catch (IllegalStateException expected) {}
-    
-      try {
-        FieldCache.DEFAULT.getTerms(ar, "sortedset", true);
-        fail();
-      } catch (IllegalStateException expected) {}
-    
-      try {
-        FieldCache.DEFAULT.getTermsIndex(ar, "sortedset");
-        fail();
-      } catch (IllegalStateException expected) {}
-      
-      try {
-        new DocTermOrds(ar, null, "sortedset");
-        fail();
-      } catch (IllegalStateException expected) {}
-    
-      sortedSet = FieldCache.DEFAULT.getDocTermOrds(ar, "sortedset", null);
-      sortedSet.setDocument(0);
-      assertEquals(0, sortedSet.nextOrd());
-      assertEquals(1, sortedSet.nextOrd());
-      assertEquals(SortedSetDocValues.NO_MORE_ORDS, sortedSet.nextOrd());
-      assertEquals(2, sortedSet.getValueCount());
+    try {
+      FieldCache.DEFAULT.getNumerics(ar, "sortedset", FieldCache.NUMERIC_UTILS_INT_PARSER, false);
+      fail();
+    } catch (IllegalStateException expected) {}
     
-      bits = FieldCache.DEFAULT.getDocsWithField(ar, "sortedset");
-      assertTrue(bits.get(0));
-    }
+    try {
+      FieldCache.DEFAULT.getTerms(ar, "sortedset", true);
+      fail();
+    } catch (IllegalStateException expected) {}
+    
+    try {
+      FieldCache.DEFAULT.getTermsIndex(ar, "sortedset");
+      fail();
+    } catch (IllegalStateException expected) {}
+    
+    try {
+      new DocTermOrds(ar, null, "sortedset");
+      fail();
+    } catch (IllegalStateException expected) {}
+    
+    sortedSet = FieldCache.DEFAULT.getDocTermOrds(ar, "sortedset", null);
+    sortedSet.setDocument(0);
+    assertEquals(0, sortedSet.nextOrd());
+    assertEquals(1, sortedSet.nextOrd());
+    assertEquals(SortedSetDocValues.NO_MORE_ORDS, sortedSet.nextOrd());
+    assertEquals(2, sortedSet.getValueCount());
+    
+    bits = FieldCache.DEFAULT.getDocsWithField(ar, "sortedset");
+    assertTrue(bits.get(0));
     
     ir.close();
     dir.close();

Modified: lucene/dev/branches/lucene5858/lucene/misc/src/test/org/apache/lucene/uninverting/TestFieldCacheVsDocValues.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5858/lucene/misc/src/test/org/apache/lucene/uninverting/TestFieldCacheVsDocValues.java?rev=1621828&r1=1621827&r2=1621828&view=diff
==============================================================================
--- lucene/dev/branches/lucene5858/lucene/misc/src/test/org/apache/lucene/uninverting/TestFieldCacheVsDocValues.java (original)
+++ lucene/dev/branches/lucene5858/lucene/misc/src/test/org/apache/lucene/uninverting/TestFieldCacheVsDocValues.java Mon Sep  1 15:26:09 2014
@@ -99,7 +99,6 @@ public class TestFieldCacheVsDocValues e
   }
   
   public void testSortedSetFixedLengthVsUninvertedField() throws Exception {
-    assumeTrue("Codec does not support SORTED_SET", defaultCodecSupportsSortedSet());
     int numIterations = atLeast(1);
     for (int i = 0; i < numIterations; i++) {
       int fixedLength = TestUtil.nextInt(random(), 1, 10);
@@ -108,7 +107,6 @@ public class TestFieldCacheVsDocValues e
   }
   
   public void testSortedSetVariableLengthVsUninvertedField() throws Exception {
-    assumeTrue("Codec does not support SORTED_SET", defaultCodecSupportsSortedSet());
     int numIterations = atLeast(1);
     for (int i = 0; i < numIterations; i++) {
       doTestSortedSetVsUninvertedField(1, 10);
@@ -403,7 +401,6 @@ public class TestFieldCacheVsDocValues e
   }
   
   private void doTestMissingVsFieldCache(LongProducer longs) throws Exception {
-    assumeTrue("Codec does not support getDocsWithField", defaultCodecSupportsDocsWithField());
     Directory dir = newDirectory();
     IndexWriterConfig conf = newIndexWriterConfig(new MockAnalyzer(random()));
     RandomIndexWriter writer = new RandomIndexWriter(random(), dir, conf);

Modified: lucene/dev/branches/lucene5858/lucene/test-framework/src/java/org/apache/lucene/index/BaseDocValuesFormatTestCase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5858/lucene/test-framework/src/java/org/apache/lucene/index/BaseDocValuesFormatTestCase.java?rev=1621828&r1=1621827&r2=1621828&view=diff
==============================================================================
--- lucene/dev/branches/lucene5858/lucene/test-framework/src/java/org/apache/lucene/index/BaseDocValuesFormatTestCase.java (original)
+++ lucene/dev/branches/lucene5858/lucene/test-framework/src/java/org/apache/lucene/index/BaseDocValuesFormatTestCase.java Mon Sep  1 15:26:09 2014
@@ -78,13 +78,13 @@ public abstract class BaseDocValuesForma
       doc.add(new BinaryDocValuesField("bdv", new BytesRef(TestUtil.randomSimpleString(random()))));
       doc.add(new SortedDocValuesField("sdv", new BytesRef(TestUtil.randomSimpleString(random(), 2))));
     }
-    if (defaultCodecSupportsSortedSet()) {
+    if (codecSupportsSortedSet()) {
       final int numValues = random().nextInt(5);
       for (int i = 0; i < numValues; ++i) {
         doc.add(new SortedSetDocValuesField("ssdv", new BytesRef(TestUtil.randomSimpleString(random(), 2))));
       }
     }
-    if (defaultCodecSupportsSortedNumeric()) {
+    if (codecSupportsSortedNumeric()) {
       final int numValues = random().nextInt(5);
       for (int i = 0; i < numValues; ++i) {
         doc.add(new SortedNumericDocValuesField("sndv", TestUtil.nextLong(random(), Long.MIN_VALUE, Long.MAX_VALUE)));
@@ -711,7 +711,7 @@ public abstract class BaseDocValuesForma
     iwriter.close();
     
     SortedDocValues dv = getOnlySegmentReader(ireader).getSortedDocValues("field");
-    if (defaultCodecSupportsDocsWithField()) {
+    if (codecSupportsDocsWithField()) {
       assertEquals(-1, dv.getOrd(0));
       assertEquals(0, dv.getValueCount());
     } else {
@@ -768,7 +768,7 @@ public abstract class BaseDocValuesForma
     SortedDocValues dv = ireader.leaves().get(0).reader().getSortedDocValues("dv");
     BytesRef scratch = dv.lookupOrd(dv.getOrd(0));
     assertEquals(new BytesRef("hello world 2"), scratch);
-    if (defaultCodecSupportsDocsWithField()) {
+    if (codecSupportsDocsWithField()) {
       assertEquals(-1, dv.getOrd(1));
     }
     scratch = dv.get(1);
@@ -1056,7 +1056,7 @@ public abstract class BaseDocValuesForma
   public void testRandomSortedBytes() throws IOException {
     Directory dir = newDirectory();
     IndexWriterConfig cfg = newIndexWriterConfig(new MockAnalyzer(random()));
-    if (!defaultCodecSupportsDocsWithField()) {
+    if (!codecSupportsDocsWithField()) {
       // if the codec doesnt support missing, we expect missing to be mapped to byte[]
       // by the impersonator, but we have to give it a chance to merge them to this
       cfg.setMergePolicy(newLogMergePolicy());
@@ -1085,14 +1085,14 @@ public abstract class BaseDocValuesForma
       doc.add(newTextField("id", "noValue", Field.Store.YES));
       w.addDocument(doc);
     }
-    if (!defaultCodecSupportsDocsWithField()) {
+    if (!codecSupportsDocsWithField()) {
       BytesRef bytesRef = new BytesRef();
       hash.add(bytesRef); // add empty value for the gaps
     }
     if (rarely()) {
       w.commit();
     }
-    if (!defaultCodecSupportsDocsWithField()) {
+    if (!codecSupportsDocsWithField()) {
       // if the codec doesnt support missing, we expect missing to be mapped to byte[]
       // by the impersonator, but we have to give it a chance to merge them to this
       w.forceMerge(1);
@@ -1472,7 +1472,7 @@ public abstract class BaseDocValuesForma
   }
   
   public void testSortedSetOneValue() throws IOException {
-    assumeTrue("Codec does not support SORTED_SET", defaultCodecSupportsSortedSet());
+    assumeTrue("Codec does not support SORTED_SET", codecSupportsSortedSet());
     Directory directory = newDirectory();
     RandomIndexWriter iwriter = new RandomIndexWriter(random(), directory);
     
@@ -1497,7 +1497,7 @@ public abstract class BaseDocValuesForma
   }
   
   public void testSortedSetTwoFields() throws IOException {
-    assumeTrue("Codec does not support SORTED_SET", defaultCodecSupportsSortedSet());
+    assumeTrue("Codec does not support SORTED_SET", codecSupportsSortedSet());
     Directory directory = newDirectory();
     RandomIndexWriter iwriter = new RandomIndexWriter(random(), directory);
     
@@ -1532,7 +1532,7 @@ public abstract class BaseDocValuesForma
   }
   
   public void testSortedSetTwoDocumentsMerged() throws IOException {
-    assumeTrue("Codec does not support SORTED_SET", defaultCodecSupportsSortedSet());
+    assumeTrue("Codec does not support SORTED_SET", codecSupportsSortedSet());
     Directory directory = newDirectory();
     Analyzer analyzer = new MockAnalyzer(random());
     IndexWriterConfig iwconfig = newIndexWriterConfig(analyzer);
@@ -1574,7 +1574,7 @@ public abstract class BaseDocValuesForma
   }
   
   public void testSortedSetTwoValues() throws IOException {
-    assumeTrue("Codec does not support SORTED_SET", defaultCodecSupportsSortedSet());
+    assumeTrue("Codec does not support SORTED_SET", codecSupportsSortedSet());
     Directory directory = newDirectory();
     RandomIndexWriter iwriter = new RandomIndexWriter(random(), directory);
     
@@ -1604,7 +1604,7 @@ public abstract class BaseDocValuesForma
   }
   
   public void testSortedSetTwoValuesUnordered() throws IOException {
-    assumeTrue("Codec does not support SORTED_SET", defaultCodecSupportsSortedSet());
+    assumeTrue("Codec does not support SORTED_SET", codecSupportsSortedSet());
     Directory directory = newDirectory();
     RandomIndexWriter iwriter = new RandomIndexWriter(random(), directory);
     
@@ -1634,7 +1634,7 @@ public abstract class BaseDocValuesForma
   }
   
   public void testSortedSetThreeValuesTwoDocs() throws IOException {
-    assumeTrue("Codec does not support SORTED_SET", defaultCodecSupportsSortedSet());
+    assumeTrue("Codec does not support SORTED_SET", codecSupportsSortedSet());
     Directory directory = newDirectory();
     Analyzer analyzer = new MockAnalyzer(random());
     IndexWriterConfig iwconfig = newIndexWriterConfig(analyzer);
@@ -1683,7 +1683,7 @@ public abstract class BaseDocValuesForma
   }
   
   public void testSortedSetTwoDocumentsLastMissing() throws IOException {
-    assumeTrue("Codec does not support SORTED_SET", defaultCodecSupportsSortedSet());
+    assumeTrue("Codec does not support SORTED_SET", codecSupportsSortedSet());
     Directory directory = newDirectory();
     Analyzer analyzer = new MockAnalyzer(random());
     IndexWriterConfig iwconfig = newIndexWriterConfig(analyzer);
@@ -1715,7 +1715,7 @@ public abstract class BaseDocValuesForma
   }
   
   public void testSortedSetTwoDocumentsLastMissingMerge() throws IOException {
-    assumeTrue("Codec does not support SORTED_SET", defaultCodecSupportsSortedSet());
+    assumeTrue("Codec does not support SORTED_SET", codecSupportsSortedSet());
     Directory directory = newDirectory();
     Analyzer analyzer = new MockAnalyzer(random());
     IndexWriterConfig iwconfig = newIndexWriterConfig(analyzer);
@@ -1749,7 +1749,7 @@ public abstract class BaseDocValuesForma
   }
   
   public void testSortedSetTwoDocumentsFirstMissing() throws IOException {
-    assumeTrue("Codec does not support SORTED_SET", defaultCodecSupportsSortedSet());
+    assumeTrue("Codec does not support SORTED_SET", codecSupportsSortedSet());
     Directory directory = newDirectory();
     Analyzer analyzer = new MockAnalyzer(random());
     IndexWriterConfig iwconfig = newIndexWriterConfig(analyzer);
@@ -1782,7 +1782,7 @@ public abstract class BaseDocValuesForma
   }
   
   public void testSortedSetTwoDocumentsFirstMissingMerge() throws IOException {
-    assumeTrue("Codec does not support SORTED_SET", defaultCodecSupportsSortedSet());
+    assumeTrue("Codec does not support SORTED_SET", codecSupportsSortedSet());
     Directory directory = newDirectory();
     Analyzer analyzer = new MockAnalyzer(random());
     IndexWriterConfig iwconfig = newIndexWriterConfig(analyzer);
@@ -1816,7 +1816,7 @@ public abstract class BaseDocValuesForma
   }
   
   public void testSortedSetMergeAwayAllValues() throws IOException {
-    assumeTrue("Codec does not support SORTED_SET", defaultCodecSupportsSortedSet());
+    assumeTrue("Codec does not support SORTED_SET", codecSupportsSortedSet());
     Directory directory = newDirectory();
     Analyzer analyzer = new MockAnalyzer(random());
     IndexWriterConfig iwconfig = newIndexWriterConfig(analyzer);
@@ -1845,7 +1845,7 @@ public abstract class BaseDocValuesForma
   }
   
   public void testSortedSetTermsEnum() throws IOException {
-    assumeTrue("Codec does not support SORTED_SET", defaultCodecSupportsSortedSet());
+    assumeTrue("Codec does not support SORTED_SET", codecSupportsSortedSet());
     Directory directory = newDirectory();
     Analyzer analyzer = new MockAnalyzer(random());
     IndexWriterConfig iwconfig = newIndexWriterConfig(analyzer);
@@ -2006,7 +2006,7 @@ public abstract class BaseDocValuesForma
   }
   
   public void testSortedSetFixedLengthVsStoredFields() throws Exception {
-    assumeTrue("Codec does not support SORTED_SET", defaultCodecSupportsSortedSet());
+    assumeTrue("Codec does not support SORTED_SET", codecSupportsSortedSet());
     int numIterations = atLeast(1);
     for (int i = 0; i < numIterations; i++) {
       int fixedLength = TestUtil.nextInt(random(), 1, 10);
@@ -2015,7 +2015,7 @@ public abstract class BaseDocValuesForma
   }
   
   public void testSortedNumericsSingleValuedVsStoredFields() throws Exception {
-    assumeTrue("Codec does not support SORTED_NUMERIC", defaultCodecSupportsSortedNumeric());
+    assumeTrue("Codec does not support SORTED_NUMERIC", codecSupportsSortedNumeric());
     int numIterations = atLeast(1);
     for (int i = 0; i < numIterations; i++) {
       doTestSortedNumericsVsStoredFields(
@@ -2036,7 +2036,7 @@ public abstract class BaseDocValuesForma
   }
   
   public void testSortedNumericsSingleValuedMissingVsStoredFields() throws Exception {
-    assumeTrue("Codec does not support SORTED_NUMERIC", defaultCodecSupportsSortedNumeric());
+    assumeTrue("Codec does not support SORTED_NUMERIC", codecSupportsSortedNumeric());
     int numIterations = atLeast(1);
     for (int i = 0; i < numIterations; i++) {
       doTestSortedNumericsVsStoredFields(
@@ -2057,7 +2057,7 @@ public abstract class BaseDocValuesForma
   }
   
   public void testSortedNumericsMultipleValuesVsStoredFields() throws Exception {
-    assumeTrue("Codec does not support SORTED_NUMERIC", defaultCodecSupportsSortedNumeric());
+    assumeTrue("Codec does not support SORTED_NUMERIC", codecSupportsSortedNumeric());
     int numIterations = atLeast(1);
     for (int i = 0; i < numIterations; i++) {
       doTestSortedNumericsVsStoredFields(
@@ -2078,7 +2078,7 @@ public abstract class BaseDocValuesForma
   }
   
   public void testSortedSetVariableLengthVsStoredFields() throws Exception {
-    assumeTrue("Codec does not support SORTED_SET", defaultCodecSupportsSortedSet());
+    assumeTrue("Codec does not support SORTED_SET", codecSupportsSortedSet());
     int numIterations = atLeast(1);
     for (int i = 0; i < numIterations; i++) {
       doTestSortedSetVsStoredFields(atLeast(300), 1, 10, 16);
@@ -2086,7 +2086,7 @@ public abstract class BaseDocValuesForma
   }
 
   public void testSortedSetFixedLengthSingleValuedVsStoredFields() throws Exception {
-    assumeTrue("Codec does not support SORTED_SET", defaultCodecSupportsSortedSet());
+    assumeTrue("Codec does not support SORTED_SET", codecSupportsSortedSet());
     int numIterations = atLeast(1);
     for (int i = 0; i < numIterations; i++) {
       int fixedLength = TestUtil.nextInt(random(), 1, 10);
@@ -2095,7 +2095,7 @@ public abstract class BaseDocValuesForma
   }
   
   public void testSortedSetVariableLengthSingleValuedVsStoredFields() throws Exception {
-    assumeTrue("Codec does not support SORTED_SET", defaultCodecSupportsSortedSet());
+    assumeTrue("Codec does not support SORTED_SET", codecSupportsSortedSet());
     int numIterations = atLeast(1);
     for (int i = 0; i < numIterations; i++) {
       doTestSortedSetVsStoredFields(atLeast(300), 1, 10, 1);
@@ -2137,7 +2137,7 @@ public abstract class BaseDocValuesForma
   }
   
   public void testTwoNumbersOneMissing() throws IOException {
-    assumeTrue("Codec does not support getDocsWithField", defaultCodecSupportsDocsWithField());
+    assumeTrue("Codec does not support getDocsWithField", codecSupportsDocsWithField());
     Directory directory = newDirectory();
     IndexWriterConfig conf = newIndexWriterConfig(null);
     conf.setMergePolicy(newLogMergePolicy());
@@ -2166,7 +2166,7 @@ public abstract class BaseDocValuesForma
   }
   
   public void testTwoNumbersOneMissingWithMerging() throws IOException {
-    assumeTrue("Codec does not support getDocsWithField", defaultCodecSupportsDocsWithField());
+    assumeTrue("Codec does not support getDocsWithField", codecSupportsDocsWithField());
     Directory directory = newDirectory();
     IndexWriterConfig conf = newIndexWriterConfig(null);
     conf.setMergePolicy(newLogMergePolicy());
@@ -2196,7 +2196,7 @@ public abstract class BaseDocValuesForma
   }
   
   public void testThreeNumbersOneMissingWithMerging() throws IOException {
-    assumeTrue("Codec does not support getDocsWithField", defaultCodecSupportsDocsWithField());
+    assumeTrue("Codec does not support getDocsWithField", codecSupportsDocsWithField());
     Directory directory = newDirectory();
     IndexWriterConfig conf = newIndexWriterConfig(null);
     conf.setMergePolicy(newLogMergePolicy());
@@ -2232,7 +2232,7 @@ public abstract class BaseDocValuesForma
   }
   
   public void testTwoBytesOneMissing() throws IOException {
-    assumeTrue("Codec does not support getDocsWithField", defaultCodecSupportsDocsWithField());
+    assumeTrue("Codec does not support getDocsWithField", codecSupportsDocsWithField());
     Directory directory = newDirectory();
     IndexWriterConfig conf = newIndexWriterConfig(null);
     conf.setMergePolicy(newLogMergePolicy());
@@ -2263,7 +2263,7 @@ public abstract class BaseDocValuesForma
   }
   
   public void testTwoBytesOneMissingWithMerging() throws IOException {
-    assumeTrue("Codec does not support getDocsWithField", defaultCodecSupportsDocsWithField());
+    assumeTrue("Codec does not support getDocsWithField", codecSupportsDocsWithField());
     Directory directory = newDirectory();
     IndexWriterConfig conf = newIndexWriterConfig(null);
     conf.setMergePolicy(newLogMergePolicy());
@@ -2295,7 +2295,7 @@ public abstract class BaseDocValuesForma
   }
   
   public void testThreeBytesOneMissingWithMerging() throws IOException {
-    assumeTrue("Codec does not support getDocsWithField", defaultCodecSupportsDocsWithField());
+    assumeTrue("Codec does not support getDocsWithField", codecSupportsDocsWithField());
     Directory directory = newDirectory();
     IndexWriterConfig conf = newIndexWriterConfig(null);
     conf.setMergePolicy(newLogMergePolicy());
@@ -2424,9 +2424,9 @@ public abstract class BaseDocValuesForma
   
   /** Tests dv against stored fields with threads (all types + missing) */
   public void testThreads2() throws Exception {
-    assumeTrue("Codec does not support getDocsWithField", defaultCodecSupportsDocsWithField());
-    assumeTrue("Codec does not support SORTED_SET", defaultCodecSupportsSortedSet());
-    assumeTrue("Codec does not support SORTED_NUMERIC", defaultCodecSupportsSortedNumeric());
+    assumeTrue("Codec does not support getDocsWithField", codecSupportsDocsWithField());
+    assumeTrue("Codec does not support SORTED_SET", codecSupportsSortedSet());
+    assumeTrue("Codec does not support SORTED_NUMERIC", codecSupportsSortedNumeric());
     Directory dir = newDirectory();
     IndexWriterConfig conf = newIndexWriterConfig(new MockAnalyzer(random()));
     RandomIndexWriter writer = new RandomIndexWriter(random(), dir, conf);
@@ -2596,9 +2596,9 @@ public abstract class BaseDocValuesForma
   }
   
   public void testThreads3() throws Exception {
-    assumeTrue("Codec does not support getDocsWithField", defaultCodecSupportsDocsWithField());
-    assumeTrue("Codec does not support SORTED_SET", defaultCodecSupportsSortedSet());
-    assumeTrue("Codec does not support SORTED_NUMERIC", defaultCodecSupportsSortedNumeric());
+    assumeTrue("Codec does not support getDocsWithField", codecSupportsDocsWithField());
+    assumeTrue("Codec does not support SORTED_SET", codecSupportsSortedSet());
+    assumeTrue("Codec does not support SORTED_NUMERIC", codecSupportsSortedNumeric());
     Directory dir = newFSDirectory(createTempDir());
     IndexWriterConfig conf = newIndexWriterConfig(new MockAnalyzer(random()));
     RandomIndexWriter writer = new RandomIndexWriter(random(), dir, conf);
@@ -2700,7 +2700,7 @@ public abstract class BaseDocValuesForma
   }
   
   public void testOneSortedNumber() throws IOException {
-    assumeTrue("Codec does not support SORTED_NUMERIC", defaultCodecSupportsSortedNumeric());
+    assumeTrue("Codec does not support SORTED_NUMERIC", codecSupportsSortedNumeric());
     Directory directory = newDirectory();
     RandomIndexWriter writer = new RandomIndexWriter(random(), directory);
     Document doc = new Document();
@@ -2721,7 +2721,7 @@ public abstract class BaseDocValuesForma
   }
   
   public void testOneSortedNumberOneMissing() throws IOException {
-    assumeTrue("Codec does not support SORTED_NUMERIC", defaultCodecSupportsSortedNumeric());
+    assumeTrue("Codec does not support SORTED_NUMERIC", codecSupportsSortedNumeric());
     Directory directory = newDirectory();
     IndexWriter writer = new IndexWriter(directory, new IndexWriterConfig(null));
     Document doc = new Document();
@@ -2750,7 +2750,7 @@ public abstract class BaseDocValuesForma
   }
   
   public void testTwoSortedNumber() throws IOException {
-    assumeTrue("Codec does not support SORTED_NUMERIC", defaultCodecSupportsSortedNumeric());
+    assumeTrue("Codec does not support SORTED_NUMERIC", codecSupportsSortedNumeric());
     Directory directory = newDirectory();
     RandomIndexWriter writer = new RandomIndexWriter(random(), directory);
     Document doc = new Document();
@@ -2773,7 +2773,7 @@ public abstract class BaseDocValuesForma
   }
   
   public void testTwoSortedNumberOneMissing() throws IOException {
-    assumeTrue("Codec does not support SORTED_NUMERIC", defaultCodecSupportsSortedNumeric());
+    assumeTrue("Codec does not support SORTED_NUMERIC", codecSupportsSortedNumeric());
     Directory directory = newDirectory();
     IndexWriter writer = new IndexWriter(directory, new IndexWriterConfig(null));
     Document doc = new Document();
@@ -2804,7 +2804,7 @@ public abstract class BaseDocValuesForma
   }
   
   public void testSortedNumberMerge() throws IOException {
-    assumeTrue("Codec does not support SORTED_NUMERIC", defaultCodecSupportsSortedNumeric());
+    assumeTrue("Codec does not support SORTED_NUMERIC", codecSupportsSortedNumeric());
     Directory directory = newDirectory();
     IndexWriterConfig iwc = new IndexWriterConfig(null);
     iwc.setMergePolicy(newLogMergePolicy());
@@ -2835,7 +2835,7 @@ public abstract class BaseDocValuesForma
   }
   
   public void testSortedNumberMergeAwayAllValues() throws IOException {
-    assumeTrue("Codec does not support SORTED_NUMERIC", defaultCodecSupportsSortedNumeric());
+    assumeTrue("Codec does not support SORTED_NUMERIC", codecSupportsSortedNumeric());
     Directory directory = newDirectory();
     Analyzer analyzer = new MockAnalyzer(random());
     IndexWriterConfig iwconfig = newIndexWriterConfig(analyzer);
@@ -2867,4 +2867,20 @@ public abstract class BaseDocValuesForma
   protected boolean codecAcceptsHugeBinaryValues(String field) {
     return true;
   }
+  
+  /** Returns true if the codec "supports" docsWithField 
+   * (other codecs return MatchAllBits, because you couldnt write missing values before) */
+  protected boolean codecSupportsDocsWithField() {
+    return true;
+  }
+  
+  /** Returns true if the default codec supports SORTED_SET docvalues */ 
+  protected boolean codecSupportsSortedSet() {
+    return true;
+  }
+  
+  /** Returns true if the default codec supports SORTED_NUMERIC docvalues */ 
+  protected boolean codecSupportsSortedNumeric() {
+    return true;
+  }
 }

Modified: lucene/dev/branches/lucene5858/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5858/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java?rev=1621828&r1=1621827&r2=1621828&view=diff
==============================================================================
--- lucene/dev/branches/lucene5858/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java (original)
+++ lucene/dev/branches/lucene5858/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java Mon Sep  1 15:26:09 2014
@@ -1673,61 +1673,6 @@ public abstract class LuceneTestCase ext
       throw new IOException("Cannot find resource: " + name);
     }
   }
-  
-  /** Returns true if the default codec supports single valued docvalues with missing values */ 
-  public static boolean defaultCodecSupportsMissingDocValues() {
-    String name = Codec.getDefault().getName();
-    if (name.equals("Lucene3x") ||
-        name.equals("Lucene40") || name.equals("Appending") ||
-        name.equals("Lucene41") || 
-        name.equals("Lucene42")) {
-      return false;
-    }
-    return true;
-  }
-  
-  /** Returns true if the default codec supports SORTED_SET docvalues */ 
-  public static boolean defaultCodecSupportsSortedSet() {
-    String name = Codec.getDefault().getName();
-    if (name.equals("Lucene40") || name.equals("Lucene41")) {
-      return false;
-    }
-    return true;
-  }
-  
-  /** Returns true if the default codec supports SORTED_NUMERIC docvalues */ 
-  public static boolean defaultCodecSupportsSortedNumeric() {
-    String name = Codec.getDefault().getName();
-    if (name.equals("Lucene40") || name.equals("Lucene41") || name.equals("Lucene42") || name.equals("Lucene45") || name.equals("Lucene46")) {
-      return false;
-    }
-    return true;
-  }
-  
-  /** Returns true if the codec "supports" docsWithField 
-   * (other codecs return MatchAllBits, because you couldnt write missing values before) */
-  public static boolean defaultCodecSupportsDocsWithField() {
-    String name = Codec.getDefault().getName();
-    if (name.equals("Lucene40") || name.equals("Lucene41") || name.equals("Lucene42")) {
-      return false;
-    }
-    return true;
-  }
-  
-  /** Returns true if the codec "supports" field updates. */
-  public static boolean defaultCodecSupportsFieldUpdates() {
-    String name = Codec.getDefault().getName();
-    if (name.equals("Lucene40") || name.equals("Lucene41") || name.equals("Lucene42") || name.equals("Lucene45")) {
-      return false;
-    }
-    return true;
-  }
-
-  /** Returns true if the codec "supports" writing segment and commit ids. */
-  public static boolean defaultCodecSupportsSegmentIds() {
-    SegmentInfoFormat siFormat = Codec.getDefault().segmentInfoFormat();
-    return siFormat instanceof SimpleTextSegmentInfoFormat || siFormat instanceof Lucene46SegmentInfoFormat;
-  }
 
   public void assertReaderEquals(String info, IndexReader leftReader, IndexReader rightReader) throws IOException {
     assertReaderStatisticsEquals(info, leftReader, rightReader);

Modified: lucene/dev/branches/lucene5858/solr/core/src/test/org/apache/solr/CursorPagingTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5858/solr/core/src/test/org/apache/solr/CursorPagingTest.java?rev=1621828&r1=1621827&r2=1621828&view=diff
==============================================================================
--- lucene/dev/branches/lucene5858/solr/core/src/test/org/apache/solr/CursorPagingTest.java (original)
+++ lucene/dev/branches/lucene5858/solr/core/src/test/org/apache/solr/CursorPagingTest.java Mon Sep  1 15:26:09 2014
@@ -125,7 +125,7 @@ public class CursorPagingTest extends So
     SolrParams params = null;
     
     final String intsort = "int" + (random().nextBoolean() ? "" : "_dv");
-    final String intmissingsort = defaultCodecSupportsMissingDocValues() ? intsort : "int";
+    final String intmissingsort = intsort;
 
     // trivial base case: ensure cursorMark against an empty index doesn't blow up
     cursorMark = CURSOR_MARK_START;
@@ -633,26 +633,15 @@ public class CursorPagingTest extends So
    * </p>
    * <ul>
    *  <li><code>_version_</code> is removed</li>
-   *  <li>
-   *    <code>*_dv_last</code>, <code>*_dv_first</code> and <code>*_dv</code>
-   *    fields are removed if the codec doesn't support missing DocValues
-   *  </li>
    * </ul>
-   * @see #defaultCodecSupportsMissingDocValues
    */
   public static List<String> pruneAndDeterministicallySort(Collection<String> raw) {
 
-    final boolean prune_dv = ! defaultCodecSupportsMissingDocValues();
-
     ArrayList<String> names = new ArrayList<>(37);
     for (String f : raw) {
       if (f.equals("_version_")) {
         continue;
       }
-      if (prune_dv && (f.endsWith("_dv_last") || f.endsWith("_dv_first"))
-                       || f.endsWith("_dv")) {
-        continue;
-      }
       names.add(f);
     }
 

Modified: lucene/dev/branches/lucene5858/solr/core/src/test/org/apache/solr/cloud/DistribCursorPagingTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5858/solr/core/src/test/org/apache/solr/cloud/DistribCursorPagingTest.java?rev=1621828&r1=1621827&r2=1621828&view=diff
==============================================================================
--- lucene/dev/branches/lucene5858/solr/core/src/test/org/apache/solr/cloud/DistribCursorPagingTest.java (original)
+++ lucene/dev/branches/lucene5858/solr/core/src/test/org/apache/solr/cloud/DistribCursorPagingTest.java Mon Sep  1 15:26:09 2014
@@ -149,7 +149,7 @@ public class DistribCursorPagingTest ext
     QueryResponse rsp = null;
 
     final String intsort = "int" + (random().nextBoolean() ? "" : "_dv");
-    final String intmissingsort = defaultCodecSupportsMissingDocValues() ? intsort : "int";
+    final String intmissingsort = intsort;
 
     // trivial base case: ensure cursorMark against an empty index doesn't blow up
     cursorMark = CURSOR_MARK_START;



Mime
View raw message