lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rm...@apache.org
Subject svn commit: r1344076 [2/2] - in /lucene/dev/trunk: lucene/analysis/common/src/test/org/apache/lucene/collation/ lucene/analysis/icu/src/test/org/apache/lucene/collation/ lucene/core/src/java/org/apache/lucene/codecs/lucene3x/ lucene/core/src/java/org/a...
Date Wed, 30 May 2012 02:07:34 GMT
Modified: lucene/dev/trunk/lucene/grouping/src/test/org/apache/lucene/search/grouping/GroupFacetCollectorTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/grouping/src/test/org/apache/lucene/search/grouping/GroupFacetCollectorTest.java?rev=1344076&r1=1344075&r2=1344076&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/grouping/src/test/org/apache/lucene/search/grouping/GroupFacetCollectorTest.java
(original)
+++ lucene/dev/trunk/lucene/grouping/src/test/org/apache/lucene/search/grouping/GroupFacetCollectorTest.java
Wed May 30 02:07:31 2012
@@ -48,7 +48,7 @@ public class GroupFacetCollectorTest ext
         dir,
         newIndexWriterConfig(TEST_VERSION_CURRENT,
             new MockAnalyzer(random())).setMergePolicy(newLogMergePolicy()));
-    boolean canUseDV = !"Lucene3x".equals(w.w.getConfig().getCodec().getName());
+    boolean canUseDV = true;
     boolean useDv = canUseDV && random().nextBoolean();
 
     // 0
@@ -360,7 +360,7 @@ public class GroupFacetCollectorTest ext
             new MockAnalyzer(random)
         )
     );
-    boolean canUseDV = !"Lucene3x".equals(writer.w.getConfig().getCodec().getName());
+    boolean canUseDV = true;
     boolean useDv = canUseDV && random.nextBoolean();
 
     Document doc = new Document();

Modified: lucene/dev/trunk/lucene/grouping/src/test/org/apache/lucene/search/grouping/GroupingSearchTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/grouping/src/test/org/apache/lucene/search/grouping/GroupingSearchTest.java?rev=1344076&r1=1344075&r2=1344076&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/grouping/src/test/org/apache/lucene/search/grouping/GroupingSearchTest.java
(original)
+++ lucene/dev/trunk/lucene/grouping/src/test/org/apache/lucene/search/grouping/GroupingSearchTest.java
Wed May 30 02:07:31 2012
@@ -51,7 +51,7 @@ public class GroupingSearchTest extends 
         dir,
         newIndexWriterConfig(TEST_VERSION_CURRENT,
             new MockAnalyzer(random())).setMergePolicy(newLogMergePolicy()));
-    boolean canUseIDV = !"Lucene3x".equals(w.w.getConfig().getCodec().getName());
+    boolean canUseIDV = true;
     List<Document> documents = new ArrayList<Document>();
     // 0
     Document doc = new Document();

Modified: lucene/dev/trunk/lucene/grouping/src/test/org/apache/lucene/search/grouping/TestGrouping.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/grouping/src/test/org/apache/lucene/search/grouping/TestGrouping.java?rev=1344076&r1=1344075&r2=1344076&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/grouping/src/test/org/apache/lucene/search/grouping/TestGrouping.java
(original)
+++ lucene/dev/trunk/lucene/grouping/src/test/org/apache/lucene/search/grouping/TestGrouping.java
Wed May 30 02:07:31 2012
@@ -73,7 +73,7 @@ public class TestGrouping extends Lucene
                                dir,
                                newIndexWriterConfig(TEST_VERSION_CURRENT,
                                                     new MockAnalyzer(random())).setMergePolicy(newLogMergePolicy()));
-    boolean canUseIDV = !"Lucene3x".equals(w.w.getConfig().getCodec().getName());
+    boolean canUseIDV = true;
     // 0
     Document doc = new Document();
     addGroupField(doc, groupField, "author1", canUseIDV);
@@ -701,8 +701,7 @@ public class TestGrouping extends Lucene
                                                   dir,
                                                   newIndexWriterConfig(TEST_VERSION_CURRENT,
                                                                        new MockAnalyzer(random())));
-      final boolean preFlex = "Lucene3x".equals(w.w.getConfig().getCodec().getName());
-      boolean canUseIDV = !preFlex;
+      boolean canUseIDV = true;
 
       Document doc = new Document();
       Document docNoGroup = new Document();
