01: /**
02: * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE, version 2.1, dated February 1999.
03: *
04: * This program is free software; you can redistribute it and/or modify
05: * it under the terms of the latest version of the GNU Lesser General
06: * Public License as published by the Free Software Foundation;
07: *
08: * This program is distributed in the hope that it will be useful,
09: * but WITHOUT ANY WARRANTY; without even the implied warranty of
10: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11: * GNU Lesser General Public License for more details.
12: *
13: * You should have received a copy of the GNU Lesser General Public License
14: * along with this program (LICENSE.txt); if not, write to the Free Software
15: * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
16: *
17: * Based on code generated by Agitar build: Agitator Version 1.0.2.000071 (Build date: Jan 12, 2007) [1.0.2.000071]
18: */package org.jamwiki.servlets;
19:
20: import junit.framework.TestCase;
21:
22: public class WikiPageInfoTest extends TestCase {
23:
24: /**
25: *
26: */
27: public void testGetNamespace() {
28: WikiPageInfo p = new WikiPageInfo();
29: assertEquals(p.getTopicName(), "", p.getTopicName());
30: p.setTopicName("Main");
31: assertEquals("", p.getNamespace());
32: p.setTopicName("User:FooBar");
33: assertEquals("User", p.getNamespace());
34: p.setTopicName("Special:Contributions");
35: p.setSpecial(true);
36: assertEquals("Special", p.getNamespace());
37: }
38:
39: /**
40: *
41: */
42: public void testGetPagename() {
43: WikiPageInfo p = new WikiPageInfo();
44: assertEquals(p.getTopicName(), "", p.getPagename());
45: p.setTopicName("Main");
46: assertEquals("Main", p.getPagename());
47: p.setTopicName("User:FooBar");
48: assertEquals("FooBar", p.getPagename());
49: p.setTopicName("Special:Contributions");
50: p.setSpecial(true);
51: assertEquals("Contributions", p.getPagename());
52: }
53: }
|