Search in sources :

Example 1 with XmlValueDisconnectedException

use of org.apache.xmlbeans.impl.values.XmlValueDisconnectedException in project poi by apache.

the class TestXSSFSheetShiftRows method bug59733.

// This test is written as expected-to-fail and should be rewritten
// as expected-to-pass when the bug is fixed.
//@Ignore("Bug 59733 - shiftRows() causes org.apache.xmlbeans.impl.values.XmlValueDisconnectedException")
@Test
public void bug59733() throws IOException {
    Workbook workbook = new XSSFWorkbook();
    Sheet sheet = workbook.createSheet();
    for (int r = 0; r < 4; r++) {
        sheet.createRow(r);
    }
    // Shift the 2nd row on top of the 0th row
    sheet.shiftRows(2, 2, -2);
    // FIXME: remove try, catch, and testPassesNow, skipTest when test passes
    try {
        sheet.removeRow(sheet.getRow(0));
        assertEquals(1, sheet.getRow(1).getRowNum());
        testPassesNow(59733);
    } catch (XmlValueDisconnectedException e) {
        skipTest(e);
    }
    workbook.close();
}
Also used : XmlValueDisconnectedException(org.apache.xmlbeans.impl.values.XmlValueDisconnectedException) Sheet(org.apache.poi.ss.usermodel.Sheet) Workbook(org.apache.poi.ss.usermodel.Workbook) POITestCase.skipTest(org.apache.poi.POITestCase.skipTest) Test(org.junit.Test)

Aggregations

POITestCase.skipTest (org.apache.poi.POITestCase.skipTest)1 Sheet (org.apache.poi.ss.usermodel.Sheet)1 Workbook (org.apache.poi.ss.usermodel.Workbook)1 XmlValueDisconnectedException (org.apache.xmlbeans.impl.values.XmlValueDisconnectedException)1 Test (org.junit.Test)1