01: package com.ecyrd.jspwiki.plugin;
02:
03: import java.util.Properties;
04:
05: import junit.framework.Test;
06: import junit.framework.TestCase;
07: import junit.framework.TestSuite;
08:
09: import com.ecyrd.jspwiki.TestEngine;
10:
11: public class GroupsTest extends TestCase {
12: Properties props = new Properties();
13: TestEngine testEngine;
14:
15: public GroupsTest(String s) {
16: super (s);
17: }
18:
19: public void setUp() throws Exception {
20: props.load(TestEngine.findTestProperties());
21:
22: testEngine = new TestEngine(props);
23: }
24:
25: public void tearDown() throws Exception {
26: super .tearDown();
27:
28: testEngine.deletePage("Test");
29: }
30:
31: public void testTag() throws Exception {
32: String src = "[{Groups}]";
33:
34: testEngine.saveText("Test", src);
35:
36: String res = testEngine.getHTML("Test");
37:
38: assertEquals(
39: "<a href=\"/Group.jsp?group=Admin\">Admin</a>, "
40: + "<a href=\"/Group.jsp?group=Art\">Art</a>, "
41: + "<a href=\"/Group.jsp?group=Literature\">Literature</a>, "
42: + "<a href=\"/Group.jsp?group=TV\">TV</a>\n",
43: res);
44: }
45:
46: public static Test suite() {
47: return new TestSuite(GroupsTest.class);
48: }
49: }
|