poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n...@apache.org
Subject svn commit: r1242807 - in /poi/trunk: src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java test-data/spreadsheet/48703.xls test-data/spreadsheet/48703.xlsx
Date Fri, 10 Feb 2012 15:03:03 GMT
Author: nick
Date: Fri Feb 10 15:03:03 2012
New Revision: 1242807

URL: http://svn.apache.org/viewvc?rev=1242807&view=rev
Log:
Disabled unit tests for bug #48703

Added:
    poi/trunk/test-data/spreadsheet/48703.xls   (with props)
    poi/trunk/test-data/spreadsheet/48703.xlsx   (with props)
Modified:
    poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java
    poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java

Modified: poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java?rev=1242807&r1=1242806&r2=1242807&view=diff
==============================================================================
--- poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java (original)
+++ poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java Fri Feb
10 15:03:03 2012
@@ -1255,4 +1255,34 @@ public final class TestXSSFBugs extends 
        assertEquals(1, ref.getLastCell().getRow());
        assertEquals(0, ref.getLastCell().getCol());
     }
+    
+    /**
+     * Sum across multiple workbooks
+     *  eg =SUM($Sheet1.C1:$Sheet4.C1)
+     * DISABLED As we can't currently evaluate these
+     */
+    public void DISABLEDtest48703() throws Exception {
+       XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("48703.xlsx");
+       XSSFSheet sheet = wb.getSheetAt(0);
+       
+       // Contains two forms, one with a range and one a list
+       XSSFRow r1 = sheet.getRow(0);
+       XSSFRow r2 = sheet.getRow(1);
+       XSSFCell c1 = r1.getCell(1);
+       XSSFCell c2 = r2.getCell(1);
+       
+       assertEquals(20.0, c1.getNumericCellValue());
+       assertEquals("SUM(Sheet1!C1,Sheet2!C1,Sheet3!C1,Sheet4!C1)", c1.getCellFormula());
+       
+       assertEquals(20.0, c2.getNumericCellValue());
+       assertEquals("SUM(Sheet1:Sheet4!C1)", c2.getCellFormula());
+       
+       // Try evaluating both
+       XSSFFormulaEvaluator eval = new XSSFFormulaEvaluator(wb);
+       eval.evaluateFormulaCell(c1);
+       eval.evaluateFormulaCell(c2);
+       
+       assertEquals(20.0, c1.getNumericCellValue());
+       assertEquals(20.0, c2.getNumericCellValue());
+    }
 }

Modified: poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java?rev=1242807&r1=1242806&r2=1242807&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java Fri Feb 10 15:03:03
2012
@@ -2180,6 +2180,29 @@ if(1==2) {
         HSSFWorkbook wb = openSample("51670.xls");
         writeOutAndReadBack(wb);
     }
+    
+    /**
+     * Sum across multiple workbooks
+     *  eg =SUM($Sheet2.A1:$Sheet3.A1)
+     * DISABLED - We currently get the formula wrong, and mis-evaluate
+     */
+    public void DISABLEDtest48703() {
+        HSSFWorkbook wb = openSample("48703.xls");
+        assertEquals(3, wb.getNumberOfSheets());
+        
+        // Check reading the formula
+        Sheet sheet = wb.getSheetAt(0);
+        Row r = sheet.getRow(0);
+        Cell c = r.getCell(0);
+        
+        assertEquals("SUM(Sheet2!A1:Sheet3!A1)", c.getCellFormula());
+        assertEquals(4.0, c.getNumericCellValue());
+        
+        // Check the evaluated result
+        HSSFFormulaEvaluator eval = new HSSFFormulaEvaluator(wb);
+        eval.evaluateFormulaCell(c);
+        assertEquals(4.0, c.getNumericCellValue());
+    }
 
     /**
      * Normally encrypted files have BOF then FILEPASS, but

Added: poi/trunk/test-data/spreadsheet/48703.xls
URL: http://svn.apache.org/viewvc/poi/trunk/test-data/spreadsheet/48703.xls?rev=1242807&view=auto
==============================================================================
Binary file - no diff available.

Propchange: poi/trunk/test-data/spreadsheet/48703.xls
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: poi/trunk/test-data/spreadsheet/48703.xlsx
URL: http://svn.apache.org/viewvc/poi/trunk/test-data/spreadsheet/48703.xlsx?rev=1242807&view=auto
==============================================================================
Binary file - no diff available.

Propchange: poi/trunk/test-data/spreadsheet/48703.xlsx
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org


Mime
View raw message