Set the searcherHolder to null on close. See:

http://www.nabble.com/AlreadyClosedException-in-JUnit-tests--tf4893565.html

git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@599458 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Ryan McKinley 2007-11-29 14:36:49 +00:00
parent 46b26e7b21
commit 5122ececbb
2 changed files with 4 additions and 0 deletions

View File

@ -193,6 +193,7 @@ public abstract class SolrQueryRequestBase implements SolrQueryRequest {
public void close() {
if (searcherHolder!=null) {
searcherHolder.decref();
searcherHolder = null;
}
}

View File

@ -76,6 +76,9 @@ public class StandardRequestHandlerTest extends AbstractSolrTestCase {
// Make sure score parsing works
args.put( CommonParams.SORT, "score desc" );
assertQ("with sort param [desc]", req,"//*[@numFound='3']" );
args.put( CommonParams.SORT, "score asc" );
assertQ("with sort param [desc]", req,"//*[@numFound='3']" );
// Using legacy ';' param
args.remove( CommonParams.SORT );