]> source.dussan.org Git - poi.git/commitdiff
Hopefully fixed scratchpad test org.apache.poi.hssf/record/formula/functions/TestEver...
authorJason Height <jheight@apache.org>
Mon, 28 Aug 2006 00:31:36 +0000 (00:31 +0000)
committerJason Height <jheight@apache.org>
Mon, 28 Aug 2006 00:31:36 +0000 (00:31 +0000)
git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@437486 13f79535-47bb-0310-9956-ffa450edef68

src/scratchpad/testcases/org/apache/poi/hssf/record/formula/eval/GenericFormulaTestCase.java
src/scratchpad/testcases/org/apache/poi/hssf/record/formula/eval/TestEverything.java
src/scratchpad/testcases/org/apache/poi/hssf/record/formula/functions/TestEverything.java

index 11d947ea8785b425aade643364c8aa2f62341571..95a67bc67bdc3dac9f11d723894873292c120998 100644 (file)
@@ -23,9 +23,9 @@ import org.apache.poi.hssf.util.CellReference;
  */
 public class GenericFormulaTestCase extends TestCase {
 
-    protected final String FILENAME = System.getProperty("HSSF.testdata.path")+ "/FormulaEvalTestData.xls";
+    protected final static String FILENAME = System.getProperty("HSSF.testdata.path")+ "/FormulaEvalTestData.xls";
 
-    protected HSSFWorkbook workbook = null;
+    protected static HSSFWorkbook workbook = null;
 
     protected CellReference beginCell;
     protected int getBeginRow() {
@@ -36,7 +36,7 @@ public class GenericFormulaTestCase extends TestCase {
         return beginCell.getCol();
     }
 
-    protected static final HSSFCell getExpectedValueCell(HSSFSheet sheet, HSSFRow row, HSSFCell cell) {
+    protected final HSSFCell getExpectedValueCell(HSSFSheet sheet, HSSFRow row, HSSFCell cell) {
         HSSFCell retval = null;
         if (sheet != null) {
             row = sheet.getRow(row.getRowNum()+1);
@@ -89,15 +89,17 @@ public class GenericFormulaTestCase extends TestCase {
         }
     }
 
-    public GenericFormulaTestCase(String beginCell) {
-        super("genericTest");      
+    public GenericFormulaTestCase(String beginCell) throws Exception {
+        super("genericTest");
+        if (workbook == null) {
+          FileInputStream fin = new FileInputStream( FILENAME );
+          workbook = new HSSFWorkbook( fin );
+          fin.close();        
+        }
         this.beginCell = new CellReference(beginCell);
     }
     
-    public void setUp() throws Exception {
-        FileInputStream fin = new FileInputStream( FILENAME );
-        workbook = new HSSFWorkbook( fin );
-        fin.close();           
+    public void setUp() {
     }
     
     public void genericTest() throws Exception {
index f7db5d48f8ac7b1fbc6655c76505a95958c64fcb..d3c9a314f223c42a53caf852926594947b2b603d 100644 (file)
@@ -12,7 +12,7 @@ import junit.framework.TestSuite;
  */
 public class TestEverything extends TestSuite {
 
-    public static TestSuite suite() {
+    public static TestSuite suite() throws Exception {
         TestSuite suite = new TestSuite("Tests for OperationEval concrete implementation classes.");
         suite.addTest(new GenericFormulaTestCase("D23"));
         suite.addTest(new GenericFormulaTestCase("D27"));
index 85f51af6002aa19694afeecce929281eaf9c9ec1..7e873d764efc242761d721440c1b913a30e44cb4 100644 (file)
@@ -14,7 +14,7 @@ import junit.framework.TestSuite;
  */
 public class TestEverything extends TestSuite {
 
-    public static TestSuite suite() {
+    public static TestSuite suite() throws Exception {
         TestSuite suite = new TestSuite("Tests for individual function classes");
         String s;
         for(int i=80; i<1481;i=i+4) {