]> source.dussan.org Git - poi.git/commitdiff
bug 59733: add disabled unit test from Dattathreya
authorJaven O'Neal <onealj@apache.org>
Mon, 20 Jun 2016 10:41:22 +0000 (10:41 +0000)
committerJaven O'Neal <onealj@apache.org>
Mon, 20 Jun 2016 10:41:22 +0000 (10:41 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1749295 13f79535-47bb-0310-9956-ffa450edef68

src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheetShiftRows.java

index a477d586ccb1050742ec3300a186335a856604e0..c821d606efbca4913a7f65b687e7aa473a4f457c 100644 (file)
@@ -34,6 +34,7 @@ import org.apache.poi.ss.util.CellAddress;
 import org.apache.poi.ss.util.CellUtil;
 import org.apache.poi.xssf.XSSFITestDataProvider;
 import org.apache.poi.xssf.XSSFTestDataSamples;
+import org.junit.Ignore;
 import org.junit.Test;
 
 public final class TestXSSFSheetShiftRows extends BaseTestSheetShiftRows {
@@ -366,4 +367,33 @@ public final class TestXSSFSheetShiftRows extends BaseTestSheetShiftRows {
         
         wb.close();
     }
+    
+    @Ignore
+    @Test
+    public void bug59733() throws IOException {
+        Workbook workbook = new XSSFWorkbook();
+        Sheet sheet = workbook.createSheet("mySheet");
+        for (int r=0; r<=4; r++) {
+            Row row = sheet.createRow(r);
+            row.createCell(r*2+0);
+            row.createCell(r*2+1);
+        }
+
+        // Shift the 2nd row on top of the 0th row
+        sheet.shiftRows(2, 2, -2);
+        
+        /*
+         * The following error is thrown when shifting the 3rd row on top of the 0th row
+        org.apache.xmlbeans.impl.values.XmlValueDisconnectedException
+            at org.apache.xmlbeans.impl.values.XmlObjectBase.check_orphaned(XmlObjectBase.java:1258)
+            at org.openxmlformats.schemas.spreadsheetml.x2006.main.impl.CTRowImpl.getR(Unknown Source)
+            at org.apache.poi.xssf.usermodel.XSSFRow.getRowNum(XSSFRow.java:363)
+            at org.apache.poi.xssf.usermodel.XSSFSheet.shiftRows(XSSFSheet.java:2926)
+            at org.apache.poi.xssf.usermodel.XSSFSheet.shiftRows(XSSFSheet.java:2901)
+            at org.apache.poi.xssf.usermodel.TestXSSFSheetShiftRows.bug59733(TestXSSFSheetShiftRows.java:393)
+         */
+        sheet.shiftRows(3, 3, -3);
+        
+        workbook.close();
+    }
 }