diff options
author | Josh Micich <josh@apache.org> | 2009-12-26 02:17:34 +0000 |
---|---|---|
committer | Josh Micich <josh@apache.org> | 2009-12-26 02:17:34 +0000 |
commit | feafcb8f48e24a6b1967e4cbf9e50d8f1b3224fd (patch) | |
tree | 9895a650914dded40eefb3f018702376de7301db /src/testcases/org/apache/poi/hssf/usermodel/TestHSSFHyperlink.java | |
parent | 136e09be840acfdf69f77b42725d2c2a6ce1b2f6 (diff) | |
download | poi-feafcb8f48e24a6b1967e4cbf9e50d8f1b3224fd.tar.gz poi-feafcb8f48e24a6b1967e4cbf9e50d8f1b3224fd.zip |
Replaced getInstance methods with field for instances of ITestDataProvider. Some simplification in hierarchy of related tests.
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@893929 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/testcases/org/apache/poi/hssf/usermodel/TestHSSFHyperlink.java')
-rw-r--r-- | src/testcases/org/apache/poi/hssf/usermodel/TestHSSFHyperlink.java | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFHyperlink.java b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFHyperlink.java index f863dd980d..8a5d601369 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFHyperlink.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFHyperlink.java @@ -28,16 +28,15 @@ import org.apache.poi.ss.usermodel.BaseTestHyperlink; */ public final class TestHSSFHyperlink extends BaseTestHyperlink { - @Override - protected HSSFITestDataProvider getTestDataProvider(){ - return HSSFITestDataProvider.getInstance(); + public TestHSSFHyperlink() { + super(HSSFITestDataProvider.instance); } /** * Test that we can read hyperlinks. */ public void testRead() { - HSSFWorkbook wb = getTestDataProvider().openSampleWorkbook("HyperlinksOnManySheets.xls"); + HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("HyperlinksOnManySheets.xls"); HSSFSheet sheet; HSSFCell cell; @@ -77,7 +76,7 @@ public final class TestHSSFHyperlink extends BaseTestHyperlink { } public void testModify() { - HSSFWorkbook wb = getTestDataProvider().openSampleWorkbook("HyperlinksOnManySheets.xls"); + HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("HyperlinksOnManySheets.xls"); HSSFSheet sheet; HSSFCell cell; @@ -89,7 +88,7 @@ public final class TestHSSFHyperlink extends BaseTestHyperlink { //modify the link link.setAddress("www.apache.org"); - wb = getTestDataProvider().writeOutAndReadBack(wb); + wb = HSSFTestDataSamples.writeOutAndReadBack(wb); sheet = wb.getSheet("WebLinks"); cell = sheet.getRow(4).getCell(0); link = cell.getHyperlink(); @@ -106,7 +105,7 @@ public final class TestHSSFHyperlink extends BaseTestHyperlink { * link.setAddress("'Target Sheet-1'!A1"); //common between XSSF and HSSF */ public void testCreateDocumentLink() { - HSSFWorkbook wb = getTestDataProvider().createWorkbook(); + HSSFWorkbook wb = new HSSFWorkbook(); //link to a place in this workbook HSSFHyperlink link; @@ -131,7 +130,7 @@ public final class TestHSSFHyperlink extends BaseTestHyperlink { link.setAddress("'Hyperlinks'!A1"); cell.setHyperlink(link); - wb = getTestDataProvider().writeOutAndReadBack(wb); + wb = HSSFTestDataSamples.writeOutAndReadBack(wb); sheet = wb.getSheet("Hyperlinks"); cell = sheet.getRow(0).getCell(0); @@ -167,7 +166,7 @@ public final class TestHSSFHyperlink extends BaseTestHyperlink { } public void testCreate() { - HSSFWorkbook wb = getTestDataProvider().createWorkbook(); + HSSFWorkbook wb = new HSSFWorkbook(); HSSFHyperlink link; HSSFCell cell; @@ -179,7 +178,7 @@ public final class TestHSSFHyperlink extends BaseTestHyperlink { link.setAddress("testfolder\\test.PDF"); cell.setHyperlink(link); - wb = getTestDataProvider().writeOutAndReadBack(wb); + wb = HSSFTestDataSamples.writeOutAndReadBack(wb); sheet = wb.getSheet("Hyperlinks"); cell = sheet.getRow(1).getCell(0); @@ -193,7 +192,7 @@ public final class TestHSSFHyperlink extends BaseTestHyperlink { * see bugs #46445 and #29957 */ public void testShiftRows(){ - HSSFWorkbook wb = getTestDataProvider().openSampleWorkbook("46445.xls"); + HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("46445.xls"); HSSFSheet sheet = wb.getSheetAt(0); |