diff options
author | Dominik Stadler <centic@apache.org> | 2020-06-15 20:51:39 +0000 |
---|---|---|
committer | Dominik Stadler <centic@apache.org> | 2020-06-15 20:51:39 +0000 |
commit | 863659f48c4711d7af457c4f8f5a45c074ae14c0 (patch) | |
tree | cc3dbaf86df2653a13ab92ba81d6f5a87c93a717 /src/ooxml/testcases/org/apache/poi/xwpf/usermodel | |
parent | 6eafee01d4c6126bccaecf195743552e0187c08a (diff) | |
download | poi-863659f48c4711d7af457c4f8f5a45c074ae14c0.tar.gz poi-863659f48c4711d7af457c4f8f5a45c074ae14c0.zip |
Add some more tests for bug 63624
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1878868 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/ooxml/testcases/org/apache/poi/xwpf/usermodel')
-rw-r--r-- | src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFTableCell.java | 37 |
1 files changed, 32 insertions, 5 deletions
diff --git a/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFTableCell.java b/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFTableCell.java index 8b65434ec0..34c0cdae78 100644 --- a/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFTableCell.java +++ b/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFTableCell.java @@ -19,14 +19,26 @@ package org.apache.poi.xwpf.usermodel; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; import org.junit.Ignore; import org.junit.Test; import org.apache.poi.xwpf.XWPFTestDataSamples; import org.apache.poi.xwpf.usermodel.XWPFTableCell.XWPFVertAlign; -import org.openxmlformats.schemas.wordprocessingml.x2006.main.*; +import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTHMerge; +import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTShd; +import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTbl; +import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTc; +import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTcBorders; +import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTcPr; +import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTVMerge; +import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTVerticalJc; +import org.openxmlformats.schemas.wordprocessingml.x2006.main.STMerge; +import org.openxmlformats.schemas.wordprocessingml.x2006.main.STShd; +import org.openxmlformats.schemas.wordprocessingml.x2006.main.STVerticalJc; import java.util.List; @@ -135,14 +147,14 @@ public class TestXWPFTableCell { } } } - + @Test public void testCellGetSetWidth() throws Exception { XWPFDocument doc = new XWPFDocument(); XWPFTable table = doc.createTable(); - XWPFTableRow tr = table.createRow(); + XWPFTableRow tr = table.createRow(); XWPFTableCell cell = tr.addNewTableCell(); - + cell.setWidth("50%"); assertEquals(TableWidthType.PCT, cell.getWidthType()); assertEquals(50.0, cell.getWidthDecimal(), 0.0); @@ -215,4 +227,19 @@ public class TestXWPFTableCell { assertEquals(expected, actual); doc.close(); } + + @Test + public void test63624() { + XWPFDocument doc = new XWPFDocument(); + XWPFTable table = doc.createTable(1, 1); + XWPFTableRow row = table.getRow(0); + XWPFTableCell cell = row.getCell(0); + + 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"); + assertEquals("test text 1test text 2", cell.getText()); + } } |