1 package org.displaytag.jsptests; 2 3 import org.apache.commons.lang.StringUtils; 4 import org.displaytag.test.DisplaytagCase; 5 6 import com.meterware.httpunit.GetMethodWebRequest; 7 import com.meterware.httpunit.WebRequest; 8 import com.meterware.httpunit.WebResponse; 9 import com.meterware.httpunit.WebTable; 10 11 12 17 public class Displ224Test extends DisplaytagCase 18 { 19 20 23 public String getJspName() 24 { 25 return "DISPL-224.jsp"; 26 } 27 28 33 public void doTest(String jspName) throws Exception 34 { 35 36 WebRequest request = new GetMethodWebRequest(jspName); 37 WebResponse response = runner.getResponse(request); 38 39 WebTable[] tables = response.getTables(); 40 assertEquals("Wrong number of tables in result.", 1, tables.length); 41 42 assertEquals("Wrong number of rows in result.", 2, tables[0].getRowCount()); 43 assertEquals("col", tables[0].getTableCell(0, 0).getAttribute("scope")); 44 assertEquals(StringUtils.EMPTY, tables[0].getTableCell(0, 1).getAttribute("scope")); 45 assertEquals(StringUtils.EMPTY, tables[0].getTableCell(1, 0).getAttribute("scope")); 46 assertEquals("row", tables[0].getTableCell(1, 1).getAttribute("scope")); 47 48 } 49 50 } | Popular Tags |