ASF Bugzilla – Attachment 38293 Details for
Bug 66079
XWPFNumbering.removeAbstractNum still removes by list index, not abstractNumId
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
test for r1901083
test_66079.patch (text/plain), 2.30 KB, created by
Vladislav Arakelov
on 2022-05-21 22:10:48 UTC
(
hide
)
Description:
test for r1901083
Filename:
MIME Type:
Creator:
Vladislav Arakelov
Created:
2022-05-21 22:10:48 UTC
Size:
2.30 KB
patch
obsolete
>Index: poi-ooxml/src/test/java/org/apache/poi/xwpf/usermodel/TestXWPFBugs.java >IDEA additional info: >Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP ><+>UTF-8 >=================================================================== >diff --git a/poi-ooxml/src/test/java/org/apache/poi/xwpf/usermodel/TestXWPFBugs.java b/poi-ooxml/src/test/java/org/apache/poi/xwpf/usermodel/TestXWPFBugs.java >--- a/poi-ooxml/src/test/java/org/apache/poi/xwpf/usermodel/TestXWPFBugs.java (revision aa2f66acde172c9b44eaefcb9b4086db13a26a9c) >+++ b/poi-ooxml/src/test/java/org/apache/poi/xwpf/usermodel/TestXWPFBugs.java (revision 944b17744139021861e6db08f2fb09a4c040c9eb) >@@ -195,24 +195,26 @@ > > //attempt to remove item with numId 2 > assertTrue(numbering.removeAbstractNum(BigInteger.valueOf(2))); >+ XWPFDocument docReloaded = writeOutAndReadBack(doc); >+ XWPFNumbering numberingReloaded = docReloaded.getNumbering(); > >- for (int i = 0; i <= 10; i++) { >- XWPFAbstractNum abstractNum = numbering.getAbstractNum(BigInteger.valueOf(i)); >+ for (int id = 0; id <= 10; id++) { >+ XWPFAbstractNum abstractNum = numberingReloaded.getAbstractNum(BigInteger.valueOf(id)); > > // we removed id "2", so this one should be empty, all others not >- if (i == 2) { >- assertNull(abstractNum, "Failed for " + i); >+ if (id == 2) { >+ assertNull(abstractNum, "Failed for " + id); > } else { >- assertNotNull(abstractNum, "Failed for " + i); >- assertEquals(i, abstractNum.getAbstractNum().getAbstractNumId().longValue()); >+ assertNotNull(abstractNum, "Failed for " + id); >+ assertEquals(id, abstractNum.getAbstractNum().getAbstractNumId().longValue()); > } > } > > // removing the same again fails >- assertFalse(numbering.removeAbstractNum(BigInteger.valueOf(2))); >+ assertFalse(numberingReloaded.removeAbstractNum(BigInteger.valueOf(2))); > > // removing another one works >- assertTrue(numbering.removeAbstractNum(BigInteger.valueOf(4))); >+ assertTrue(numberingReloaded.removeAbstractNum(BigInteger.valueOf(4))); > } > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 66079
: 38293 |
38294