aboutsummaryrefslogtreecommitdiffstats
path: root/src/testcases
diff options
context:
space:
mode:
authorDominik Stadler <centic@apache.org>2015-10-05 06:41:48 +0000
committerDominik Stadler <centic@apache.org>2015-10-05 06:41:48 +0000
commitea73cb013eceb50c5e858861a81717910daef24e (patch)
tree52e333cf03690dd8721870d0982baad9b9becd51 /src/testcases
parent461375359cb24e15591f414a6c05b63729268a7b (diff)
downloadpoi-ea73cb013eceb50c5e858861a81717910daef24e.tar.gz
poi-ea73cb013eceb50c5e858861a81717910daef24e.zip
Eclipse warnings
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1706750 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/testcases')
-rw-r--r--src/testcases/org/apache/poi/hssf/usermodel/TestHSSFHyperlink.java26
1 files changed, 19 insertions, 7 deletions
diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFHyperlink.java b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFHyperlink.java
index be7b0b9845..ad90fd8a77 100644
--- a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFHyperlink.java
+++ b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFHyperlink.java
@@ -17,8 +17,10 @@
package org.apache.poi.hssf.usermodel;
-import org.apache.poi.hssf.HSSFTestDataSamples;
+import java.io.IOException;
+
import org.apache.poi.hssf.HSSFITestDataProvider;
+import org.apache.poi.hssf.HSSFTestDataSamples;
import org.apache.poi.ss.usermodel.BaseTestHyperlink;
/**
@@ -107,8 +109,9 @@ public final class TestHSSFHyperlink extends BaseTestHyperlink {
* link.setTextMark("'Target Sheet-1'!A1"); //HSSF-specific
* or
* link.setAddress("'Target Sheet-1'!A1"); //common between XSSF and HSSF
+ * @throws IOException
*/
- public void testCreateDocumentLink() {
+ public void testCreateDocumentLink() throws IOException {
HSSFWorkbook wb = new HSSFWorkbook();
//link to a place in this workbook
@@ -134,8 +137,10 @@ public final class TestHSSFHyperlink extends BaseTestHyperlink {
link.setAddress("'Hyperlinks'!A1");
cell.setHyperlink(link);
- wb = HSSFTestDataSamples.writeOutAndReadBack(wb);
- sheet = wb.getSheet("Hyperlinks");
+ HSSFWorkbook wbBack = HSSFTestDataSamples.writeOutAndReadBack(wb);
+ wb.close();
+
+ sheet = wbBack.getSheet("Hyperlinks");
cell = sheet.getRow(0).getCell(0);
link = cell.getHyperlink();
@@ -148,6 +153,8 @@ public final class TestHSSFHyperlink extends BaseTestHyperlink {
assertNotNull(link);
assertEquals("'Hyperlinks'!A1", link.getTextMark());
assertEquals("'Hyperlinks'!A1", link.getAddress());
+
+ wbBack.close();
}
public void testCloneSheet() {
@@ -169,7 +176,7 @@ public final class TestHSSFHyperlink extends BaseTestHyperlink {
assertEquals("http://poi.apache.org/hssf/", link.getAddress());
}
- public void testCreate() {
+ public void testCreate() throws IOException {
HSSFWorkbook wb = new HSSFWorkbook();
HSSFHyperlink link;
@@ -182,13 +189,18 @@ public final class TestHSSFHyperlink extends BaseTestHyperlink {
link.setAddress("testfolder\\test.PDF");
cell.setHyperlink(link);
- wb = HSSFTestDataSamples.writeOutAndReadBack(wb);
- sheet = wb.getSheet("Hyperlinks");
+ HSSFWorkbook wbBack = HSSFTestDataSamples.writeOutAndReadBack(wb);
+
+ wb.close();
+
+ sheet = wbBack.getSheet("Hyperlinks");
cell = sheet.getRow(1).getCell(0);
link = cell.getHyperlink();
assertNotNull(link);
assertEquals("testfolder\\test.PDF", link.getAddress());
+
+ wbBack.close();
}
/**