View | Details | Raw Unified | Return to bug 66079
Collapse All | Expand All

(-)a/poi-ooxml/src/test/java/org/apache/poi/xwpf/usermodel/TestXWPFBugs.java (+11 lines)
Lines 195-200 Link Here
195
195
196
            //attempt to remove item with numId 2
196
            //attempt to remove item with numId 2
197
            assertTrue(numbering.removeAbstractNum(BigInteger.valueOf(2)));
197
            assertTrue(numbering.removeAbstractNum(BigInteger.valueOf(2)));
198
199
            //adding one level to numbering with id 1
200
            numbering.getAbstractNum(BigInteger.valueOf(1)).getCTAbstractNum().addNewLvl();
201
198
            XWPFDocument docReloaded = writeOutAndReadBack(doc);
202
            XWPFDocument docReloaded = writeOutAndReadBack(doc);
199
            XWPFNumbering numberingReloaded = docReloaded.getNumbering();
203
            XWPFNumbering numberingReloaded = docReloaded.getNumbering();
200
204
Lines 207-212 Link Here
207
                } else {
211
                } else {
208
                    assertNotNull(abstractNum, "Failed for " + id);
212
                    assertNotNull(abstractNum, "Failed for " + id);
209
                    assertEquals(id, abstractNum.getAbstractNum().getAbstractNumId().longValue());
213
                    assertEquals(id, abstractNum.getAbstractNum().getAbstractNumId().longValue());
214
215
                    // we added one level for numbering with id "1"
216
                    if (id == 1) {
217
                        assertEquals(1, abstractNum.getAbstractNum().getLvlList().size());
218
                    } else {
219
                        assertEquals(0, abstractNum.getAbstractNum().getLvlList().size());
220
                    }
210
                }
221
                }
211
            }
222
            }
212
223

Return to bug 66079