public void doTest(String jspName) throws Exception {
WebRequest request = new GetMethodWebRequest(jspName);
WebResponse response = runner.getResponse(request);
ParamEncoder encoder = new ParamEncoder("table");
request.setParameter(encoder.encodeParameterName(TableTagParameters.PARAMETER_PAGE), "2");
if (log.isDebugEnabled())
{
log.debug(response.getText());
}
WebTable[] tables = response.getTables();
assertEquals("Wrong number of tables in result.", 1, tables.length);
assertEquals("Wrong number of rows in result.", 4, tables[0].getRowCount());
if (log.isDebugEnabled())
{
log.debug(response.getText());
}
assertEquals("Wrong value", "a", tables[0].getCellAsText(1, 0));
assertEquals("Wrong viewIndex", "0", tables[0].getCellAsText(1, 1));
assertEquals("Wrong listIndex", "0", tables[0].getCellAsText(1, 2));
assertEquals("Wrong value", "b", tables[0].getCellAsText(2, 0));
assertEquals("Wrong viewIndex", "1", tables[0].getCellAsText(2, 1));
assertEquals("Wrong listIndex", "1", tables[0].getCellAsText(2, 2));
assertEquals("Wrong value", "c", tables[0].getCellAsText(3, 0));
assertEquals("Wrong viewIndex", "2", tables[0].getCellAsText(3, 1));
assertEquals("Wrong listIndex", "2", tables[0].getCellAsText(3, 2));
}
Check list index/view index values. |