You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by yo...@apache.org on 2010/10/18 01:11:50 UTC

svn commit: r1023594 - /lucene/dev/trunk/solr/src/test/org/apache/solr/servlet/SolrRequestParserTest.java

Author: yonik
Date: Sun Oct 17 23:11:50 2010
New Revision: 1023594

URL: http://svn.apache.org/viewvc?rev=1023594&view=rev
Log:
tests: close requests (doesn't cause an error)

Modified:
    lucene/dev/trunk/solr/src/test/org/apache/solr/servlet/SolrRequestParserTest.java

Modified: lucene/dev/trunk/solr/src/test/org/apache/solr/servlet/SolrRequestParserTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/test/org/apache/solr/servlet/SolrRequestParserTest.java?rev=1023594&r1=1023593&r2=1023594&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/test/org/apache/solr/servlet/SolrRequestParserTest.java (original)
+++ lucene/dev/trunk/solr/src/test/org/apache/solr/servlet/SolrRequestParserTest.java Sun Oct 17 23:11:50 2010
@@ -38,6 +38,7 @@ import org.apache.solr.common.params.Mul
 import org.apache.solr.common.params.SolrParams;
 import org.apache.solr.common.util.ContentStream;
 import org.apache.solr.core.SolrCore;
+import org.apache.solr.request.SolrQueryRequest;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
 import org.junit.Test;
@@ -73,14 +74,15 @@ public class SolrRequestParserTest exten
     
     // Make sure it got a single stream in and out ok
     List<ContentStream> streams = new ArrayList<ContentStream>();
-    parser.buildRequestFrom( core, new MultiMapSolrParams( args ), streams );
+    SolrQueryRequest req = parser.buildRequestFrom( core, new MultiMapSolrParams( args ), streams );
     assertEquals( 1, streams.size() );
     assertEquals( body1, IOUtils.toString( streams.get(0).getStream() ) );
-    
+    req.close();
+
     // Now add three and make sure they come out ok
     streams = new ArrayList<ContentStream>();
     args.put( CommonParams.STREAM_BODY, new String[] {body1,body2,body3} );
-    parser.buildRequestFrom( core, new MultiMapSolrParams( args ), streams );
+    req = parser.buildRequestFrom( core, new MultiMapSolrParams( args ), streams );
     assertEquals( 3, streams.size() );
     ArrayList<String> input  = new ArrayList<String>();
     ArrayList<String> output = new ArrayList<String>();
@@ -94,15 +96,17 @@ public class SolrRequestParserTest exten
     Collections.sort( input );
     Collections.sort( output );
     assertEquals( input.toString(), output.toString() );
-    
+    req.close();
+
     // set the contentType and make sure tat gets set
     String ctype = "text/xxx";
     streams = new ArrayList<ContentStream>();
     args.put( CommonParams.STREAM_CONTENTTYPE, new String[] {ctype} );
-    parser.buildRequestFrom( core, new MultiMapSolrParams( args ), streams );
+    req = parser.buildRequestFrom( core, new MultiMapSolrParams( args ), streams );
     for( ContentStream s : streams ) {
       assertEquals( ctype, s.getContentType() );
     }
+    req.close();
   }
   
   @Test
@@ -130,9 +134,10 @@ public class SolrRequestParserTest exten
     
     // Make sure it got a single stream in and out ok
     List<ContentStream> streams = new ArrayList<ContentStream>();
-    parser.buildRequestFrom( core, new MultiMapSolrParams( args ), streams );
+    SolrQueryRequest req = parser.buildRequestFrom( core, new MultiMapSolrParams( args ), streams );
     assertEquals( 1, streams.size() );
     assertEquals( txt, IOUtils.toString( streams.get(0).getStream() ) );
+    req.close();
   }
   
   @Test