lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rm...@apache.org
Subject svn commit: r1210489 - in /lucene/dev/branches/lucene3606/modules/facet/src/test/org/apache/lucene/facet: search/TestTotalFacetCountsCache.java taxonomy/directory/TestIndexClose.java util/TestScoredDocIDsUtils.java
Date Mon, 05 Dec 2011 15:05:26 GMT
Author: rmuir
Date: Mon Dec  5 15:05:26 2011
New Revision: 1210489

URL: http://svn.apache.org/viewvc?rev=1210489&view=rev
Log:
LUCENE-3606: fix faceting tests

Modified:
    lucene/dev/branches/lucene3606/modules/facet/src/test/org/apache/lucene/facet/search/TestTotalFacetCountsCache.java
    lucene/dev/branches/lucene3606/modules/facet/src/test/org/apache/lucene/facet/taxonomy/directory/TestIndexClose.java
    lucene/dev/branches/lucene3606/modules/facet/src/test/org/apache/lucene/facet/util/TestScoredDocIDsUtils.java

Modified: lucene/dev/branches/lucene3606/modules/facet/src/test/org/apache/lucene/facet/search/TestTotalFacetCountsCache.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene3606/modules/facet/src/test/org/apache/lucene/facet/search/TestTotalFacetCountsCache.java?rev=1210489&r1=1210488&r2=1210489&view=diff
==============================================================================
--- lucene/dev/branches/lucene3606/modules/facet/src/test/org/apache/lucene/facet/search/TestTotalFacetCountsCache.java
(original)
+++ lucene/dev/branches/lucene3606/modules/facet/src/test/org/apache/lucene/facet/search/TestTotalFacetCountsCache.java
Mon Dec  5 15:05:26 2011
@@ -323,19 +323,6 @@ public class TestTotalFacetCountsCache e
     assertTrue("Should be obtained from cache at 8th attempt",totalCounts == 
       TFC.getTotalCounts(readers[0].indexReader, readers[0].taxReader, iParams, null));
     
-    // delete a doc from the reader and commit - should recompute
-    origReader.close();
-    origReader = readers[0].indexReader;
-    readers[0].indexReader = IndexReader.open(origReader.directory(),false);
-    initCache();
-    totalCounts = TFC.getTotalCounts(readers[0].indexReader, readers[0].taxReader, iParams,
null);
-    prevGen = assertRecomputed(totalCounts, prevGen, "after opening a writable reader - 9th
attempt!");
-    // now do the delete
-    readers[0].indexReader.deleteDocument(1);
-    readers[0].indexReader.commit(null);
-    totalCounts = TFC.getTotalCounts(readers[0].indexReader, readers[0].taxReader, iParams,
null);
-    prevGen = assertRecomputed(totalCounts, prevGen, "after deleting docs the index - 10th
attempt!");
-    
     origReader.close();
     readers[0].close();
     r2.close();

Modified: lucene/dev/branches/lucene3606/modules/facet/src/test/org/apache/lucene/facet/taxonomy/directory/TestIndexClose.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene3606/modules/facet/src/test/org/apache/lucene/facet/taxonomy/directory/TestIndexClose.java?rev=1210489&r1=1210488&r2=1210489&view=diff
==============================================================================
--- lucene/dev/branches/lucene3606/modules/facet/src/test/org/apache/lucene/facet/taxonomy/directory/TestIndexClose.java
(original)
+++ lucene/dev/branches/lucene3606/modules/facet/src/test/org/apache/lucene/facet/taxonomy/directory/TestIndexClose.java
Mon Dec  5 15:05:26 2011
@@ -147,7 +147,7 @@ public class TestIndexClose extends Luce
       }  
       @Override
       protected IndexReader openIndexReader(Directory dir) throws CorruptIndexException,
IOException {
-        return new InstrumentedIndexReader(IndexReader.open(dir,true)); 
+        return new InstrumentedIndexReader(IndexReader.open(dir)); 
       }
 
     }

Modified: lucene/dev/branches/lucene3606/modules/facet/src/test/org/apache/lucene/facet/util/TestScoredDocIDsUtils.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene3606/modules/facet/src/test/org/apache/lucene/facet/util/TestScoredDocIDsUtils.java?rev=1210489&r1=1210488&r2=1210489&view=diff
==============================================================================
--- lucene/dev/branches/lucene3606/modules/facet/src/test/org/apache/lucene/facet/util/TestScoredDocIDsUtils.java
(original)
+++ lucene/dev/branches/lucene3606/modules/facet/src/test/org/apache/lucene/facet/util/TestScoredDocIDsUtils.java
Mon Dec  5 15:05:26 2011
@@ -231,14 +231,11 @@ public class TestScoredDocIDsUtils exten
     for (int docNum = 0; docNum < nDocs; docNum++) {
       writer.addDocument(docFactory.getDoc(docNum));
     }
-    writer.close();
-
     // Delete documents marked for deletion
-    IndexReader reader = IndexReader.open(dir, false);
-    reader.deleteDocuments(new Term(DocumentFactory.field, DocumentFactory.delTxt));
-    reader.close();
+    writer.deleteDocuments(new Term(DocumentFactory.field, DocumentFactory.delTxt));
+    writer.close();
 
     // Open a fresh read-only reader with the deletions in place
-    return IndexReader.open(dir, true);
+    return IndexReader.open(dir);
   }
 }



Mime
View raw message