KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > openedit > generators > WikiTest


1 /*
2  * Created on Mar 30, 2006
3  */

4 package com.openedit.generators;
5
6 import com.openedit.BaseTestCase;
7
8 public class WikiTest extends BaseTestCase
9 {
10     public WikiTest(String JavaDoc inName)
11     {
12         super( inName);
13     }
14     
15     public void testParse() throws Exception JavaDoc
16     {
17         WikiGenerator gen = new WikiGenerator();
18         gen.setPageManager(getFixture().getPageManager());
19         gen.setName("wiki");
20         
21         String JavaDoc res = gen.parseWiki("the [cat in] the hat", "/somedir/");
22         String JavaDoc correct = "the <a HREF=\"cat_in.html\">cat in*</a> the hat";
23         assertEquals(res,correct);
24         
25         res = gen.parseWiki("link: [http://somelink.html] the hat", "/somedir/");
26         correct = "link: <a HREF=\"http://somelink.html\">http://somelink.html</a> the hat";
27         assertEquals(res,correct);
28         
29     }
30 }
31
Popular Tags