From 235597025298db8927b368f48b6d474e371bd869 Mon Sep 17 00:00:00 2001 From: Javen O'Neal Date: Wed, 8 Feb 2017 07:04:55 +0000 Subject: [PATCH] +svn:eol-style native git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1782109 13f79535-47bb-0310-9956-ffa450edef68 --- .../usermodel/TestXSSFSheetShiftRows.java | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheetShiftRows.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheetShiftRows.java index 84a2dfdbca..42773aa6fb 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheetShiftRows.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheetShiftRows.java @@ -415,40 +415,40 @@ public final class TestXSSFSheetShiftRows extends BaseTestSheetShiftRows { workbook.close(); - } - - private static String getCellFormula(Sheet sheet, String address) { - CellAddress cellAddress = new CellAddress(address); - Row row = sheet.getRow(cellAddress.getRow()); - assertNotNull(row); - Cell cell = row.getCell(cellAddress.getColumn()); - assertNotNull(cell); - assertEquals(CellType.FORMULA, cell.getCellTypeEnum()); - return cell.getCellFormula(); - } + } + + private static String getCellFormula(Sheet sheet, String address) { + CellAddress cellAddress = new CellAddress(address); + Row row = sheet.getRow(cellAddress.getRow()); + assertNotNull(row); + Cell cell = row.getCell(cellAddress.getColumn()); + assertNotNull(cell); + assertEquals(CellType.FORMULA, cell.getCellTypeEnum()); + return cell.getCellFormula(); + } // This test is written as expected-to-fail and should be rewritten // as expected-to-pass when the bug is fixed. - @Test - public void testSharedFormulas() throws Exception { - XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("TestShiftRowSharedFormula.xlsx"); - XSSFSheet sheet = wb.getSheetAt(0); - assertEquals("SUM(C2:C4)", getCellFormula(sheet, "C5")); - assertEquals("SUM(D2:D4)", getCellFormula(sheet, "D5")); - assertEquals("SUM(E2:E4)", getCellFormula(sheet, "E5")); - + @Test + public void testSharedFormulas() throws Exception { + XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("TestShiftRowSharedFormula.xlsx"); + XSSFSheet sheet = wb.getSheetAt(0); + assertEquals("SUM(C2:C4)", getCellFormula(sheet, "C5")); + assertEquals("SUM(D2:D4)", getCellFormula(sheet, "D5")); + assertEquals("SUM(E2:E4)", getCellFormula(sheet, "E5")); + sheet.shiftRows(3, sheet.getLastRowNum(), 1); - // FIXME: remove try, catch, and testPassesNow, skipTest when test passes - try { - assertEquals("SUM(C2:C5)", getCellFormula(sheet, "C6")); - assertEquals("SUM(D2:D5)", getCellFormula(sheet, "D6")); + // FIXME: remove try, catch, and testPassesNow, skipTest when test passes + try { + assertEquals("SUM(C2:C5)", getCellFormula(sheet, "C6")); + assertEquals("SUM(D2:D5)", getCellFormula(sheet, "D6")); assertEquals("SUM(E2:E5)", getCellFormula(sheet, "E6")); testPassesNow(59983); } catch (AssertionError e) { skipTest(e); } - wb.close(); + wb.close(); } // bug 60260: shift rows or rename a sheet containing a named range