tests: fix resource leaks

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1022785 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Yonik Seeley 2010-10-15 00:30:27 +00:00
parent b8de139ebb
commit 25e2a6be37
1 changed files with 5 additions and 10 deletions

View File

@ -50,14 +50,6 @@ public class QueryElevationComponentTest extends SolrTestCaseJ4 {
initCore("solrconfig-elevate.xml","schema12.xml");
}
@Before
@Override
public void setUp() throws Exception {
super.setUp();
clearIndex();
assertU(commit());
}
@Test
public void testInterface() throws Exception
{
@ -70,9 +62,12 @@ public class QueryElevationComponentTest extends SolrTestCaseJ4 {
QueryElevationComponent comp = new QueryElevationComponent();
comp.init( args );
comp.inform( core );
IndexReader reader = core.getSearcher().get().getReader();
SolrQueryRequest req = req();
IndexReader reader = req.getSearcher().getReader();
Map<String, ElevationObj> map = comp.getElevationMap( reader, core );
req.close();
// Make sure the boosts loaded properly
assertEquals( 3, map.size() );
assertEquals( 1, map.get( "XXXX" ).priority.size() );