poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n...@apache.org
Subject svn commit: r636790 - /poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java
Date Thu, 13 Mar 2008 15:58:46 GMT
Author: nick
Date: Thu Mar 13 08:58:34 2008
New Revision: 636790

URL: http://svn.apache.org/viewvc?rev=636790&view=rev
Log:
Add test to show that bug #28031 is really closed

Modified:
    poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java

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=636790&r1=636789&r2=636790&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 Thu Mar 13 08:58:34
2008
@@ -508,6 +508,30 @@
         }
         assertTrue("No Exceptions till here!", true);
     }
+
+	public void test28031() {
+        HSSFWorkbook wb = new HSSFWorkbook();
+        HSSFSheet sheet = wb.createSheet();
+        wb.setSheetName(0, "Sheet1");
+
+        HSSFRow row = sheet.createRow(0);
+        HSSFCell cell = row.createCell((short)0);
+        String formulaText =
+			"IF(ROUND(A2*B2*C2,2)>ROUND(B2*D2,2),ROUND(A2*B2*C2,2),ROUND(B2*D2,2))";
+        cell.setCellFormula(formulaText);
+
+        assertEquals(formulaText, cell.getCellFormula());
+        if(false) {
+            // this file can be inspected manually
+            try {
+                OutputStream os = new FileOutputStream("/tmp/output28031.xls");
+                wb.write(os);
+                os.close();
+            } catch (IOException e) {
+                throw new RuntimeException(e);
+            }
+        }
+    }
 	
 	public void test33082() throws java.io.IOException {
 	       String filename = System.getProperty("HSSF.testdata.path");



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


Mime
View raw message