aboutsummaryrefslogtreecommitdiffstats
path: root/poi-ooxml
diff options
context:
space:
mode:
authorPJ Fanning <fanningpj@apache.org>2023-08-18 13:08:13 +0000
committerPJ Fanning <fanningpj@apache.org>2023-08-18 13:08:13 +0000
commitc3f42018315b3cdecb1b9e44fdff93124f8f1295 (patch)
tree8e1ab4914c533ade94b3539e3058b4d35d9af245 /poi-ooxml
parentf07be05484209e2de35817826db26473786b9c58 (diff)
downloadpoi-c3f42018315b3cdecb1b9e44fdff93124f8f1295.tar.gz
poi-c3f42018315b3cdecb1b9e44fdff93124f8f1295.zip
change test broken by bug-66988 change
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1911755 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poi-ooxml')
-rw-r--r--poi-ooxml/src/test/java/org/apache/poi/xwpf/usermodel/TestXWPFBugs.java11
-rw-r--r--poi-ooxml/src/test/java/org/apache/poi/xwpf/usermodel/TestXWPFTableCell.java14
2 files changed, 12 insertions, 13 deletions
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
index 7b20827b78..8afaaecb2d 100644
--- 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
@@ -329,17 +329,6 @@ class TestXWPFBugs {
}
}
- @Test
- void bug66988() throws IOException {
- try (XWPFDocument document = XWPFTestDataSamples.openSampleDocument("Bug66988.docx")) {
- XWPFTableCell cell = document.getTableArray(0).getRow(0).getCell(0);
- cell.appendText("World");
- assertEquals("HelloWorld", cell.getText());
- cell.setText("FooBar");
- assertEquals("FooBar", cell.getText());
- }
- }
-
private static void addNumberingWithAbstractId(XWPFNumbering documentNumbering, int id){
// create a numbering scheme
CTAbstractNum cTAbstractNum = CTAbstractNum.Factory.newInstance();
diff --git a/poi-ooxml/src/test/java/org/apache/poi/xwpf/usermodel/TestXWPFTableCell.java b/poi-ooxml/src/test/java/org/apache/poi/xwpf/usermodel/TestXWPFTableCell.java
index 669b3e0992..9d29cb8247 100644
--- a/poi-ooxml/src/test/java/org/apache/poi/xwpf/usermodel/TestXWPFTableCell.java
+++ b/poi-ooxml/src/test/java/org/apache/poi/xwpf/usermodel/TestXWPFTableCell.java
@@ -262,8 +262,7 @@ class TestXWPFTableCell {
cell.setText("test text 1");
assertEquals("test text 1", cell.getText());
- // currently the text is added, I am not sure if this is expected or not...
- cell.setText("test text 2");
+ cell.appendText("test text 2");
assertEquals("test text 1test text 2", cell.getText());
}
@@ -284,4 +283,15 @@ class TestXWPFTableCell {
XWPFTableCell readCell = readDoc.getTableArray(0).getRow(0).getCell(0);
assertEquals(0, readCell.getParagraphs().size());
}
+
+ @Test
+ void bug66988() throws IOException {
+ try (XWPFDocument document = XWPFTestDataSamples.openSampleDocument("Bug66988.docx")) {
+ XWPFTableCell cell = document.getTableArray(0).getRow(0).getCell(0);
+ cell.appendText("World");
+ assertEquals("HelloWorld", cell.getText());
+ cell.setText("FooBar");
+ assertEquals("FooBar", cell.getText());
+ }
+ }
}