public void doTest(String jspName) throws Exception {
ParamEncoder encoder = new ParamEncoder("table");
String mediaParameter = encoder.encodeParameterName(TableTagParameters.PARAMETER_PAGE);
WebRequest request = new GetMethodWebRequest(jspName);
request.setParameter(mediaParameter, "2");
WebResponse response = runner.getResponse(request);
if (log.isDebugEnabled())
{
log.debug("RESPONSE: " + response.getText());
}
WebTable[] tables = response.getTables();
assertEquals("Wrong number of tables.", 1, tables.length);
assertEquals("ViewIndex is wrong", "0", tables[0].getCellAsText(1, 0));
assertEquals("ViewIndex is wrong", "1", tables[0].getCellAsText(2, 0));
assertEquals("ListIndex is wrong", "3", tables[0].getCellAsText(1, 1));
assertEquals("ListIndex is wrong", "4", tables[0].getCellAsText(2, 1));
}
Checks that the generated page contains decorated values. |