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 Displ237Test extends DisplaytagCase 18 { 19 20 23 public String getJspName() 24 { 25 return "DISPL-237.jsp"; 26 } 27 28 33 public void doTest(String jspName) throws Exception 34 { 35 WebRequest request = new GetMethodWebRequest(jspName); 36 37 WebResponse response = runner.getResponse(request); 38 39 if (log.isDebugEnabled()) 40 { 41 log.debug(response.getText()); 42 } 43 44 WebTable[] tables = response.getTables(); 45 assertEquals("Wrong number of tables", 1, tables.length); 46 47 WebLink[] links = response.getLinks(); 48 assertEquals("Wrong number of links", 6, links.length); 50 response = links[3].click(); response = links[4].click(); 53 response.getTables(); 54 assertEquals("Wrong number of tables", 1, tables.length); 55 56 links = response.getLinks(); 57 assertEquals("Wrong number of links", 6, links.length); 59 response = links[0].click(); 61 response.getTables(); 62 assertEquals("Wrong number of tables", 1, tables.length); 63 64 links = response.getLinks(); 65 assertEquals("Wrong number of links", 6, links.length); 67 response = links[3].click(); response = links[4].click(); 70 } 71 72 } | Popular Tags |