KickJava   Java API By Example, From Geeks To Geeks.

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


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 /**
12  * Tests for DISPL-4 - Html tags in "title" attribute when using maxLength.
13  * @author Fabrizio Giustina
14  * @version $Revision: 876 $ ($Author: fgiust $)
15  */

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

22     public String JavaDoc getJspName()
23     {
24         return "DISPL-004.jsp";
25     }
26
27     /**
28      * Check the content of the title attribute.
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         WebResponse response = runner.getResponse(request);
36
37         WebTable[] tables = response.getTables();
38         assertEquals("Expected 1 table in result.", 1, tables.length);
39         assertEquals("Wrong title in column", "\"the link\" is here", tables[0].getTableCell(1, 0).getTitle());
40     }
41
42 }
Popular Tags