poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kiwiwi...@apache.org
Subject svn commit: r1885280 [2/2] - in /poi/trunk: src/multimodule/poi/test9/ src/ooxml/testcases/org/apache/poi/ss/tests/usermodel/ src/ooxml/testcases/org/apache/poi/xssf/streaming/ src/ooxml/testcases/org/apache/poi/xssf/usermodel/ src/testcases/org/apache...
Date Fri, 08 Jan 2021 22:56:05 GMT
Modified: poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestFont.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestFont.java?rev=1885280&r1=1885279&r2=1885280&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestFont.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestFont.java Fri Jan  8 22:56:05
2021
@@ -29,6 +29,8 @@ import java.io.IOException;
 
 import org.apache.poi.ss.ITestDataProvider;
 import org.junit.jupiter.api.Test;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.MethodSource;
 
 /**
  * @author Yegor Kozlov
@@ -41,113 +43,116 @@ public abstract class BaseTestFont {
         _testDataProvider = testDataProvider;
     }
 
+    @SuppressWarnings("JUnit5MalformedParameterized")
+    @ParameterizedTest
+    @MethodSource("defaultFont")
     protected final void baseTestDefaultFont(String defaultName, short defaultSize, short
defaultColor) throws IOException {
         //get default font and check against default value
-        Workbook workbook = _testDataProvider.createWorkbook();
-        Font fontFind=workbook.findFont(false, defaultColor, defaultSize, defaultName, false,
false, Font.SS_NONE, Font.U_NONE);
-        assertNotNull(fontFind);
-
-        //get default font, then change 2 values and check against different values (height
changes)
-        Font font=workbook.createFont();
-        font.setBold(true);
-        assertTrue(font.getBold());
-        font.setUnderline(Font.U_DOUBLE);
-        assertEquals(Font.U_DOUBLE, font.getUnderline());
-        font.setFontHeightInPoints((short)15);
-        assertEquals(15*20, font.getFontHeight());
-        assertEquals(15, font.getFontHeightInPoints());
-        fontFind=workbook.findFont(true, defaultColor, (short)(15*20), defaultName, false,
false, Font.SS_NONE, Font.U_DOUBLE);
-        assertNotNull(fontFind);
-        workbook.close();
+        try (Workbook workbook = _testDataProvider.createWorkbook()) {
+            Font fontFind = workbook.findFont(false, defaultColor, defaultSize, defaultName,
false, false, Font.SS_NONE, Font.U_NONE);
+            assertNotNull(fontFind);
+
+            //get default font, then change 2 values and check against different values (height
changes)
+            Font font = workbook.createFont();
+            font.setBold(true);
+            assertTrue(font.getBold());
+            font.setUnderline(Font.U_DOUBLE);
+            assertEquals(Font.U_DOUBLE, font.getUnderline());
+            font.setFontHeightInPoints((short) 15);
+            assertEquals(15 * 20, font.getFontHeight());
+            assertEquals(15, font.getFontHeightInPoints());
+            fontFind = workbook.findFont(true, defaultColor, (short) (15 * 20), defaultName,
false, false, Font.SS_NONE, Font.U_DOUBLE);
+            assertNotNull(fontFind);
+        }
     }
 
     @Test
     public final void testGetNumberOfFonts() throws IOException {
-        Workbook wb = _testDataProvider.createWorkbook();
-        int num0 = wb.getNumberOfFonts();
+        try (Workbook wb = _testDataProvider.createWorkbook()) {
+            int num0 = wb.getNumberOfFonts();
 
-        Font f1=wb.createFont();
-        f1.setBold(true);
-        int idx1 = f1.getIndex();
-        wb.createCellStyle().setFont(f1);
-
-        Font f2=wb.createFont();
-        f2.setUnderline(Font.U_DOUBLE);
-        int idx2 = f2.getIndex();
-        wb.createCellStyle().setFont(f2);
-
-        Font f3=wb.createFont();
-        f3.setFontHeightInPoints((short)23);
-        int idx3 = f3.getIndex();
-        wb.createCellStyle().setFont(f3);
-
-        assertEquals(num0 + 3,wb.getNumberOfFonts());
-        assertTrue(wb.getFontAt(idx1).getBold());
-        assertEquals(Font.U_DOUBLE,wb.getFontAt(idx2).getUnderline());
-        assertEquals(23,wb.getFontAt(idx3).getFontHeightInPoints());
-        wb.close();
-	}
+            Font f1 = wb.createFont();
+            f1.setBold(true);
+            int idx1 = f1.getIndex();
+            wb.createCellStyle().setFont(f1);
+
+            Font f2 = wb.createFont();
+            f2.setUnderline(Font.U_DOUBLE);
+            int idx2 = f2.getIndex();
+            wb.createCellStyle().setFont(f2);
+
+            Font f3 = wb.createFont();
+            f3.setFontHeightInPoints((short) 23);
+            int idx3 = f3.getIndex();
+            wb.createCellStyle().setFont(f3);
+
+            assertEquals(num0 + 3, wb.getNumberOfFonts());
+            assertTrue(wb.getFontAt(idx1).getBold());
+            assertEquals(Font.U_DOUBLE, wb.getFontAt(idx2).getUnderline());
+            assertEquals(23, wb.getFontAt(idx3).getFontHeightInPoints());
+        }
+    }
 
     /**
      * Tests that we can define fonts to a new
-     *  file, save, load, and still see them
+     * file, save, load, and still see them
      */
     @Test
     public final void testCreateSave() throws IOException {
-        Workbook wb1 = _testDataProvider.createWorkbook();
-        Sheet s1 = wb1.createSheet();
-        Row r1 = s1.createRow(0);
-        Cell r1c1 = r1.createCell(0);
-        r1c1.setCellValue(2.2);
-
-        int num0 = wb1.getNumberOfFonts();
-
-        Font font=wb1.createFont();
-        font.setBold(true);
-        font.setStrikeout(true);
-        font.setColor(IndexedColors.YELLOW.getIndex());
-        font.setFontName("Courier");
-        int font1Idx = font.getIndex();
-        wb1.createCellStyle().setFont(font);
-        assertEquals(num0 + 1, wb1.getNumberOfFonts());
-
-        CellStyle cellStyleTitle=wb1.createCellStyle();
-        cellStyleTitle.setFont(font);
-        r1c1.setCellStyle(cellStyleTitle);
-
-        // Save and re-load
-        Workbook wb2 = _testDataProvider.writeOutAndReadBack(wb1);
-        wb1.close();
-        s1 = wb2.getSheetAt(0);
-
-        assertEquals(num0 + 1, wb2.getNumberOfFonts());
-        int idx = s1.getRow(0).getCell(0).getCellStyle().getFontIndex();
-        Font fnt = wb2.getFontAt(idx);
-        assertNotNull(fnt);
-        assertEquals(IndexedColors.YELLOW.getIndex(), fnt.getColor());
-        assertEquals("Courier", fnt.getFontName());
-
-        // Now add an orphaned one
-        Font font2 = wb2.createFont();
-        font2.setItalic(true);
-        font2.setFontHeightInPoints((short)15);
-        int font2Idx = font2.getIndex();
-        wb2.createCellStyle().setFont(font2);
-        assertEquals(num0 + 2, wb2.getNumberOfFonts());
-
-        // Save and re-load
-        Workbook wb3 = _testDataProvider.writeOutAndReadBack(wb2);
-        wb2.close();
-        s1 = wb3.getSheetAt(0);
-        assertNotNull(s1);
-
-        assertEquals(num0 + 2, wb3.getNumberOfFonts());
-        assertNotNull(wb3.getFontAt(font1Idx));
-        assertNotNull(wb3.getFontAt(font2Idx));
-
-        assertEquals(15, wb3.getFontAt(font2Idx).getFontHeightInPoints());
-        assertTrue(wb3.getFontAt(font2Idx).getItalic());
-        wb3.close();
+        try (Workbook wb1 = _testDataProvider.createWorkbook()) {
+            Sheet s1 = wb1.createSheet();
+            Row r1 = s1.createRow(0);
+            Cell r1c1 = r1.createCell(0);
+            r1c1.setCellValue(2.2);
+
+            int num0 = wb1.getNumberOfFonts();
+
+            Font font = wb1.createFont();
+            font.setBold(true);
+            font.setStrikeout(true);
+            font.setColor(IndexedColors.YELLOW.getIndex());
+            font.setFontName("Courier");
+            int font1Idx = font.getIndex();
+            wb1.createCellStyle().setFont(font);
+            assertEquals(num0 + 1, wb1.getNumberOfFonts());
+
+            CellStyle cellStyleTitle = wb1.createCellStyle();
+            cellStyleTitle.setFont(font);
+            r1c1.setCellStyle(cellStyleTitle);
+
+            // Save and re-load
+            try (Workbook wb2 = _testDataProvider.writeOutAndReadBack(wb1)) {
+                s1 = wb2.getSheetAt(0);
+
+                assertEquals(num0 + 1, wb2.getNumberOfFonts());
+                int idx = s1.getRow(0).getCell(0).getCellStyle().getFontIndex();
+                Font fnt = wb2.getFontAt(idx);
+                assertNotNull(fnt);
+                assertEquals(IndexedColors.YELLOW.getIndex(), fnt.getColor());
+                assertEquals("Courier", fnt.getFontName());
+
+                // Now add an orphaned one
+                Font font2 = wb2.createFont();
+                font2.setItalic(true);
+                font2.setFontHeightInPoints((short) 15);
+                int font2Idx = font2.getIndex();
+                wb2.createCellStyle().setFont(font2);
+                assertEquals(num0 + 2, wb2.getNumberOfFonts());
+
+                // Save and re-load
+                try (Workbook wb3 = _testDataProvider.writeOutAndReadBack(wb2)) {
+                    s1 = wb3.getSheetAt(0);
+                    assertNotNull(s1);
+
+                    assertEquals(num0 + 2, wb3.getNumberOfFonts());
+                    assertNotNull(wb3.getFontAt(font1Idx));
+                    assertNotNull(wb3.getFontAt(font2Idx));
+
+                    assertEquals(15, wb3.getFontAt(font2Idx).getFontHeightInPoints());
+                    assertTrue(wb3.getFontAt(font2Idx).getItalic());
+                }
+            }
+        }
     }
 
     /**
@@ -155,67 +160,67 @@ public abstract class BaseTestFont {
      */
     @Test
     public final void test45338() throws IOException {
-        Workbook wb = _testDataProvider.createWorkbook();
-        int num0 = wb.getNumberOfFonts();
+        try (Workbook wb = _testDataProvider.createWorkbook()) {
+            int num0 = wb.getNumberOfFonts();
 
-        Sheet s = wb.createSheet();
-        s.createRow(0);
-        s.createRow(1);
-        s.getRow(0).createCell(0);
-        s.getRow(1).createCell(0);
-
-        //default font
-        Font f1 = wb.getFontAt(0);
-        assertFalse(f1.getBold());
-
-        // Check that asking for the same font
-        //  multiple times gives you the same thing.
-        // Otherwise, our tests wouldn't work!
-        assertSame(wb.getFontAt(0), wb.getFontAt(0));
-
-        // Look for a new font we have
-        //  yet to add
-        assertNull(
-            wb.findFont(
-                true, (short)123, (short)(22*20),
-                "Thingy", false, true, (short)2, (byte)2
-            )
-        );
-
-        Font nf = wb.createFont();
-        int nfIdx = nf.getIndex();
-        assertEquals(num0 + 1, wb.getNumberOfFonts());
-
-        assertSame(nf, wb.getFontAt(nfIdx));
-
-        nf.setBold(true);
-        nf.setColor((short)123);
-        nf.setFontHeightInPoints((short)22);
-        nf.setFontName("Thingy");
-        nf.setItalic(false);
-        nf.setStrikeout(true);
-        nf.setTypeOffset((short)2);
-        nf.setUnderline((byte)2);
-
-        assertEquals(num0 + 1, wb.getNumberOfFonts());
-        assertEquals(nf, wb.getFontAt(nfIdx));
-
-        assertEquals(wb.getFontAt(nfIdx), wb.getFontAt(nfIdx));
-        assertNotSame(wb.getFontAt(0), wb.getFontAt(nfIdx));
-
-        // Find it now
-        assertNotNull(
-            wb.findFont(
-                true, (short)123, (short)(22*20),
-                "Thingy", false, true, (short)2, (byte)2
-            )
-        );
-        assertSame(nf,
-               wb.findFont(
-                   true, (short)123, (short)(22*20),
-                   "Thingy", false, true, (short)2, (byte)2
-               )
-        );
-        wb.close();
+            Sheet s = wb.createSheet();
+            s.createRow(0);
+            s.createRow(1);
+            s.getRow(0).createCell(0);
+            s.getRow(1).createCell(0);
+
+            //default font
+            Font f1 = wb.getFontAt(0);
+            assertFalse(f1.getBold());
+
+            // Check that asking for the same font
+            //  multiple times gives you the same thing.
+            // Otherwise, our tests wouldn't work!
+            assertSame(wb.getFontAt(0), wb.getFontAt(0));
+
+            // Look for a new font we have
+            //  yet to add
+            assertNull(
+                wb.findFont(
+                    true, (short) 123, (short) (22 * 20),
+                    "Thingy", false, true, (short) 2, (byte) 2
+                )
+            );
+
+            Font nf = wb.createFont();
+            int nfIdx = nf.getIndex();
+            assertEquals(num0 + 1, wb.getNumberOfFonts());
+
+            assertSame(nf, wb.getFontAt(nfIdx));
+
+            nf.setBold(true);
+            nf.setColor((short) 123);
+            nf.setFontHeightInPoints((short) 22);
+            nf.setFontName("Thingy");
+            nf.setItalic(false);
+            nf.setStrikeout(true);
+            nf.setTypeOffset((short) 2);
+            nf.setUnderline((byte) 2);
+
+            assertEquals(num0 + 1, wb.getNumberOfFonts());
+            assertEquals(nf, wb.getFontAt(nfIdx));
+
+            assertEquals(wb.getFontAt(nfIdx), wb.getFontAt(nfIdx));
+            assertNotSame(wb.getFontAt(0), wb.getFontAt(nfIdx));
+
+            // Find it now
+            assertNotNull(
+                wb.findFont(
+                    true, (short) 123, (short) (22 * 20),
+                    "Thingy", false, true, (short) 2, (byte) 2
+                )
+            );
+            assertSame(nf,
+                wb.findFont(
+                    true, (short) 123, (short) (22 * 20),
+                    "Thingy", false, true, (short) 2, (byte) 2
+                )
+            );
+        }
     }
 }

