lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dna...@apache.org
Subject svn commit: r505038 - /lucene/java/trunk/src/test/org/apache/lucene/search/TestMultiSearcher.java
Date Thu, 08 Feb 2007 21:12:49 GMT
Author: dnaber
Date: Thu Feb  8 13:12:49 2007
New Revision: 505038

URL: http://svn.apache.org/viewvc?view=rev&rev=505038
Log:
there was no test case for subSearcher() -> adding at least a simple one

Modified:
    lucene/java/trunk/src/test/org/apache/lucene/search/TestMultiSearcher.java

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestMultiSearcher.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestMultiSearcher.java?view=diff&rev=505038&r1=505037&r2=505038
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestMultiSearcher.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestMultiSearcher.java Thu Feb  8
13:12:49 2007
@@ -138,7 +138,7 @@
         searchers2[0] = new IndexSearcher(indexStoreB);
         searchers2[1] = new IndexSearcher(indexStoreA);
         // creating the mulitSearcher
-        Searcher mSearcher2 = getMultiSearcherInstance(searchers2);
+        MultiSearcher mSearcher2 = getMultiSearcherInstance(searchers2);
         // performing the same search
         Hits hits2 = mSearcher2.search(query);
 
@@ -150,6 +150,17 @@
             Document d = hits2.doc(i);
         }
         mSearcher2.close();
+
+        // test the subSearcher() method:
+        Query subSearcherQuery = parser.parse("id:doc1");
+        hits2 = mSearcher2.search(subSearcherQuery);
+        assertEquals(2, hits2.length());
+        assertEquals(0, mSearcher2.subSearcher(hits2.id(0)));   // hit from searchers2[0]
+        assertEquals(1, mSearcher2.subSearcher(hits2.id(1)));   // hit from searchers2[1]
+        subSearcherQuery = parser.parse("id:doc2");
+        hits2 = mSearcher2.search(subSearcherQuery);
+        assertEquals(1, hits2.length());
+        assertEquals(1, mSearcher2.subSearcher(hits2.id(0)));   // hit from searchers2[1]
 
         //--------------------------------------------------------------------
         // scenario 3



Mime
View raw message