Author: onealj
Date: Wed Feb  8 18:32:53 2017
New Revision: 1782224

URL: http://svn.apache.org/viewvc?rev=1782224&view=rev
Log:
bug 59030: convert to junit4; whitespace

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

Modified: 
poi/trunk/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFTableCell.java
URL: 
http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFTableCell.java?rev=1782224&r1=1782223&r2=1782224&view=diff
==============================================================================
--- 
poi/trunk/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFTableCell.java
 (original)
+++ 
poi/trunk/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFTableCell.java
 Wed Feb  8 18:32:53 2017
@@ -19,19 +19,20 @@
 
 package org.apache.poi.xwpf.usermodel;
 
-import junit.framework.TestCase;
+import static org.junit.Assert.*;
+
+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 java.util.List;
 
-public class TestXWPFTableCell extends TestCase {
-    @Override
-    protected void setUp() throws Exception {
-        super.setUp();
-    }
+public class TestXWPFTableCell {
 
+    @Test
     public void testSetGetVertAlignment() throws Exception {
         // instantiate the following classes so they'll get picked up by
         // the XmlBean process and added to the jar file. they are required
@@ -60,6 +61,7 @@ public class TestXWPFTableCell extends T
         assertEquals(XWPFVertAlign.BOTH, al);
     }
 
+    @Test
     public void testSetGetColor() throws Exception {
         // create a table
         XWPFDocument doc = new XWPFDocument();
@@ -77,9 +79,10 @@ public class TestXWPFTableCell extends T
     }
 
     /**
-     * ensure that CTHMerge & CTTcBorders go in poi-ooxml.jar
+     * ensure that CTHMerge and CTTcBorders go in poi-ooxml.jar
      */
     @SuppressWarnings("unused")
+    @Test
     public void test54099() {
         XWPFDocument doc = new XWPFDocument();
         CTTbl ctTable = CTTbl.Factory.newInstance();
@@ -96,6 +99,7 @@ public class TestXWPFTableCell extends T
         CTVMerge vMerge = tcPr.addNewVMerge();
     }
 
+    @Test
     public void testCellVerticalAlign() throws Exception{
         XWPFDocument docx = 
XWPFTestDataSamples.openSampleDocument("59030.docx");
         List<XWPFTable> tables = docx.getTables();
@@ -111,18 +115,19 @@ public class TestXWPFTableCell extends T
         assertEquals(XWPFVertAlign.CENTER, 
tableRows.get(1).getCell(0).getVerticalAlignment());
         assertEquals(XWPFVertAlign.TOP, 
tableRows.get(1).getCell(1).getVerticalAlignment());
     }
-       
-       public void testCellVerticalAlign2() throws Exception{
-               XWPFDocument docx = 
XWPFTestDataSamples.openSampleDocument("TestTableCellAlign.docx");
-               List<XWPFTable> tables = docx.getTables();
+
+    @Test
+    public void testCellVerticalAlignShouldNotThrowNPE() throws Exception {
+        XWPFDocument docx = 
XWPFTestDataSamples.openSampleDocument("TestTableCellAlign.docx");
+        List<XWPFTable> tables = docx.getTables();
         for (XWPFTable table : tables) {
             List<XWPFTableRow> tableRows = table.getRows();
             for (XWPFTableRow tableRow : tableRows) {
                 List<XWPFTableCell> tableCells = tableRow.getTableCells();
                 for (XWPFTableCell tableCell : tableCells) {
-                                       
assertNotNull(tableCell.getVerticalAlignment());
-                               }
-                       }
-               }                       
-       }
+                    assertNotNull(tableCell.getVerticalAlignment());
+                }
+            }
+        }
+    }
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to