Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Revert inadvertent commit back to the original REL_3_9 state

git-svn-id: https://svn.apache.org/repos/asf/poi/tags/REL_3_9@1546456 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
commit f8f3eaa86f92f958a8f30ab1ae5bf3033ae47533 1 parent 54e55c2
authored November 28, 2013
69  src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheet.java
@@ -19,20 +19,16 @@ Licensed to the Apache Software Foundation (ASF) under one or more
19 19
 
20 20
 import java.util.List;
21 21
 
22  
-import org.apache.poi.hssf.record.PasswordRecord;
23  
-import org.apache.poi.ss.usermodel.BaseTestSheet;
24  
-import org.apache.poi.ss.usermodel.Cell;
25  
-import org.apache.poi.ss.usermodel.CreationHelper;
26  
-import org.apache.poi.ss.usermodel.RichTextString;
27  
-import org.apache.poi.ss.usermodel.Workbook;
  22
+import org.apache.poi.ss.usermodel.*;
28 23
 import org.apache.poi.ss.util.CellRangeAddress;
29  
-import org.apache.poi.util.HexDump;
30 24
 import org.apache.poi.xssf.XSSFITestDataProvider;
31 25
 import org.apache.poi.xssf.XSSFTestDataSamples;
32  
-import org.apache.poi.xssf.model.CalculationChain;
33 26
 import org.apache.poi.xssf.model.CommentsTable;
34 27
 import org.apache.poi.xssf.model.StylesTable;
  28
+import org.apache.poi.xssf.model.CalculationChain;
35 29
 import org.apache.poi.xssf.usermodel.helpers.ColumnHelper;
  30
+import org.apache.poi.util.HexDump;
  31
+import org.apache.poi.hssf.record.PasswordRecord;
36 32
 import org.openxmlformats.schemas.spreadsheetml.x2006.main.*;
37 33
 
38 34
 
@@ -44,8 +40,7 @@ public TestXSSFSheet() {
44 40
     }
45 41
 
46 42
     //TODO column styles are not yet supported by XSSF
