KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > displaytag > jsptests > Displ147Test


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
10
11 /**
12  * Test for DISPL-147.
13  * @author Fabrizio Giustina
14  * @version $Revision: 770 $ ($Author: fgiust $)
15  */

16 public class Displ147Test extends DisplaytagCase
17 {
18
19     /**
20      * @see org.displaytag.test.DisplaytagCase#getJspName()
21      */

22     public String JavaDoc getJspName()
23     {
24         return "DISPL-147.jsp";
25     }
26
27     /**
28      * Test link generated using column attributes.
29      * @param jspName jsp name, with full path
30      * @throws Exception any axception thrown during test.
31      */

32     public void doTest(String JavaDoc jspName) throws Exception JavaDoc
33     {
34         WebRequest request = new GetMethodWebRequest(jspName);
35
36         WebResponse response = runner.getResponse(request);
37         if (log.isDebugEnabled())
38         {
39             log.debug(response.getText());
40         }
41
42         WebLink[] links = response.getLinks();
43         assertEquals("Wrong number of links in result.", 1, links.length);
44
45         assertEquals("Link text is wrong.", "/context/dynlink?param=Raja%26Siva", links[0].getURLString());
46     }
47
48 }
Popular Tags