aboutsummaryrefslogtreecommitdiffstats
path: root/src/ooxml/testcases/org/apache/poi/extractor
diff options
context:
space:
mode:
authorDominik Stadler <centic@apache.org>2016-10-20 20:31:50 +0000
committerDominik Stadler <centic@apache.org>2016-10-20 20:31:50 +0000
commit68d0f816e968e2061d08afb9d22cb460502d2a28 (patch)
treead613d324b7ec73ec17e50a10ccbe7722fc8a518 /src/ooxml/testcases/org/apache/poi/extractor
parentd76ef83dc62f185838acf7c3731fb486c8b36b1a (diff)
downloadpoi-68d0f816e968e2061d08afb9d22cb460502d2a28.tar.gz
poi-68d0f816e968e2061d08afb9d22cb460502d2a28.zip
Add some missing close() calls
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1765875 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/ooxml/testcases/org/apache/poi/extractor')
-rw-r--r--src/ooxml/testcases/org/apache/poi/extractor/TestExtractorFactory.java15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/ooxml/testcases/org/apache/poi/extractor/TestExtractorFactory.java b/src/ooxml/testcases/org/apache/poi/extractor/TestExtractorFactory.java
index 26fe68a632..0d7bc5a8a3 100644
--- a/src/ooxml/testcases/org/apache/poi/extractor/TestExtractorFactory.java
+++ b/src/ooxml/testcases/org/apache/poi/extractor/TestExtractorFactory.java
@@ -684,11 +684,11 @@ public class TestExtractorFactory {
// Text
try {
ExtractorFactory.createExtractor(OPCPackage.open(txt.toString()));
- fail("TestExtractorFactory.testPackage() failed on " + txt.toString());
+ fail("TestExtractorFactory.testPackage() failed on " + txt);
} catch(UnsupportedFileFormatException e) {
// Good
} catch (Exception e) {
- System.out.println("TestExtractorFactory.testPackage() failed on " + txt.toString());
+ System.out.println("TestExtractorFactory.testPackage() failed on " + txt);
throw e;
}
}
@@ -1028,9 +1028,12 @@ public class TestExtractorFactory {
@Test(expected=AssertionError.class)
public void test45565() throws Exception {
POITextExtractor extractor = ExtractorFactory.createExtractor(HSSFTestDataSamples.getSampleFile("45565.xls"));
- String text = extractor.getText();
- assertContains(text, "testdoc");
- assertContains(text, "test phrase");
- extractor.close();
+ try {
+ String text = extractor.getText();
+ assertContains(text, "testdoc");
+ assertContains(text, "test phrase");
+ } finally {
+ extractor.close();
+ }
}
}