tests: fix resource leaks

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1022798 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Yonik Seeley 2010-10-15 00:54:15 +00:00
parent 3f1296c9e5
commit dba60ee597
1 changed files with 4 additions and 3 deletions

View File

@ -20,6 +20,7 @@ package org.apache.solr.core;
import org.apache.lucene.index.IndexWriter;
import org.apache.solr.SolrTestCaseJ4;
import org.apache.solr.handler.admin.ShowFileRequestHandler;
import org.apache.solr.request.SolrQueryRequest;
import org.apache.solr.search.SolrIndexReader;
import org.apache.solr.search.SolrIndexSearcher;
import org.apache.solr.update.DirectUpdateHandler2;
@ -140,9 +141,9 @@ public class TestConfig extends SolrTestCaseJ4 {
IndexReaderFactory irf = h.getCore().getIndexReaderFactory();
StandardIndexReaderFactory sirf = (StandardIndexReaderFactory) irf;
assertEquals(12, sirf.termInfosIndexDivisor);
RefCounted<SolrIndexSearcher> refCounted = h.getCore().getSearcher();
SolrIndexReader solrReader = refCounted.get().getReader();
assertEquals(12, solrReader.getTermInfosIndexDivisor());
SolrQueryRequest req = req();
assertEquals(12, req.getSearcher().getReader().getTermInfosIndexDivisor());
req.close();
}