1 package org.displaytag.jsptests; 2 3 import org.displaytag.test.DisplaytagCase; 4 5 import com.meterware.httpunit.GetMethodWebRequest; 6 import com.meterware.httpunit.WebLink; 7 import com.meterware.httpunit.WebRequest; 8 import com.meterware.httpunit.WebResponse; 9 import com.meterware.httpunit.WebTable; 10 11 12 17 public class Displ001Test extends DisplaytagCase 18 { 19 20 23 public String getJspName() 24 { 25 return "DISPL-001.jsp"; 26 } 27 28 33 public void doTest(String jspName) throws Exception 34 { 35 WebRequest request = new GetMethodWebRequest(jspName); 36 WebResponse response = runner.getResponse(request); 37 38 WebTable[] tables = response.getTables(); 39 assertEquals("Expected 1 table in result.", 1, tables.length); 40 assertEquals("Wrong title in column", "averylongemail@mail.com", tables[0].getTableCell(1, 0).getTitle()); 41 42 WebLink[] links = tables[0].getTableCell(1, 0).getLinks(); 43 assertEquals("Expected link not found", 1, links.length); 44 assertEquals("Wrong text in link", "averylongemail@...", links[0].getText()); 45 assertEquals("Wrong url in link", "mailto:averylongemail@mail.com", links[0].getURLString()); 46 } 47 48 } | Popular Tags |