1 package org.displaytag.jsptests; 2 3 import org.displaytag.tags.TableTagParameters; 4 import org.displaytag.test.DisplaytagCase; 5 import org.displaytag.util.ParamEncoder; 6 7 import com.meterware.httpunit.GetMethodWebRequest; 8 import com.meterware.httpunit.WebRequest; 9 import com.meterware.httpunit.WebResponse; 10 import com.meterware.httpunit.WebTable; 11 12 13 18 public class Displ118Test extends DisplaytagCase 19 { 20 21 24 public String getJspName() 25 { 26 return "DISPL-118.jsp"; 27 } 28 29 34 public void doTest(String jspName) throws Exception 35 { 36 WebRequest request = new GetMethodWebRequest(jspName); 37 ParamEncoder encoder = new ParamEncoder("table"); 38 request.setParameter(encoder.encodeParameterName(TableTagParameters.PARAMETER_PAGE), "3"); 39 40 WebResponse response = runner.getResponse(request); 41 42 if (log.isDebugEnabled()) 43 { 44 log.debug(response.getText()); 45 } 46 47 WebTable[] tables = response.getTables(); 48 assertEquals("Wrong number of tables.", 1, tables.length); 49 50 assertNotNull("Not in page 2 as expected?", response.getElementWithID("PAGETWO")); 51 52 } 53 54 } | Popular Tags |