* No alignment. Some browsers (FF) return a default value when alignment is
* not specified, others (IE/HtmlUnit) return an empty string.
*/
table.setRowData(0, createData(0, 1));
table.getPresenter().flush();
TableCellElement td = getBodyElement(table, 0, 2);
String hAlign = td.getAlign();
String vAlign = td.getVAlign();
assertTrue("".equals(hAlign) || "left".equals(hAlign));
assertTrue("".equals(vAlign) || "middle".equals(vAlign));
// Horizontal alignment.
column.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);
table.setRowData(0, createData(0, 1));
table.getPresenter().flush();
td = getBodyElement(table, 0, 2);
hAlign = td.getAlign();
vAlign = td.getVAlign();
assertTrue("right".equals(hAlign));
assertTrue("".equals(vAlign) || "middle".equals(vAlign));
// Vertical alignment.
column.setHorizontalAlignment(null);
column.setVerticalAlignment(HasVerticalAlignment.ALIGN_BOTTOM);
table.setRowData(0, createData(0, 1));
table.getPresenter().flush();
td = getBodyElement(table, 0, 2);
hAlign = td.getAlign();
vAlign = td.getVAlign();
assertTrue("".equals(hAlign) || "left".equals(hAlign));
assertTrue("bottom".equals(vAlign));
// Horizontal and vertical alignment.
column.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);
table.setRowData(0, createData(0, 1));
table.getPresenter().flush();
td = getBodyElement(table, 0, 2);
hAlign = td.getAlign();
vAlign = td.getVAlign();
assertTrue("right".equals(hAlign));
assertTrue("bottom".equals(vAlign));
}