lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yo...@apache.org
Subject svn commit: r1666831 - in /lucene/dev/branches/branch_5x: ./ solr/ solr/core/ solr/core/src/test/org/apache/solr/handler/MoreLikeThisHandlerTest.java
Date Sun, 15 Mar 2015 19:41:18 GMT
Author: yonik
Date: Sun Mar 15 19:41:17 2015
New Revision: 1666831

URL: http://svn.apache.org/r1666831
Log:
tests: fix request reuse and request close bugs

Modified:
    lucene/dev/branches/branch_5x/   (props changed)
    lucene/dev/branches/branch_5x/solr/   (props changed)
    lucene/dev/branches/branch_5x/solr/core/   (props changed)
    lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/handler/MoreLikeThisHandlerTest.java

Modified: lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/handler/MoreLikeThisHandlerTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/handler/MoreLikeThisHandlerTest.java?rev=1666831&r1=1666830&r2=1666831&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/handler/MoreLikeThisHandlerTest.java
(original)
+++ lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/handler/MoreLikeThisHandlerTest.java
Sun Mar 15 19:41:17 2015
@@ -91,11 +91,13 @@ public class MoreLikeThisHandlerTest ext
         ,"//result/doc[2]/int[@name='id'][.='43']");
     
     params.set(CommonParams.Q, "id:44");
+    mltreq.close(); mltreq = new LocalSolrQueryRequest(h.getCore(), params);
     assertQ("morelike this - harrison ford",mltreq
         ,"//result/doc[1]/int[@name='id'][.='45']");
 
     // test MoreLikeThis debug
     params.set(CommonParams.DEBUG_QUERY, "true");
+    mltreq.close(); mltreq = new LocalSolrQueryRequest(h.getCore(), params);
     assertQ("morelike this - harrison ford",mltreq
         ,"//lst[@name='debug']/lst[@name='moreLikeThis']/lst[@name='44']/str[@name='rawMLTQuery']"
         ,"//lst[@name='debug']/lst[@name='moreLikeThis']/lst[@name='44']/str[@name='boostedMLTQuery']"
@@ -106,11 +108,13 @@ public class MoreLikeThisHandlerTest ext
     // test that qparser plugins work
     params.remove(CommonParams.DEBUG_QUERY);
     params.set(CommonParams.Q, "{!field f=id}44");
+    mltreq.close(); mltreq = new LocalSolrQueryRequest(h.getCore(), params);
     assertQ(mltreq
         ,"//result/doc[1]/int[@name='id'][.='45']");
 
     params.set(CommonParams.Q, "id:42");
     params.set(MoreLikeThisParams.QF,"name^5.0 subword^0.1");
+    mltreq.close(); mltreq = new LocalSolrQueryRequest(h.getCore(), params);
     assertQ("morelikethis with weights",mltreq
         ,"//result/doc[1]/int[@name='id'][.='43']"
         ,"//result/doc[2]/int[@name='id'][.='46']");
@@ -119,12 +123,14 @@ public class MoreLikeThisHandlerTest ext
     // test that qparser plugins work w/ the MoreLikeThisHandler
     params.set(CommonParams.QT, "/mlt");
     params.set(CommonParams.Q, "{!field f=id}44");
+    mltreq.close(); mltreq = new LocalSolrQueryRequest(h.getCore(), params);
     assertQ(mltreq
         ,"//result/doc[1]/int[@name='id'][.='45']");
 
     // test that debugging works (test for MoreLikeThis*Handler*)
     params.set(CommonParams.QT, "/mlt");
     params.set(CommonParams.DEBUG_QUERY, "true");
+    mltreq.close(); mltreq = new LocalSolrQueryRequest(h.getCore(), params);
     assertQ(mltreq
         ,"//result/doc[1]/int[@name='id'][.='45']"
         ,"//lst[@name='debug']/lst[@name='explain']"
@@ -134,5 +140,6 @@ public class MoreLikeThisHandlerTest ext
     // String response = h.query(mltreq);
     // System.out.println(response);
 
+    mltreq.close();
   }
 }



Mime
View raw message