diff options
author | Josh Micich <josh@apache.org> | 2008-04-07 03:02:03 +0000 |
---|---|---|
committer | Josh Micich <josh@apache.org> | 2008-04-07 03:02:03 +0000 |
commit | bf756d96784b527c3cb77d455d9f0c322311d091 (patch) | |
tree | 08b9b03e4820164076827a8cbd0de2aca09275bf /src/testcases/org/apache/poi/hssf/usermodel/TestHSSFHyperlink.java | |
parent | b938b6c97f47f085757b330d1bce90293c863afb (diff) | |
download | poi-bf756d96784b527c3cb77d455d9f0c322311d091.tar.gz poi-bf756d96784b527c3cb77d455d9f0c322311d091.zip |
refactored all hssf junits to get test sample data in the in one place
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@645348 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/testcases/org/apache/poi/hssf/usermodel/TestHSSFHyperlink.java')
-rwxr-xr-x | src/testcases/org/apache/poi/hssf/usermodel/TestHSSFHyperlink.java | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFHyperlink.java b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFHyperlink.java index b87899c343..15ec903b4d 100755 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFHyperlink.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFHyperlink.java @@ -14,28 +14,28 @@ See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
+
package org.apache.poi.hssf.usermodel;
import junit.framework.TestCase;
import java.io.*;
+import org.apache.poi.hssf.HSSFTestDataSamples;
+
/**
* Tests HSSFHyperlink.
*
* @author Yegor Kozlov
*/
-public class TestHSSFHyperlink extends TestCase {
- protected String cwd = System.getProperty("HSSF.testdata.path");
+public final class TestHSSFHyperlink extends TestCase {
/**
* Test that we can read hyperlinks.
*/
- public void testRead() throws Exception {
+ public void testRead() {
- FileInputStream is = new FileInputStream(new File(cwd, "HyperlinksOnManySheets.xls"));
- HSSFWorkbook wb = new HSSFWorkbook(is);
- is.close();
+ HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("HyperlinksOnManySheets.xls");
HSSFSheet sheet;
HSSFCell cell;
@@ -74,9 +74,7 @@ public class TestHSSFHyperlink extends TestCase { }
public void testModify() throws Exception {
- FileInputStream is = new FileInputStream(new File(cwd, "HyperlinksOnManySheets.xls"));
- HSSFWorkbook wb = new HSSFWorkbook(is);
- is.close();
+ HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("HyperlinksOnManySheets.xls");
HSSFSheet sheet;
HSSFCell cell;
@@ -168,10 +166,8 @@ public class TestHSSFHyperlink extends TestCase { assertEquals("'Target Sheet'!A1", link.getAddress());
}
- public void testCloneSheet() throws Exception {
- FileInputStream is = new FileInputStream(new File(cwd, "HyperlinksOnManySheets.xls"));
- HSSFWorkbook wb = new HSSFWorkbook(is);
- is.close();
+ public void testCloneSheet() {
+ HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("HyperlinksOnManySheets.xls");
HSSFCell cell;
HSSFHyperlink link;
|