Author: fanningpj Date: Tue Nov 7 12:00:57 2023 New Revision: 1913648 URL: http://svn.apache.org/viewvc?rev=1913648&view=rev Log: fix broken HSSFWorkbook test
Modified: poi/trunk/build.gradle poi/trunk/poi/src/test/java/org/apache/poi/hssf/usermodel/TestHSSFWorkbook.java poi/trunk/poi/src/test/java/org/apache/poi/ss/usermodel/BaseTestWorkbook.java Modified: poi/trunk/build.gradle URL: http://svn.apache.org/viewvc/poi/trunk/build.gradle?rev=1913648&r1=1913647&r2=1913648&view=diff ============================================================================== --- poi/trunk/build.gradle (original) +++ poi/trunk/build.gradle Tue Nov 7 12:00:57 2023 @@ -43,7 +43,7 @@ plugins { repositories { mavenCentral() - //maven { url 'https://repository.apache.org/content/repositories/staging' } + maven { url 'https://repository.apache.org/content/repositories/staging' } } // Only add the plugin for Sonar if enabled @@ -127,7 +127,7 @@ subprojects { log4jVersion = '2.21.1' mockitoVersion = '4.11.0' hamcrestVersion = '2.2' - xmlbeansVersion = '5.1.1' + xmlbeansVersion = '5.2.0' batikVersion = '1.17' graphics2dVersion = '0.43' pdfboxVersion = '2.0.29' @@ -177,7 +177,7 @@ subprojects { repositories { mavenCentral() - //maven { url 'https://repository.apache.org/content/repositories/staging' } + maven { url 'https://repository.apache.org/content/repositories/staging' } } dependencies { Modified: poi/trunk/poi/src/test/java/org/apache/poi/hssf/usermodel/TestHSSFWorkbook.java URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/test/java/org/apache/poi/hssf/usermodel/TestHSSFWorkbook.java?rev=1913648&r1=1913647&r2=1913648&view=diff ============================================================================== --- poi/trunk/poi/src/test/java/org/apache/poi/hssf/usermodel/TestHSSFWorkbook.java (original) +++ poi/trunk/poi/src/test/java/org/apache/poi/hssf/usermodel/TestHSSFWorkbook.java Tue Nov 7 12:00:57 2023 @@ -99,6 +99,15 @@ public final class TestHSSFWorkbook exte return wb.getWorkbook(); } + @Override + protected int getDrawingSizeForCreateDrawing1() { + return 225; + } + @Override + protected int getDrawingSizeForCreateDrawing2() { + return 171; + } + /** * Tests for {@link HSSFWorkbook#isHidden()} etc */ @@ -1217,11 +1226,6 @@ public final class TestHSSFWorkbook exte } } - @Disabled - void createDrawing() { - // the dimensions for this image are different than for XSSF and SXSSF - } - @Test void writeInvalidFile() throws Exception { try (Workbook wb = WorkbookFactory.create( Modified: poi/trunk/poi/src/test/java/org/apache/poi/ss/usermodel/BaseTestWorkbook.java URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/test/java/org/apache/poi/ss/usermodel/BaseTestWorkbook.java?rev=1913648&r1=1913647&r2=1913648&view=diff ============================================================================== --- poi/trunk/poi/src/test/java/org/apache/poi/ss/usermodel/BaseTestWorkbook.java (original) +++ poi/trunk/poi/src/test/java/org/apache/poi/ss/usermodel/BaseTestWorkbook.java Tue Nov 7 12:00:57 2023 @@ -872,6 +872,14 @@ public abstract class BaseTestWorkbook { } } + // these 2 values are overridden in TestHSSFWorkbook + protected int getDrawingSizeForCreateDrawing1() { + return 1609725; + } + protected int getDrawingSizeForCreateDrawing2() { + return 1114425; + } + // bug 51233 and 55075: correctly size image if added to a row with a custom height @Test void createDrawing() throws Exception { @@ -906,13 +914,13 @@ public abstract class BaseTestWorkbook { assertEquals(0, anchor.getRow1()); assertEquals(0, anchor.getRow2()); assertEquals(0, anchor.getDy1()); - assertEquals(1609725, anchor.getDy2()); //HSSF: 225 + assertEquals(getDrawingSizeForCreateDrawing1(), anchor.getDy2()); // Check drawing width assertEquals(0, anchor.getCol1()); assertEquals(0, anchor.getCol2()); assertEquals(0, anchor.getDx1()); - assertEquals(1114425, anchor.getDx2()); //HSSF: 171 + assertEquals(getDrawingSizeForCreateDrawing2(), anchor.getDx2()); } } --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@poi.apache.org For additional commands, e-mail: commits-h...@poi.apache.org