assertEquals("finally I can write!\n", xtab.getText());
}
public void testCreateRow() {
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(null, table);
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(null, CTTbl.Factory.newInstance());
assertEquals(1, xtab.getCTTbl().getTrArray(0).sizeOfTcArray());
}