mirror of https://github.com/apache/lucene.git
tests: fix resource leak
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1022788 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
25e2a6be37
commit
90d0cfa613
|
@ -355,13 +355,16 @@ public class ExtractingRequestHandlerTest extends SolrTestCaseJ4 {
|
|||
|
||||
SolrQueryResponse loadLocal(String filename, String... args) throws Exception {
|
||||
LocalSolrQueryRequest req = (LocalSolrQueryRequest) req(args);
|
||||
|
||||
// TODO: stop using locally defined streams once stream.file and
|
||||
// stream.body work everywhere
|
||||
List<ContentStream> cs = new ArrayList<ContentStream>();
|
||||
cs.add(new ContentStreamBase.FileStream(new File(filename)));
|
||||
req.setContentStreams(cs);
|
||||
return h.queryAndResponse("/update/extract", req);
|
||||
try {
|
||||
// TODO: stop using locally defined streams once stream.file and
|
||||
// stream.body work everywhere
|
||||
List<ContentStream> cs = new ArrayList<ContentStream>();
|
||||
cs.add(new ContentStreamBase.FileStream(new File(filename)));
|
||||
req.setContentStreams(cs);
|
||||
return h.queryAndResponse("/update/extract", req);
|
||||
} finally {
|
||||
req.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue