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 AutocolumnStringTest extends DisplaytagCase 17 { 18 19 22 public String getJspName() 23 { 24 return "autocolumns-string.jsp"; 25 } 26 27 32 public void doTest(String jspName) throws Exception 33 { 34 35 WebRequest request = new GetMethodWebRequest(jspName); 36 37 WebResponse response = runner.getResponse(request); 38 39 if (log.isDebugEnabled()) 40 { 41 log.debug("RESPONSE: " + response.getText()); 42 } 43 44 WebTable[] tables = response.getTables(); 45 46 assertEquals("Wrong number of tables.", 1, tables.length); 47 48 assertEquals("Bad number of generated columns.", 1, tables[0].getColumnCount()); 49 assertEquals("Bad number of generated rows.", 4, tables[0].getRowCount()); 50 51 assertEquals("string1", tables[0].getCellAsText(1, 0)); 52 assertEquals("string2", tables[0].getCellAsText(2, 0)); 53 assertEquals("string3", tables[0].getCellAsText(3, 0)); 54 } 55 } | Popular Tags |