From 503024b7c19872818be3d019a384df44b5cf0152 Mon Sep 17 00:00:00 2001 From: Robert Muir Date: Sun, 17 Oct 2010 21:24:44 +0000 Subject: [PATCH] more unclosed resources in this spellcheck test git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1023585 13f79535-47bb-0310-9956-ffa450edef68 --- .../solr/spelling/SpellCheckCollatorTest.java | 24 ++++++++++++++----- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/solr/src/test/org/apache/solr/spelling/SpellCheckCollatorTest.java b/solr/src/test/org/apache/solr/spelling/SpellCheckCollatorTest.java index 6a7c8ac3aa8..77066a0d13c 100644 --- a/solr/src/test/org/apache/solr/spelling/SpellCheckCollatorTest.java +++ b/solr/src/test/org/apache/solr/spelling/SpellCheckCollatorTest.java @@ -107,7 +107,9 @@ public class SpellCheckCollatorTest extends SolrTestCaseJ4 { SolrRequestHandler handler = core.getRequestHandler("spellCheckCompRH"); SolrQueryResponse rsp = new SolrQueryResponse(); rsp.add("responseHeader", new SimpleOrderedMap()); - handler.handleRequest(new LocalSolrQueryRequest(core, params), rsp); + SolrQueryRequest req = new LocalSolrQueryRequest(core, params); + handler.handleRequest(req, rsp); + req.close(); NamedList values = rsp.getValues(); NamedList spellCheck = (NamedList) values.get("spellcheck"); NamedList suggestions = (NamedList) spellCheck.get("suggestions"); @@ -120,7 +122,9 @@ public class SpellCheckCollatorTest extends SolrTestCaseJ4 { handler = core.getRequestHandler("spellCheckCompRH1"); rsp = new SolrQueryResponse(); rsp.add("responseHeader", new SimpleOrderedMap()); - handler.handleRequest(new LocalSolrQueryRequest(core, params), rsp); + req = new LocalSolrQueryRequest(core, params); + handler.handleRequest(req, rsp); + req.close(); values = rsp.getValues(); spellCheck = (NamedList) values.get("spellcheck"); suggestions = (NamedList) spellCheck.get("suggestions"); @@ -150,7 +154,9 @@ public class SpellCheckCollatorTest extends SolrTestCaseJ4 { SolrRequestHandler handler = core.getRequestHandler("spellCheckCompRH"); SolrQueryResponse rsp = new SolrQueryResponse(); rsp.add("responseHeader", new SimpleOrderedMap()); - handler.handleRequest(new LocalSolrQueryRequest(core, params), rsp); + SolrQueryRequest req = new LocalSolrQueryRequest(core, params); + handler.handleRequest(req, rsp); + req.close(); NamedList values = rsp.getValues(); NamedList spellCheck = (NamedList) values.get("spellcheck"); NamedList suggestions = (NamedList) spellCheck.get("suggestions"); @@ -165,7 +171,9 @@ public class SpellCheckCollatorTest extends SolrTestCaseJ4 { handler = core.getRequestHandler("spellCheckCompRH"); rsp = new SolrQueryResponse(); rsp.add("responseHeader", new SimpleOrderedMap()); - handler.handleRequest(new LocalSolrQueryRequest(core, params), rsp); + req = new LocalSolrQueryRequest(core, params); + handler.handleRequest(req, rsp); + req.close(); values = rsp.getValues(); spellCheck = (NamedList) values.get("spellcheck"); suggestions = (NamedList) spellCheck.get("suggestions"); @@ -181,7 +189,9 @@ public class SpellCheckCollatorTest extends SolrTestCaseJ4 { handler = core.getRequestHandler("spellCheckCompRH"); rsp = new SolrQueryResponse(); rsp.add("responseHeader", new SimpleOrderedMap()); - handler.handleRequest(new LocalSolrQueryRequest(core, params), rsp); + req = new LocalSolrQueryRequest(core, params); + handler.handleRequest(req, rsp); + req.close(); values = rsp.getValues(); spellCheck = (NamedList) values.get("spellcheck"); suggestions = (NamedList) spellCheck.get("suggestions"); @@ -198,7 +208,9 @@ public class SpellCheckCollatorTest extends SolrTestCaseJ4 { handler = core.getRequestHandler("spellCheckCompRH"); rsp = new SolrQueryResponse(); rsp.add("responseHeader", new SimpleOrderedMap()); - handler.handleRequest(new LocalSolrQueryRequest(core, params), rsp); + req = new LocalSolrQueryRequest(core, params); + handler.handleRequest(req, rsp); + req.close(); values = rsp.getValues(); spellCheck = (NamedList) values.get("spellcheck"); suggestions = (NamedList) spellCheck.get("suggestions");