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 ColumnBodyTest extends DisplaytagCase 17 { 18 19 22 public String getJspName() 23 { 24 return "columnbody.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.", 1, tables.length); 41 42 if (log.isDebugEnabled()) 43 { 44 log.debug(response.getText()); 45 } 46 47 for (int j = 0; j < tables[0].getColumnCount(); j++) 48 { 49 assertEquals("Wrong content in table cell", "ant", tables[0].getCellAsText(1, j)); 50 } 51 52 } 53 } | Popular Tags |