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 Displ174Test extends DisplaytagCase 17 { 18 19 22 public String getJspName() 23 { 24 return "DISPL-174.jsp"; 25 } 26 27 32 public void doTest(String jspName) throws Exception 33 { 34 WebRequest request = new GetMethodWebRequest(jspName); 35 36 WebResponse response = runner.getResponse(request); 37 38 if (log.isDebugEnabled()) 39 { 40 log.debug(response.getText()); 41 } 42 43 WebTable[] tables = response.getTables(); 44 assertEquals("Wrong number of tables.", 1, tables.length); 45 46 assertEquals("Wrong value", "1234567890...", tables[0].getCellAsText(1, 0)); 47 assertEquals("Wrong title", "1234567890123", tables[0].getTableCell(1, 0).getAttribute("title")); 48 49 assertEquals("Wrong value", "1234567890", tables[0].getCellAsText(1, 1)); 50 assertEquals("Wrong title", "", tables[0].getTableCell(1, 1).getAttribute("title")); 51 52 } 53 54 } | Popular Tags |