47  
-    @Override
48  
-	public void testDefaultColumnStyle() {
  43
+    public void testDefaultColumnStyle() {
49 44
         //super.testDefaultColumnStyle();
50 45
     }
51 46
 
@@ -908,7 +903,7 @@ public void testCommentsTable() {
908 903
      * Rows and cells can be created in random order,
909 904
      * but CTRows are kept in ascending order
910 905
      */
911  
-	public void testCreateRowXSSF() {
  906
+    public void testCreateRow() {
912 907
         XSSFWorkbook workbook = new XSSFWorkbook();
913 908
         XSSFSheet sheet = workbook.createSheet();
914 909
         CTWorksheet wsh = sheet.getCTWorksheet();
@@ -1036,7 +1031,7 @@ public void test49966() {
1036 1031
         assertEquals("XSSFSheet#removeRow did not clear calcChain entries",
1037 1032
                 0, calcChain.getCTCalcChain().sizeOfCArray());
1038 1033
 
1039  
-        //calcChain should be gone
  1034
+        //calcChain should be gone 
1040 1035
         wb = XSSFTestDataSamples.writeOutAndReadBack(wb);
1041 1036
         assertNull(wb.getCalculationChain());
1042 1037
 
@@ -1048,37 +1043,37 @@ public void test49966() {
1048 1043
     public void testTables() {
1049 1044
        XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("WithTable.xlsx");
1050 1045
        assertEquals(3, wb.getNumberOfSheets());
1051  
-
  1046
+       
1052 1047
        // Check the table sheet
1053 1048
        XSSFSheet s1 = wb.getSheetAt(0);
1054 1049
        assertEquals("a", s1.getRow(0).getCell(0).getRichStringCellValue().toString());
1055 1050
        assertEquals(1.0, s1.getRow(1).getCell(0).getNumericCellValue());
1056  
-
  1051
+       
1057 1052
        List<XSSFTable> tables = s1.getTables();
1058 1053
        assertNotNull(tables);
1059 1054
        assertEquals(1, tables.size());
1060  
-
  1055
+       
1061 1056
        XSSFTable table = tables.get(0);
1062 1057
        assertEquals("Tabella1", table.getName());
1063 1058
        assertEquals("Tabella1", table.getDisplayName());
1064  
-
  1059
+       
1065 1060
        // And the others
1066 1061
        XSSFSheet s2 = wb.getSheetAt(1);
1067 1062
        assertEquals(0, s2.getTables().size());
1068 1063
        XSSFSheet s3 = wb.getSheetAt(2);
1069 1064
        assertEquals(0, s3.getTables().size());
1070 1065
     }
1071  
-
  1066
+    
1072 1067
     /**
1073 1068
      * Test to trigger OOXML-LITE generating to include org.openxmlformats.schemas.spreadsheetml.x2006.main.CTSheetCalcPr
1074 1069
      */
1075 1070
     public void testSetForceFormulaRecalculation() {
1076  
-        XSSFWorkbook workbook = new XSSFWorkbook();
1077  
-        XSSFSheet sheet = workbook.createSheet("Sheet 1");
  1071
+    	   XSSFWorkbook workbook = new XSSFWorkbook();
  1072
+         XSSFSheet sheet = workbook.createSheet("Sheet 1");
1078 1073
 
1079  
-        // Set
1080  
-        sheet.setForceFormulaRecalculation(true);
1081  
-        assertEquals(true, sheet.getForceFormulaRecalculation());
  1074
+         // Set
  1075
+         sheet.setForceFormulaRecalculation(true);
  1076
+         assertEquals(true, sheet.getForceFormulaRecalculation());
1082 1077
 
1083 1078
         // calcMode="manual" is unset when forceFormulaRecalculation=true
1084 1079
         CTCalcPr calcPr = workbook.getCTWorkbook().addNewCalcPr();
@@ -1087,31 +1082,13 @@ public void testSetForceFormulaRecalculation() {
1087 1082
         assertEquals(STCalcMode.AUTO, calcPr.getCalcMode());
1088 1083
 
1089 1084
         // Check
1090  
-        sheet.setForceFormulaRecalculation(false);
1091  
-        assertEquals(false, sheet.getForceFormulaRecalculation());
  1085
+         sheet.setForceFormulaRecalculation(false);
  1086
+         assertEquals(false, sheet.getForceFormulaRecalculation());
1092 1087
 
1093 1088
 
1094  
-        // Save, re-load, and re-check
1095  
-        workbook = XSSFTestDataSamples.writeOutAndReadBack(workbook);
1096  
-        sheet = workbook.getSheet("Sheet 1");
1097  
-        assertEquals(false, sheet.getForceFormulaRecalculation());
  1089
+         // Save, re-load, and re-check
  1090
+         workbook = XSSFTestDataSamples.writeOutAndReadBack(workbook);
  1091
+         sheet = workbook.getSheet("Sheet 1");
  1092
+         assertEquals(false, sheet.getForceFormulaRecalculation());
1098 1093
 	}
1099  
-
1100  
-    public static void test55745() throws Exception {
1101  
-        XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("55745.xlsx");
1102  
-        XSSFSheet sheet = wb.getSheetAt(0);
1103  
-        List<XSSFTable> tables = sheet.getTables();
1104  
-        /*System.out.println(tables.size());
1105  
-        
1106  
-        for(XSSFTable table : tables) {
1107  
-            System.out.println("XPath: " + table.getCommonXpath());
1108  
-            System.out.println("Name: " + table.getName());
1109  
-            System.out.println("Mapped Cols: " + table.getNumerOfMappedColumns());
1110  
-            System.out.println("Rowcount: " + table.getRowCount());
1111  
-            System.out.println("End Cell: " + table.getEndCellReference());
1112  
-            System.out.println("Start Cell: " + table.getStartCellReference());
1113  
-        }*/
1114  
-        assertEquals("Sheet should contain 8 tables", 8, tables.size());
1115  
-        assertNotNull("Sheet should contain a comments table", sheet.getCommentsTable(false));
1116  
-    }
1117 1094
 }

0 notes on commit f8f3eaa

Please sign in to comment.
Something went wrong with that request. Please try again.