poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cen...@apache.org
Subject svn commit: r1722665 - in /poi/trunk: src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestUnfixedBugs.java test-data/spreadsheet/58325_db.xlsx test-data/spreadsheet/58325_lt.xlsx
Date Sat, 02 Jan 2016 21:11:29 GMT
Author: centic
Date: Sat Jan  2 21:11:28 2016
New Revision: 1722665

URL: http://svn.apache.org/viewvc?rev=1722665&view=rev
Log:
Add test which reproduces bug 58325, seems the file uses AlternateContent which POI does not
support (yet)

Added:
    poi/trunk/test-data/spreadsheet/58325_db.xlsx
    poi/trunk/test-data/spreadsheet/58325_lt.xlsx
Modified:
    poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestUnfixedBugs.java

Modified: poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestUnfixedBugs.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestUnfixedBugs.java?rev=1722665&r1=1722664&r2=1722665&view=diff
==============================================================================
--- poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestUnfixedBugs.java (original)
+++ poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestUnfixedBugs.java Sat Jan
 2 21:11:28 2016
@@ -31,6 +31,8 @@ import java.io.OutputStream;
 import java.nio.charset.Charset;
 import java.util.Calendar;
 import java.util.Date;
+import java.util.Iterator;
+import java.util.List;
 
 import org.apache.poi.hssf.HSSFTestDataSamples;
 import org.apache.poi.ss.usermodel.Cell;
@@ -391,4 +393,40 @@ public final class TestUnfixedBugs {
        assertEquals("Did not have expected contents at rownum " + rowNum, 
                contents + ".0", cell.toString());
    }
+
+   @Test
+   public void test58325_one() {
+       check58325(XSSFTestDataSamples.openSampleWorkbook("58325_lt.xlsx"), 1);
+   }
+
+   @Test
+   public void test58325_three() {
+       check58325(XSSFTestDataSamples.openSampleWorkbook("58325_db.xlsx"), 3);
+   }
+
+   private void check58325(XSSFWorkbook wb, int expectedShapes) {
+       XSSFSheet sheet = wb.getSheet("MetasNM001");
+       assertNotNull(sheet);
+
+       StringBuilder str = new StringBuilder();
+       str.append("sheet " + sheet.getSheetName() + " - ");
+
+       XSSFDrawing drawing = sheet.getDrawingPatriarch();
+       //drawing = ((XSSFSheet)sheet).createDrawingPatriarch();
+
+       List<XSSFShape> shapes = drawing.getShapes();
+       str.append("drawing.getShapes().size() = " + shapes.size());
+       Iterator<XSSFShape> it = shapes.iterator();
+       while(it.hasNext()) {           
+           XSSFShape shape = it.next();
+           str.append(", " + shape.toString());
+           str.append(", Col1:"+((XSSFClientAnchor)shape.getAnchor()).getCol1());
+           str.append(", Col2:"+((XSSFClientAnchor)shape.getAnchor()).getCol2());
+           str.append(", Row1:"+((XSSFClientAnchor)shape.getAnchor()).getRow1());
+           str.append(", Row2:"+((XSSFClientAnchor)shape.getAnchor()).getRow2());
+       }
+       
+       assertEquals("Having shapes: " + str, 
+               expectedShapes, shapes.size());
+   }
 }

Added: poi/trunk/test-data/spreadsheet/58325_db.xlsx
URL: http://svn.apache.org/viewvc/poi/trunk/test-data/spreadsheet/58325_db.xlsx?rev=1722665&view=auto
==============================================================================
Binary files poi/trunk/test-data/spreadsheet/58325_db.xlsx (added) and poi/trunk/test-data/spreadsheet/58325_db.xlsx
Sat Jan  2 21:11:28 2016 differ

Added: poi/trunk/test-data/spreadsheet/58325_lt.xlsx
URL: http://svn.apache.org/viewvc/poi/trunk/test-data/spreadsheet/58325_lt.xlsx?rev=1722665&view=auto
==============================================================================
Binary files poi/trunk/test-data/spreadsheet/58325_lt.xlsx (added) and poi/trunk/test-data/spreadsheet/58325_lt.xlsx
Sat Jan  2 21:11:28 2016 differ



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


Mime
View raw message