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 Displ081Test extends DisplaytagCase 17 { 18 19 22 public String getJspName() 23 { 24 return "DISPL-081.jsp"; 25 } 26 27 32 public void doTest(String jspName) throws Exception 33 { 34 WebRequest request = new GetMethodWebRequest(jspName); 35 WebResponse response = runner.getResponse(request); 36 37 WebTable[] tables = response.getTables(); 38 assertEquals("Wrong number of tables.", 1, tables.length); 39 40 assertEquals("Wrong number of columns.", 2, tables[0].getColumnCount()); 41 assertEquals("Wrong number of rows.", 2, tables[0].getRowCount()); 42 43 assertEquals("Wrong text in column 1", "decorated: ant", tables[0].getCellAsText(1, 0)); 44 assertEquals("Wrong text in column 2", "decorated: body", tables[0].getCellAsText(1, 1)); 45 } 46 47 } | Popular Tags |