[bug-65738] add basic test

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1895789 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
PJ Fanning 2021-12-10 18:41:41 +00:00
parent 11b0cf965c
commit 0baf788054
2 changed files with 21 additions and 12 deletions

View File

@ -216,18 +216,6 @@ class TestXWPFBugs {
}
}
private static void addNumberingWithAbstractId(XWPFNumbering documentNumbering, int id){
// create a numbering scheme
CTAbstractNum cTAbstractNum = CTAbstractNum.Factory.newInstance();
// give the scheme an ID
cTAbstractNum.setAbstractNumId(BigInteger.valueOf(id));
XWPFAbstractNum abstractNum = new XWPFAbstractNum(cTAbstractNum);
BigInteger abstractNumID = documentNumbering.addAbstractNum(abstractNum);
documentNumbering.addNum(abstractNumID);
}
@Test
public void test65099() throws IOException {
try (XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("65099.docx")) {
@ -256,4 +244,25 @@ class TestXWPFBugs {
doc.getStyles().getUsedStyleList(style);
}
}
@Test
void bug65738() throws Exception {
try (XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("bug65738.docx")) {
XWPFStyles styles = doc.getStyles();
assertNotNull(styles);
assertEquals(22, doc.getParagraphs().size());
}
}
private static void addNumberingWithAbstractId(XWPFNumbering documentNumbering, int id){
// create a numbering scheme
CTAbstractNum cTAbstractNum = CTAbstractNum.Factory.newInstance();
// give the scheme an ID
cTAbstractNum.setAbstractNumId(BigInteger.valueOf(id));
XWPFAbstractNum abstractNum = new XWPFAbstractNum(cTAbstractNum);
BigInteger abstractNumID = documentNumbering.addAbstractNum(abstractNum);
documentNumbering.addNum(abstractNumID);
}
}

Binary file not shown.