mirror of https://github.com/apache/poi.git
[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:
parent
11b0cf965c
commit
0baf788054
|
@ -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.
Loading…
Reference in New Issue