Modified: poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestFormulaEvaluator.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestFormulaEvaluator.java?rev=1885280&r1=1885279&r2=1885280&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestFormulaEvaluator.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestFormulaEvaluator.java Fri
Jan  8 22:56:05 2021
@@ -116,31 +116,32 @@ public abstract class BaseTestFormulaEva
         wb.close();
     }
 
-	public void baseTestSharedFormulas(String sampleFile) throws IOException {
-        Workbook wb = _testDataProvider.openSampleWorkbook(sampleFile);
-
-        Sheet sheet = wb.getSheetAt(0);
-
-        FormulaEvaluator evaluator = wb.getCreationHelper().createFormulaEvaluator();
-        Cell cell;
-
-        cell = sheet.getRow(1).getCell(0);
-        assertEquals("B2", cell.getCellFormula());
-        assertEquals("ProductionOrderConfirmation", evaluator.evaluate(cell).getStringValue());
-
-        cell = sheet.getRow(2).getCell(0);
-        assertEquals("B3", cell.getCellFormula());
-        assertEquals("RequiredAcceptanceDate", evaluator.evaluate(cell).getStringValue());
-
-        cell = sheet.getRow(3).getCell(0);
-        assertEquals("B4", cell.getCellFormula());
-        assertEquals("Header", evaluator.evaluate(cell).getStringValue());
-
-        cell = sheet.getRow(4).getCell(0);
-        assertEquals("B5", cell.getCellFormula());
-        assertEquals("UniqueDocumentNumberID", evaluator.evaluate(cell).getStringValue());
-
-        wb.close();
+    @Test
+	public void testSharedFormulas() throws IOException {
+        String fileName = "shared_formulas.xls" + (getClass().getName().contains("xssf")
? "x" : "");
+        try (Workbook wb = _testDataProvider.openSampleWorkbook(fileName)) {
+
+            Sheet sheet = wb.getSheetAt(0);
+
+            FormulaEvaluator evaluator = wb.getCreationHelper().createFormulaEvaluator();
+            Cell cell;
+
+            cell = sheet.getRow(1).getCell(0);
+            assertEquals("B2", cell.getCellFormula());
+            assertEquals("ProductionOrderConfirmation", evaluator.evaluate(cell).getStringValue());
+
+            cell = sheet.getRow(2).getCell(0);
+            assertEquals("B3", cell.getCellFormula());
+            assertEquals("RequiredAcceptanceDate", evaluator.evaluate(cell).getStringValue());
+
+            cell = sheet.getRow(3).getCell(0);
+            assertEquals("B4", cell.getCellFormula());
+            assertEquals("Header", evaluator.evaluate(cell).getStringValue());
+
+            cell = sheet.getRow(4).getCell(0);
+            assertEquals("B5", cell.getCellFormula());
+            assertEquals("UniqueDocumentNumberID", evaluator.evaluate(cell).getStringValue());
+        }
     }
 
     /**

Modified: poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestPicture.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestPicture.java?rev=1885280&r1=1885279&r2=1885280&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestPicture.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestPicture.java Fri Jan  8 22:56:05
2021
@@ -53,32 +53,53 @@ public abstract class BaseTestPicture {
         _testDataProvider = testDataProvider;
     }
 
-    public void baseTestResize(Picture input, Picture compare, double scaleX, double scaleY)
{
-        input.resize(scaleX, scaleY);
 
-        ClientAnchor inpCA = input.getClientAnchor();
-        ClientAnchor cmpCA = compare.getClientAnchor();
+    protected abstract Picture getPictureShape(Drawing<?> pat, int picIdx);
 
-        Dimension inpDim = ImageUtils.getDimensionFromAnchor(input);
-        Dimension cmpDim = ImageUtils.getDimensionFromAnchor(compare);
+    @Test
+    public void resize() throws IOException {
+        String fileName = "resize_compare.xls" + (getClass().getName().contains("xssf") ?
"x" : "");
+        double scaleX = 2;
+        double scaleY = 2;
 
-        double emuPX = Units.EMU_PER_PIXEL;
+        try (Workbook wb = _testDataProvider.openSampleWorkbook(fileName)) {
+            Sheet sh = wb.getSheetAt(0);
+            Drawing<?> pat = sh.createDrawingPatriarch();
 
-        assertEquals(inpDim.getHeight(), cmpDim.getHeight(), emuPX*6, "the image height differs");
-        assertEquals(inpDim.getWidth(),  cmpDim.getWidth(),  emuPX*6, "the image width differs");
-        assertEquals(inpCA.getCol1(), cmpCA.getCol1(), "the starting column differs");
-        assertEquals(inpCA.getDx1(), cmpCA.getDx1(), 1, "the column x-offset differs");
-        assertEquals(inpCA.getDy1(), cmpCA.getDy1(), 1, "the column y-offset differs");
-        assertEquals(inpCA.getCol2(), cmpCA.getCol2(), "the ending columns differs");
-        // can't compare row heights because of variable test heights
+            Picture input = getPictureShape(pat, 0);
+            Picture compare = getPictureShape(pat, 1);
 
-        input.resize();
-        inpDim = ImageUtils.getDimensionFromAnchor(input);
+            input.resize(scaleX, scaleY);
 
-        Dimension imgDim = input.getImageDimension();
+            ClientAnchor inpCA = input.getClientAnchor();
+            ClientAnchor cmpCA = compare.getClientAnchor();
 
-        assertEquals(imgDim.getHeight(), inpDim.getHeight()/emuPX, 1, "the image height differs");
-        assertEquals(imgDim.getWidth(), inpDim.getWidth()/emuPX,  1, "the image width differs");
+            double origDy1 = inpCA.getDy1();
+            double origDx1 = inpCA.getDx1();
+
+            Dimension inpDim = ImageUtils.getDimensionFromAnchor(input);
+            Dimension cmpDim = ImageUtils.getDimensionFromAnchor(compare);
+
+            double emuPX = Units.EMU_PER_PIXEL;
+
+            assertEquals(inpDim.getHeight(), cmpDim.getHeight(), emuPX * 6, "the image height
differs");
+            assertEquals(inpDim.getWidth(), cmpDim.getWidth(), emuPX * 6, "the image width
differs");
+            assertEquals(inpCA.getCol1(), cmpCA.getCol1(), "the starting column differs");
+            assertEquals(inpCA.getDx1(), cmpCA.getDx1(), 1, "the column x-offset differs");
+            assertEquals(inpCA.getDy1(), origDy1, 1, "the column y-offset differs - image
has moved");
+            assertEquals(inpCA.getDx1(), origDx1, 1, "the column x-offset differs - image
has moved");
+            assertEquals(inpCA.getDy1(), cmpCA.getDy1(), 1, "the column y-offset differs");
+            assertEquals(inpCA.getCol2(), cmpCA.getCol2(), "the ending columns differs");
+            // can't compare row heights because of variable test heights
+
+            input.resize();
+            inpDim = ImageUtils.getDimensionFromAnchor(input);
+
+            Dimension imgDim = input.getImageDimension();
+
+            assertEquals(imgDim.getHeight(), inpDim.getHeight() / emuPX, 1, "the image height
differs");
+            assertEquals(imgDim.getWidth(), inpDim.getWidth() / emuPX, 1, "the image width
differs");
+        }
     }
 
 

Modified: poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestRow.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestRow.java?rev=1885280&r1=1885279&r2=1885280&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestRow.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestRow.java Fri Jan  8 22:56:05
2021
@@ -144,7 +144,9 @@ public abstract class BaseTestRow {
         wb2.close();
     }
 
-    protected void baseTestRowBounds(int maxRowNum) throws IOException {
+    @Test
+    public void testRowBounds() throws IOException {
+        int maxRowNum = _testDataProvider.getSpreadsheetVersion().getLastRowIndex();
         try (Workbook workbook = _testDataProvider.createWorkbook()) {
             Sheet sheet = workbook.createSheet();
             //Test low row bound
@@ -161,7 +163,9 @@ public abstract class BaseTestRow {
         }
     }
 
-    protected void baseTestCellBounds(int maxCellNum) throws IOException {
+    @Test
+    protected void testCellBounds() throws IOException {
+        int maxCellNum = _testDataProvider.getSpreadsheetVersion().getLastColumnIndex();
         try (Workbook wb1 = _testDataProvider.createWorkbook()) {
             Sheet sheet = wb1.createSheet();
 

Modified: poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestSheet.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestSheet.java?rev=1885280&r1=1885279&r2=1885280&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestSheet.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestSheet.java Fri Jan  8 22:56:05
2021
@@ -755,7 +755,12 @@ public abstract class BaseTestSheet {
         }
     }
 
-    public void baseTestGetSetMargin(double[] defaultMargins) throws IOException {
+    @Test
+    public void testGetSetMargin() throws IOException {
+        double[] defaultMargins = (getClass().getName().contains("xssf"))
+            ? new double[]{0.7, 0.7, 0.75, 0.75, 0.3, 0.3}
+            : new double[]{0.75, 0.75, 1.0, 1.0, 0.3, 0.3};
+
         double marginLeft = defaultMargins[0];
         double marginRight = defaultMargins[1];
         double marginTop = defaultMargins[2];

Modified: poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestWorkbook.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestWorkbook.java?rev=1885280&r1=1885279&r2=1885280&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestWorkbook.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestWorkbook.java Fri Jan  8 22:56:05
2021
@@ -723,7 +723,10 @@ public abstract class BaseTestWorkbook {
         }
     }
 
-    protected void changeSheetNameWithSharedFormulas(String sampleFile) throws IOException
{
+    @Test
+    public void changeSheetNameWithSharedFormulas() throws IOException {
+        String sampleFile = "shared_formulas.xls" + (getClass().getName().contains("xssf")
? "x" : "");
+
         try (Workbook wb = _testDataProvider.openSampleWorkbook(sampleFile)) {
 
             FormulaEvaluator evaluator = wb.getCreationHelper().createFormulaEvaluator();

Modified: poi/trunk/test-data/spreadsheet/resize_compare.xlsx
URL: http://svn.apache.org/viewvc/poi/trunk/test-data/spreadsheet/resize_compare.xlsx?rev=1885280&r1=1885279&r2=1885280&view=diff
==============================================================================
Binary files - no diff available.



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


Mime
View raw message