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/TestBug42464.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/TestBug42464.java')
-rw-r--r-- | src/testcases/org/apache/poi/hssf/usermodel/TestBug42464.java | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestBug42464.java b/src/testcases/org/apache/poi/hssf/usermodel/TestBug42464.java index c849fd4369..7cab590913 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestBug42464.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestBug42464.java @@ -14,42 +14,35 @@ See the License for the specific language governing permissions and limitations under the License. ==================================================================== */ + package org.apache.poi.hssf.usermodel; -import java.io.File; -import java.io.FileInputStream; import java.util.Iterator; import java.util.List; import junit.framework.TestCase; +import org.apache.poi.hssf.HSSFTestDataSamples; import org.apache.poi.hssf.record.FormulaRecord; import org.apache.poi.hssf.record.aggregates.FormulaRecordAggregate; import org.apache.poi.hssf.usermodel.HSSFFormulaEvaluator.CellValue; import org.apache.poi.hssf.util.CellReference; +/** + * + */ public final class TestBug42464 extends TestCase { - String dirname; - - protected void setUp() throws Exception { - super.setUp(); - dirname = System.getProperty("HSSF.testdata.path"); - } public void testOKFile() throws Exception { - HSSFWorkbook wb = new HSSFWorkbook( - new FileInputStream(new File(dirname,"42464-ExpPtg-ok.xls")) - ); + HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("42464-ExpPtg-ok.xls"); process(wb); } public void testExpSharedBadFile() throws Exception { - HSSFWorkbook wb = new HSSFWorkbook( - new FileInputStream(new File(dirname,"42464-ExpPtg-bad.xls")) - ); + HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("42464-ExpPtg-bad.xls"); process(wb); } - protected void process(HSSFWorkbook wb) { + private static void process(HSSFWorkbook wb) { for(int i=0; i<wb.getNumberOfSheets(); i++) { HSSFSheet s = wb.getSheetAt(i); HSSFFormulaEvaluator eval = @@ -64,7 +57,7 @@ public final class TestBug42464 extends TestCase { } } - protected void process(HSSFRow row, HSSFFormulaEvaluator eval) { + private static void process(HSSFRow row, HSSFFormulaEvaluator eval) { Iterator it = row.cellIterator(); while(it.hasNext()) { HSSFCell cell = (HSSFCell)it.next(); |