SOLR-5914: Fix missing close on Reader

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1582549 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Uwe Schindler 2014-03-27 23:49:03 +00:00
parent e01f41cc16
commit 61c6ee3ce8
1 changed files with 3 additions and 1 deletions

View File

@ -58,12 +58,14 @@ public class ContentStreamTest extends SolrTestCaseJ4
FileInputStream fis = new FileInputStream(file);
InputStreamReader isr = new InputStreamReader(
new FileInputStream(file), "UTF-8");
Reader r = stream.getReader();
try {
assertEquals(file.length(), stream.getSize().intValue());
assertTrue(IOUtils.contentEquals(fis, s));
assertTrue(IOUtils.contentEquals(isr, stream.getReader()));
assertTrue(IOUtils.contentEquals(isr, r));
} finally {
s.close();
r.close();
isr.close();
fis.close();
}