diff options
author | Dominik Stadler <centic@apache.org> | 2013-11-28 20:56:20 +0000 |
---|---|---|
committer | Dominik Stadler <centic@apache.org> | 2013-11-28 20:56:20 +0000 |
commit | 4a9ee4f6f700a25284c0fad788bff0e9f8782e86 (patch) | |
tree | a2543e2ee7dd35e1987540a903520afe4d9163fd | |
parent | 861ed3b5ef2e385a101cffaa199d762bb985afb7 (diff) | |
download | poi-REL_3_9.tar.gz poi-REL_3_9.zip |
Revert inadvertent commit back to the original REL_3_9 stateREL_3_9
git-svn-id: https://svn.apache.org/repos/asf/poi/tags/REL_3_9@1546456 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheet.java | 69 |
1 files changed, 23 insertions, 46 deletions
diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheet.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheet.java index 4210323bce..e47632acf9 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheet.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheet.java @@ -19,20 +19,16 @@ package org.apache.poi.xssf.usermodel; import java.util.List; -import org.apache.poi.hssf.record.PasswordRecord; -import org.apache.poi.ss.usermodel.BaseTestSheet; -import org.apache.poi.ss.usermodel.Cell; -import org.apache.poi.ss.usermodel.CreationHelper; -import org.apache.poi.ss.usermodel.RichTextString; -import org.apache.poi.ss.usermodel.Workbook; +import org.apache.poi.ss.usermodel.*; import org.apache.poi.ss.util.CellRangeAddress; -import org.apache.poi.util.HexDump; import org.apache.poi.xssf.XSSFITestDataProvider; import org.apache.poi.xssf.XSSFTestDataSamples; -import org.apache.poi.xssf.model.CalculationChain; import org.apache.poi.xssf.model.CommentsTable; import org.apache.poi.xssf.model.StylesTable; +import org.apache.poi.xssf.model.CalculationChain; import org.apache.poi.xssf.usermodel.helpers.ColumnHelper; +import org.apache.poi.util.HexDump; +import org.apache.poi.hssf.record.PasswordRecord; import org.openxmlformats.schemas.spreadsheetml.x2006.main.*; @@ -44,8 +40,7 @@ public final class TestXSSFSheet extends BaseTestSheet { } //TODO column styles are not yet supported by XSSF - @Override - public void testDefaultColumnStyle() { + public void testDefaultColumnStyle() { //super.testDefaultColumnStyle(); } @@ -908,7 +903,7 @@ public final class TestXSSFSheet extends BaseTestSheet { * Rows and cells can be created in random order, * but CTRows are kept in ascending order */ - public void testCreateRowXSSF() { + public void testCreateRow() { XSSFWorkbook workbook = new XSSFWorkbook(); XSSFSheet sheet = workbook.createSheet(); CTWorksheet wsh = sheet.getCTWorksheet(); @@ -1036,7 +1031,7 @@ public final class TestXSSFSheet extends BaseTestSheet { assertEquals("XSSFSheet#removeRow did not clear calcChain entries", 0, calcChain.getCTCalcChain().sizeOfCArray()); - //calcChain should be gone + //calcChain should be gone wb = XSSFTestDataSamples.writeOutAndReadBack(wb); assertNull(wb.getCalculationChain()); @@ -1048,37 +1043,37 @@ public final class TestXSSFSheet extends BaseTestSheet { public void testTables() { XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("WithTable.xlsx"); assertEquals(3, wb.getNumberOfSheets()); - + // Check the table sheet XSSFSheet s1 = wb.getSheetAt(0); assertEquals("a", s1.getRow(0).getCell(0).getRichStringCellValue().toString()); assertEquals(1.0, s1.getRow(1).getCell(0).getNumericCellValue()); - + List<XSSFTable> tables = s1.getTables(); assertNotNull(tables); assertEquals(1, tables.size()); - + XSSFTable table = tables.get(0); assertEquals("Tabella1", table.getName()); assertEquals("Tabella1", table.getDisplayName()); - + // And the others XSSFSheet s2 = wb.getSheetAt(1); assertEquals(0, s2.getTables().size()); XSSFSheet s3 = wb.getSheetAt(2); assertEquals(0, s3.getTables().size()); } - + /** * Test to trigger OOXML-LITE generating to include org.openxmlformats.schemas.spreadsheetml.x2006.main.CTSheetCalcPr */ public void testSetForceFormulaRecalculation() { - XSSFWorkbook workbook = new XSSFWorkbook(); - XSSFSheet sheet = workbook.createSheet("Sheet 1"); + XSSFWorkbook workbook = new XSSFWorkbook(); + XSSFSheet sheet = workbook.createSheet("Sheet 1"); - // Set - sheet.setForceFormulaRecalculation(true); - assertEquals(true, sheet.getForceFormulaRecalculation()); + // Set + sheet.setForceFormulaRecalculation(true); + assertEquals(true, sheet.getForceFormulaRecalculation()); // calcMode="manual" is unset when forceFormulaRecalculation=true CTCalcPr calcPr = workbook.getCTWorkbook().addNewCalcPr(); @@ -1087,31 +1082,13 @@ public final class TestXSSFSheet extends BaseTestSheet { assertEquals(STCalcMode.AUTO, calcPr.getCalcMode()); // Check - sheet.setForceFormulaRecalculation(false); - assertEquals(false, sheet.getForceFormulaRecalculation()); + sheet.setForceFormulaRecalculation(false); + assertEquals(false, sheet.getForceFormulaRecalculation()); - // Save, re-load, and re-check - workbook = XSSFTestDataSamples.writeOutAndReadBack(workbook); - sheet = workbook.getSheet("Sheet 1"); - assertEquals(false, sheet.getForceFormulaRecalculation()); + // Save, re-load, and re-check + workbook = XSSFTestDataSamples.writeOutAndReadBack(workbook); + sheet = workbook.getSheet("Sheet 1"); + assertEquals(false, sheet.getForceFormulaRecalculation()); } - - public static void test55745() throws Exception { - XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("55745.xlsx"); - XSSFSheet sheet = wb.getSheetAt(0); - List<XSSFTable> tables = sheet.getTables(); - /*System.out.println(tables.size()); - - for(XSSFTable table : tables) { - System.out.println("XPath: " + table.getCommonXpath()); - System.out.println("Name: " + table.getName()); - System.out.println("Mapped Cols: " + table.getNumerOfMappedColumns()); - System.out.println("Rowcount: " + table.getRowCount()); - System.out.println("End Cell: " + table.getEndCellReference()); - System.out.println("Start Cell: " + table.getStartCellReference()); - }*/ - assertEquals("Sheet should contain 8 tables", 8, tables.size()); - assertNotNull("Sheet should contain a comments table", sheet.getCommentsTable(false)); - } } |