tests: fix test typo that lead to resource leak

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1024338 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Yonik Seeley 2010-10-19 17:52:17 +00:00
parent 3f79aec196
commit 230ac9fb88
1 changed files with 8 additions and 6 deletions

View File

@ -16,20 +16,22 @@
*/
package org.apache.solr.search;
import org.apache.solr.util.AbstractSolrTestCase;
import org.apache.solr.SolrTestCaseJ4;
import org.apache.solr.request.SolrQueryRequest;
import org.apache.solr.schema.SchemaField;
import org.apache.solr.search.function.ValueSource;
import org.apache.solr.search.function.DocValues;
import org.junit.BeforeClass;
import java.util.Map;
import java.io.IOException;
public class TestIndexSearcher extends AbstractSolrTestCase {
public class TestIndexSearcher extends SolrTestCaseJ4 {
public String getSchemaFile() { return "schema11.xml"; }
public String getSolrConfigFile() { return "solrconfig.xml"; }
public String getCoreName() { return "basic"; }
@BeforeClass
public static void beforeClass() throws Exception {
initCore("solrconfig.xml","schema.xml");
}
private String getStringVal(SolrQueryRequest sqr, String field, int doc) throws IOException {
SchemaField sf = sqr.getSchema().getField(field);
@ -109,7 +111,7 @@ public class TestIndexSearcher extends AbstractSolrTestCase {
assertU(delI("1"));
assertU(commit());
SolrQueryRequest sr6 = req("q","foo");
SolrIndexReader r6 = sr4.getSearcher().getReader();
SolrIndexReader r6 = sr6.getSearcher().getReader();
assertEquals(1, r6.getLeafReaders()[0].numDocs()); // only a single doc left in the first segment
assertTrue( !r5.getLeafReaders()[0].equals(r6.getLeafReaders()[0]) ); // readers now different