]> source.dussan.org Git - poi.git/commitdiff
Move test for bug 57236 as it seems to be fixed since some time
authorDominik Stadler <centic@apache.org>
Sat, 2 Jan 2016 21:11:41 +0000 (21:11 +0000)
committerDominik Stadler <centic@apache.org>
Sat, 2 Jan 2016 21:11:41 +0000 (21:11 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1722666 13f79535-47bb-0310-9956-ffa450edef68

src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestUnfixedBugs.java
src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java

index 9b6b20e71bd038df3fbaa576b748547e7ae6317f..0297cf5f8bc6094fca59af7d886901497448a446 100644 (file)
@@ -29,6 +29,8 @@ import java.io.FileOutputStream;
 import java.io.IOException;\r
 import java.io.OutputStream;\r
 import java.nio.charset.Charset;\r
+import java.text.DecimalFormat;\r
+import java.text.DecimalFormatSymbols;\r
 import java.util.Calendar;\r
 import java.util.Date;\r
 import java.util.Iterator;\r
@@ -177,36 +179,6 @@ public final class TestUnfixedBugs {
         assertEquals(DateUtil.getJavaDate(value1, false), DateUtil.getJavaDate(value2, false));\r
     }\r
 \r
-    @Test\r
-    public void test57236() throws Exception {\r
-        // Having very small numbers leads to different formatting, Excel uses the scientific notation, but POI leads to "0"\r
-        \r
-        /*\r
-        DecimalFormat format = new DecimalFormat("#.##########", new DecimalFormatSymbols(Locale.getDefault()));\r
-        double d = 3.0E-104;\r
-        assertEquals("3.0E-104", format.format(d));\r
-         */\r
-        \r
-        DataFormatter formatter = new DataFormatter(true);\r
-\r
-        XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("57236.xlsx");\r
-        for(int sheetNum = 0;sheetNum < wb.getNumberOfSheets();sheetNum++) {\r
-            Sheet sheet = wb.getSheetAt(sheetNum);\r
-            for(int rowNum = sheet.getFirstRowNum();rowNum < sheet.getLastRowNum();rowNum++) {\r
-                Row row = sheet.getRow(rowNum);\r
-                for(int cellNum = row.getFirstCellNum();cellNum < row.getLastCellNum();cellNum++) {\r
-                    Cell cell = row.getCell(cellNum);\r
-                    String fmtCellValue = formatter.formatCellValue(cell);\r
-                    \r
-                    System.out.println("Cell: " + fmtCellValue);\r
-                    assertNotNull(fmtCellValue);\r
-                    assertFalse(fmtCellValue.equals("0"));\r
-                }\r
-            }\r
-        }\r
-        wb.close();\r
-    }\r
-\r
     // When this is fixed, the test case should go to BaseTestXCell with \r
     // adjustments to use _testDataProvider to also verify this for XSSF\r
     @Test\r
index d150abaf9040ad2adbc636b9f7b38449e52ec56b..56eff44578346b4e21be1ed6a2201e531e8903ee 100644 (file)
@@ -2875,4 +2875,35 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
         assertEquals(1, wb.getNumberOfSheets());
         assertEquals("Sheet1", wb.getSheetName(0));
     }
+
+    @Test
+    public void test57236() throws Exception {
+        // Having very small numbers leads to different formatting, Excel uses the scientific notation, but POI leads to "0"
+        
+        /*
+        DecimalFormat format = new DecimalFormat("#.##########", new DecimalFormatSymbols(Locale.getDefault()));
+        double d = 3.0E-104;
+        assertEquals("3.0E-104", format.format(d));
+         */
+        
+        DataFormatter formatter = new DataFormatter(true);
+
+        XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("57236.xlsx");
+        for(int sheetNum = 0;sheetNum < wb.getNumberOfSheets();sheetNum++) {
+            Sheet sheet = wb.getSheetAt(sheetNum);
+            for(int rowNum = sheet.getFirstRowNum();rowNum < sheet.getLastRowNum();rowNum++) {
+                Row row = sheet.getRow(rowNum);
+                for(int cellNum = row.getFirstCellNum();cellNum < row.getLastCellNum();cellNum++) {
+                    Cell cell = row.getCell(cellNum);
+                    String fmtCellValue = formatter.formatCellValue(cell);
+                    
+                    System.out.println("Cell: " + fmtCellValue);
+                    assertNotNull(fmtCellValue);
+                    assertFalse(fmtCellValue.equals("0"));
+                }
+            }
+        }
+        
+        wb.close();
+    }
 }