1 package org.displaytag.jsptests; 2 3 import org.displaytag.test.DisplaytagCase; 4 5 import com.meterware.httpunit.GetMethodWebRequest; 6 import com.meterware.httpunit.WebRequest; 7 import com.meterware.httpunit.WebResponse; 8 import com.meterware.httpunit.WebTable; 9 10 11 16 public class HtmlIdTest extends DisplaytagCase 17 { 18 19 22 public String getJspName() 23 { 24 return "htmlid.jsp"; 25 } 26 27 32 public void doTest(String jspName) throws Exception 33 { 34 WebRequest request = new GetMethodWebRequest(jspName); 35 WebResponse response; 36 37 response = runner.getResponse(request); 38 39 WebTable[] tables = response.getTables(); 40 assertEquals("Wrong number of tables in result.", 3, tables.length); 41 42 for (int j = 0; j < tables.length; j++) 43 { 44 assertEquals("invalid id", "html" + (j + 1), tables[j].getID()); 45 assertEquals("Unexpected value in table cell", "bee", tables[j].getCellAsText(1, 0)); 46 } 47 48 } 49 } | Popular Tags |