KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > portlet > test > forums > AnonymousUserTestCase


1 /*****************************************
2  * *
3  * JBoss Portal: The OpenSource Portal *
4  * *
5  * Forums JBoss Portlet *
6  * *
7  * Distributable under GPL license. *
8  * See terms of license at gnu.org. *
9  * *
10  *****************************************/

11 package org.jboss.portlet.test.forums;
12
13 import net.sourceforge.jwebunit.WebTestCase;
14
15 /**
16  * @author <a HREF="mailto:theute@jboss.org">Thomas Heute</a>
17  * @version $Revision: 1.1 $
18  */

19 public class AnonymousUserTestCase
20    extends WebTestCase
21 {
22    public AnonymousUserTestCase(String JavaDoc name) {
23       super(name);
24       getTestContext().setBaseUrl("http://localhost.localdomain:8080/portal");
25 // getTestContext().setUserAgent("Mozilla");
26
}
27    
28    public void testReadIndex()
29    {
30       beginAt("/index.html?_id=page.default.forums");
31       assertTextPresent("Dummy demo category");
32       assertTextPresent("First forum");
33       assertTextPresent("Second forum");
34    }
35
36    public void testReadForum()
37    {
38       beginAt("/index.html?_id=page.default.forums");
39       clickLinkWithText("First forum");
40       assertTextPresent("First forum");
41       assertTextPresent("Page <b>1</b>");
42       assertLinkNotPresent("newTopic");
43    }
44
45
46 }
47
Popular Tags