bug 59733: add disabled unit test from Dattathreya

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1749295 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Javen O'Neal 2016-06-20 10:41:22 +00:00
parent d23e77fcf5
commit 3f546d927f
1 changed files with 30 additions and 0 deletions

View 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();
}
}