@@ -778,7 +777,7 @@ public class TestGrouping extends Lucene
         if (SlowCompositeReaderWrapper.class.isAssignableFrom(s.getIndexReader().getClass()))
{
           canUseIDV = false;
         } else {
-          canUseIDV = !preFlex;
+          canUseIDV = true;
         }
         final ShardState shards = new ShardState(s);
 
@@ -953,7 +952,7 @@ public class TestGrouping extends Lucene
 
           ValueHolder<Boolean> idvBasedImplsUsedSharded = new ValueHolder<Boolean>(false);
           final TopGroups<BytesRef> topGroupsShards = searchShards(s, shards.subSearchers,
query, groupSort, docSort,
-              groupOffset, topNGroups, docOffset, docsPerGroup, getScores, getMaxScores,
canUseIDV, preFlex, idvBasedImplsUsedSharded);
+              groupOffset, topNGroups, docOffset, docsPerGroup, getScores, getMaxScores,
canUseIDV, false, idvBasedImplsUsedSharded);
           final AbstractSecondPassGroupingCollector<?> c2;
           if (topGroups != null) {
 

Modified: lucene/dev/trunk/lucene/misc/src/test/org/apache/lucene/index/TestBalancedSegmentMergePolicy.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/misc/src/test/org/apache/lucene/index/TestBalancedSegmentMergePolicy.java?rev=1344076&r1=1344075&r2=1344076&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/misc/src/test/org/apache/lucene/index/TestBalancedSegmentMergePolicy.java
(original)
+++ lucene/dev/trunk/lucene/misc/src/test/org/apache/lucene/index/TestBalancedSegmentMergePolicy.java
Wed May 30 02:07:31 2012
@@ -44,7 +44,7 @@ public class TestBalancedSegmentMergePol
     mp.setMergePolicyParams(newMergePolicyParams(random()));
     iwc.setMergePolicy(mp);
     iw = new RandomIndexWriter(random(), dir, iwc);
-    LineFileDocs docs = new LineFileDocs(random(), !Codec.getDefault().getName().equals("Lucene3x"));
+    LineFileDocs docs = new LineFileDocs(random(), true);
     int numDocs = atLeast(200);
     for (int i = 0; i < numDocs; i++) {
       iw.addDocument(docs.nextDoc());

Modified: lucene/dev/trunk/lucene/queries/src/test/org/apache/lucene/queries/function/TestValueSources.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/queries/src/test/org/apache/lucene/queries/function/TestValueSources.java?rev=1344076&r1=1344075&r2=1344076&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/queries/src/test/org/apache/lucene/queries/function/TestValueSources.java
(original)
+++ lucene/dev/trunk/lucene/queries/src/test/org/apache/lucene/queries/function/TestValueSources.java
Wed May 30 02:07:31 2012
@@ -311,13 +311,8 @@ public class TestValueSources extends Lu
   }
   
   public void testSumTotalTermFreq() throws Exception {
-    if (Codec.getDefault().getName().equals("Lucene3x")) {
-      assertHits(new FunctionQuery(new SumTotalTermFreqValueSource("text")),
-          new float[] { -1f, -1f });
-    } else {
-      assertHits(new FunctionQuery(new SumTotalTermFreqValueSource("text")),
+    assertHits(new FunctionQuery(new SumTotalTermFreqValueSource("text")),
           new float[] { 8f, 8f });
-    }
   }
   
   public void testTermFreq() throws Exception {
@@ -346,15 +341,9 @@ public class TestValueSources extends Lu
   }
   
   public void testTotalTermFreq() throws Exception {
-    if (Codec.getDefault().getName().equals("Lucene3x")) {
-      assertHits(new FunctionQuery(
-          new TotalTermFreqValueSource("bogus", "bogus", "text", new BytesRef("test"))),
-          new float[] { -1f, -1f });
-    } else {
-      assertHits(new FunctionQuery(
-          new TotalTermFreqValueSource("bogus", "bogus", "text", new BytesRef("test"))),
-          new float[] { 4f, 4f });
-    }
+    assertHits(new FunctionQuery(
+        new TotalTermFreqValueSource("bogus", "bogus", "text", new BytesRef("test"))),
+        new float[] { 4f, 4f });
   }
   
   void assertHits(Query q, float scores[]) throws Exception {

Modified: lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/index/RandomIndexWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/index/RandomIndexWriter.java?rev=1344076&r1=1344075&r2=1344076&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/index/RandomIndexWriter.java
(original)
+++ lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/index/RandomIndexWriter.java
Wed May 30 02:07:31 2012
@@ -206,7 +206,7 @@ public class RandomIndexWriter implement
     DocValues.Type[] values = DocValues.Type.values();
     DocValues.Type type = values[r.nextInt(values.length)];
     String name = "random_" + type.name() + "" + docValuesFieldPrefix;
-    if ("Lucene3x".equals(codec.getName()) || doc.getField(name) != null) {
+    if (doc.getField(name) != null) {
       return;
     }
     final Field f;
@@ -403,10 +403,7 @@ public class RandomIndexWriter implement
     if (r.nextInt(20) == 2) {
       doRandomForceMerge();
     }
-    // If we are writing with PreFlexRW, force a full
-    // IndexReader.open so terms are sorted in codepoint
-    // order during searching:
-    if (!applyDeletions || !codec.getName().equals("Lucene3x") && r.nextBoolean())
{
+    if (!applyDeletions || r.nextBoolean()) {
       if (LuceneTestCase.VERBOSE) {
         System.out.println("RIW.getReader: use NRT reader");
       }

Modified: lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/index/ThreadedIndexingAndSearchingTestCase.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/index/ThreadedIndexingAndSearchingTestCase.java?rev=1344076&r1=1344075&r2=1344076&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/index/ThreadedIndexingAndSearchingTestCase.java
(original)
+++ lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/index/ThreadedIndexingAndSearchingTestCase.java
Wed May 30 02:07:31 2012
@@ -415,7 +415,7 @@ public abstract class ThreadedIndexingAn
     final long t0 = System.currentTimeMillis();
 
     Random random = new Random(random().nextLong());
-    final LineFileDocs docs = new LineFileDocs(random, defaultCodecSupportsDocValues());
+    final LineFileDocs docs = new LineFileDocs(random, true);
     final File tempDir = _TestUtil.getTempDir(testName);
     dir = newFSDirectory(tempDir);
     ((MockDirectoryWrapper) dir).setCheckIndexOnClose(false); // don't double-checkIndex,
we do it ourselves.
@@ -620,12 +620,10 @@ public abstract class ThreadedIndexingAn
   private int runQuery(IndexSearcher s, Query q) throws Exception {
     s.search(q, 10);
     int hitCount = s.search(q, null, 10, new Sort(new SortField("title", SortField.Type.STRING))).totalHits;
-    if (defaultCodecSupportsDocValues()) {
-      final Sort dvSort = new Sort(new SortField("title", SortField.Type.STRING));
-      dvSort.getSort()[0].setUseIndexValues(true);
-      int hitCount2 = s.search(q, null, 10, dvSort).totalHits;
-      assertEquals(hitCount, hitCount2);
-    }
+    final Sort dvSort = new Sort(new SortField("title", SortField.Type.STRING));
+    dvSort.getSort()[0].setUseIndexValues(true);
+    int hitCount2 = s.search(q, null, 10, dvSort).totalHits;
+    assertEquals(hitCount, hitCount2);
     return hitCount;
   }
 

Modified: lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/search/ShardSearchingTestBase.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/search/ShardSearchingTestBase.java?rev=1344076&r1=1344075&r2=1344076&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/search/ShardSearchingTestBase.java
(original)
+++ lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/search/ShardSearchingTestBase.java
Wed May 30 02:07:31 2012
@@ -518,7 +518,7 @@ public abstract class ShardSearchingTest
     @Override
     public void run() {
       try {
-        final LineFileDocs docs = new LineFileDocs(random(), defaultCodecSupportsDocValues());
+        final LineFileDocs docs = new LineFileDocs(random(), true);
         int numDocs = 0;
         while (System.nanoTime() < endTimeNanos) {
           final int what = random().nextInt(3);

Modified: lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java?rev=1344076&r1=1344075&r2=1344076&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java
(original)
+++ lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java
Wed May 30 02:07:31 2012
@@ -900,10 +900,6 @@ public abstract class LuceneTestCase ext
     }
   }
 
-  public static boolean defaultCodecSupportsDocValues() {
-    return !Codec.getDefault().getName().equals("Lucene3x");
-  }
-
   private static Directory newFSDirectoryImpl(
       Class<? extends FSDirectory> clazz, File file)
       throws IOException {

Modified: lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/util/TestRuleSetupAndRestoreClassEnv.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/util/TestRuleSetupAndRestoreClassEnv.java?rev=1344076&r1=1344075&r2=1344076&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/util/TestRuleSetupAndRestoreClassEnv.java
(original)
+++ lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/util/TestRuleSetupAndRestoreClassEnv.java
Wed May 30 02:07:31 2012
@@ -13,7 +13,6 @@ import java.util.TimeZone;
 import org.apache.lucene.codecs.Codec;
 import org.apache.lucene.codecs.PostingsFormat;
 import org.apache.lucene.codecs.appending.AppendingCodec;
-import org.apache.lucene.codecs.lucene3x.PreFlexRWCodec;
 import org.apache.lucene.codecs.lucene40.Lucene40Codec;
 import org.apache.lucene.codecs.simpletext.SimpleTextCodec;
 import org.apache.lucene.index.RandomCodec;
@@ -91,6 +90,7 @@ final class TestRuleSetupAndRestoreClass
       modifiableServicesField.setAccessible(true);
       @SuppressWarnings({"unchecked","rawtypes"}) final Map<String,Codec> serviceMap
=
         (Map) modifiableServicesField.get(spiLoader);
+      /* note: re-enable this if we make a Lucene4x impersonator 
       if (!(Codec.forName("Lucene3x") instanceof PreFlexRWCodec)) {
         if (Constants.JAVA_VENDOR.startsWith("IBM")) {
           // definitely a buggy version
@@ -103,7 +103,7 @@ final class TestRuleSetupAndRestoreClass
               " and does not respect classpath order, please report this to the vendor.");
         }
         serviceMap.put("Lucene3x", new PreFlexRWCodec());
-      }
+      } */
     } catch (Exception e) {
       throw new RuntimeException("Cannot access internals of Codec and NamedSPILoader classes",
e);
     }
@@ -156,11 +156,12 @@ final class TestRuleSetupAndRestoreClass
     savedCodec = Codec.getDefault();
     final Codec codec;
     int randomVal = random.nextInt(10);
-    if ("Lucene3x".equals(TEST_CODEC) || ("random".equals(TEST_CODEC) && randomVal
< 2 && !shouldAvoidCodec("Lucene3x"))) { // preflex-only setup
+    /* note: re-enable this if we make a 4.x impersonator
+     * if ("Lucene3x".equals(TEST_CODEC) || ("random".equals(TEST_CODEC) && randomVal
< 2 && !shouldAvoidCodec("Lucene3x"))) { // preflex-only setup
       codec = Codec.forName("Lucene3x");
       assert (codec instanceof PreFlexRWCodec) : "fix your classpath to have tests-framework.jar
before lucene-core.jar";
       PREFLEX_IMPERSONATION_IS_ACTIVE = true;
-    } else if ("SimpleText".equals(TEST_CODEC) || ("random".equals(TEST_CODEC) &&
randomVal == 9 && !shouldAvoidCodec("SimpleText"))) {
+    } else */if ("SimpleText".equals(TEST_CODEC) || ("random".equals(TEST_CODEC) &&
randomVal == 9 && !shouldAvoidCodec("SimpleText"))) {
       codec = new SimpleTextCodec();
     } else if ("Appending".equals(TEST_CODEC) || ("random".equals(TEST_CODEC) &&
randomVal == 8 && !shouldAvoidCodec("Appending"))) {
       codec = new AppendingCodec();

Modified: lucene/dev/trunk/lucene/test-framework/src/resources/META-INF/services/org.apache.lucene.codecs.Codec
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/test-framework/src/resources/META-INF/services/org.apache.lucene.codecs.Codec?rev=1344076&r1=1344075&r2=1344076&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/test-framework/src/resources/META-INF/services/org.apache.lucene.codecs.Codec
(original)
+++ lucene/dev/trunk/lucene/test-framework/src/resources/META-INF/services/org.apache.lucene.codecs.Codec
Wed May 30 02:07:31 2012
@@ -13,4 +13,3 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-org.apache.lucene.codecs.lucene3x.PreFlexRWCodec

Modified: lucene/dev/trunk/solr/contrib/analysis-extras/src/test/org/apache/solr/schema/TestICUCollationField.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/contrib/analysis-extras/src/test/org/apache/solr/schema/TestICUCollationField.java?rev=1344076&r1=1344075&r2=1344076&view=diff
==============================================================================
--- lucene/dev/trunk/solr/contrib/analysis-extras/src/test/org/apache/solr/schema/TestICUCollationField.java
(original)
+++ lucene/dev/trunk/solr/contrib/analysis-extras/src/test/org/apache/solr/schema/TestICUCollationField.java
Wed May 30 02:07:31 2012
@@ -22,7 +22,6 @@ import java.io.FileOutputStream;
 
 import org.apache.commons.io.FileUtils;
 import org.apache.commons.io.IOUtils;
-import org.apache.lucene.util.LuceneTestCase.SuppressCodecs;
 import org.apache.solr.SolrTestCaseJ4;
 import org.junit.BeforeClass;
 
@@ -33,7 +32,6 @@ import com.ibm.icu.util.ULocale;
 /**
  * Tests {@link ICUCollationField} with TermQueries, RangeQueries, and sort order.
  */
-@SuppressCodecs("Lucene3x")
 public class TestICUCollationField extends SolrTestCaseJ4 {
   
   @BeforeClass

Modified: lucene/dev/trunk/solr/contrib/analysis-extras/src/test/org/apache/solr/schema/TestICUCollationFieldOptions.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/contrib/analysis-extras/src/test/org/apache/solr/schema/TestICUCollationFieldOptions.java?rev=1344076&r1=1344075&r2=1344076&view=diff
==============================================================================
--- lucene/dev/trunk/solr/contrib/analysis-extras/src/test/org/apache/solr/schema/TestICUCollationFieldOptions.java
(original)
+++ lucene/dev/trunk/solr/contrib/analysis-extras/src/test/org/apache/solr/schema/TestICUCollationFieldOptions.java
Wed May 30 02:07:31 2012
@@ -17,14 +17,12 @@ package org.apache.solr.schema;
  * limitations under the License.
  */
 
-import org.apache.lucene.util.LuceneTestCase.SuppressCodecs;
 import org.apache.solr.SolrTestCaseJ4;
 import org.junit.BeforeClass;
 
 /**
  * Tests expert options of {@link ICUCollationField}.
  */
-@SuppressCodecs("Lucene3x")
 public class TestICUCollationFieldOptions extends SolrTestCaseJ4 {
   @BeforeClass
   public static void beforeClass() throws Exception {

Modified: lucene/dev/trunk/solr/core/src/test/org/apache/solr/schema/TestCollationField.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/test/org/apache/solr/schema/TestCollationField.java?rev=1344076&r1=1344075&r2=1344076&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/test/org/apache/solr/schema/TestCollationField.java (original)
+++ lucene/dev/trunk/solr/core/src/test/org/apache/solr/schema/TestCollationField.java Wed
May 30 02:07:31 2012
@@ -25,15 +25,12 @@ import java.util.Locale;
 
 import org.apache.commons.io.FileUtils;
 import org.apache.commons.io.IOUtils;
-import org.apache.lucene.codecs.Codec;
-import org.apache.lucene.util.LuceneTestCase.SuppressCodecs;
 import org.apache.solr.SolrTestCaseJ4;
 import org.junit.BeforeClass;
 
 /**
  * Tests {@link CollationField} with TermQueries, RangeQueries, and sort order.
  */
-@SuppressCodecs("Lucene3x")
 public class TestCollationField extends SolrTestCaseJ4 {
   
   @BeforeClass

Modified: lucene/dev/trunk/solr/core/src/test/org/apache/solr/search/function/TestFunctionQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/test/org/apache/solr/search/function/TestFunctionQuery.java?rev=1344076&r1=1344075&r2=1344076&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/test/org/apache/solr/search/function/TestFunctionQuery.java
(original)
+++ lucene/dev/trunk/solr/core/src/test/org/apache/solr/search/function/TestFunctionQuery.java
Wed May 30 02:07:31 2012
@@ -427,10 +427,7 @@ public class TestFunctionQuery extends S
   /**
    * test collection-level term stats (new in 4.x indexes)
    */
-  public void testTotalTermFreq() throws Exception {
-    assumeFalse("PreFlex codec does not support collection-level term stats", 
-        "Lucene3x".equals(Codec.getDefault().getName()));
-    
+  public void testTotalTermFreq() throws Exception {  
     clearIndex();
     
     assertU(adoc("id","1", "a_tdt","2009-08-31T12:10:10.123Z", "b_tdt","2009-08-31T12:10:10.124Z"));



Mime
View raw message