public void testCreateRow() {
XWPFDocument doc = new XWPFDocument();
CTTbl table = CTTbl.Factory.newInstance();
CTRow r1 = table.addNewTr();
r1.addNewTc().addNewP();
r1.addNewTc().addNewP();
CTRow r2 = table.addNewTr();
r2.addNewTc().addNewP();
r2.addNewTc().addNewP();
CTRow r3 = table.addNewTr();
r3.addNewTc().addNewP();
r3.addNewTc().addNewP();
XWPFTable xtab = new XWPFTable(table, doc);
assertEquals(3, xtab.getNumberOfRows());
assertNotNull(xtab.getRow(2));
//add a new row
xtab.createRow();
//check number of cols
assertEquals(2, table.getTrArray(0).sizeOfTcArray());
//check creation of first row
xtab = new XWPFTable(CTTbl.Factory.newInstance(), doc);
assertEquals(1, xtab.getCTTbl().getTrArray(0).sizeOfTcArray());
}