]> source.dussan.org Git - poi.git/commitdiff
bug 59030: revert r1746625 and restore r1731257, where XWPFTableCell#getVerticalAlign...
authorJaven O'Neal <onealj@apache.org>
Wed, 8 Feb 2017 18:35:04 +0000 (18:35 +0000)
committerJaven O'Neal <onealj@apache.org>
Wed, 8 Feb 2017 18:35:04 +0000 (18:35 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1782225 13f79535-47bb-0310-9956-ffa450edef68

src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFTableCell.java

index d33a9aa3a3c6a4a18ec0fa1d287e8593c3982229..d1cf5b2e907b2a71845f272b6beced1865f12942 100644 (file)
@@ -110,12 +110,14 @@ public class TestXWPFTableCell {
         List<XWPFTableRow> tableRows = table.getRows();
         assertEquals(2, tableRows.size());
 
-        assertEquals(XWPFVertAlign.TOP, tableRows.get(0).getCell(0).getVerticalAlignment());
+        assertNull(tableRows.get(0).getCell(0).getVerticalAlignment());
         assertEquals(XWPFVertAlign.BOTTOM, tableRows.get(0).getCell(1).getVerticalAlignment());
         assertEquals(XWPFVertAlign.CENTER, tableRows.get(1).getCell(0).getVerticalAlignment());
-        assertEquals(XWPFVertAlign.TOP, tableRows.get(1).getCell(1).getVerticalAlignment());
+        assertNull(tableRows.get(1).getCell(1).getVerticalAlignment()); // should return null since alignment isn't set
     }
 
+    // This is not a very useful test as written. It is not worth the execution time for a unit test
+    @Ignore
     @Test
     public void testCellVerticalAlignShouldNotThrowNPE() throws Exception {
         XWPFDocument docx = XWPFTestDataSamples.openSampleDocument("TestTableCellAlign.docx");
@@ -125,7 +127,8 @@ public class TestXWPFTableCell {
             for (XWPFTableRow tableRow : tableRows) {
                 List<XWPFTableCell> tableCells = tableRow.getTableCells();
                 for (XWPFTableCell tableCell : tableCells) {
-                    assertNotNull(tableCell.getVerticalAlignment());
+                    // getVerticalAlignment should return either an XWPFVertAlign enum or null if not set
+                    tableCell.getVerticalAlignment();
                 }
             }
         }