KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > roller > presentation > velocity > plugins > textile > TextileTest


1 /*
2  * Created on Oct 31, 2003
3  */

4 package org.roller.presentation.velocity.plugins.textile;
5
6 import junit.framework.Test;
7 import junit.framework.TestCase;
8 import junit.framework.TestSuite;
9
10 import org.roller.presentation.bookmarks.BookmarksActionTest;
11 import org.roller.presentation.velocity.PagePlugin;
12 import org.roller.presentation.velocity.plugins.textile.TextilePlugin;
13
14 /**
15  * We really need to solve webtesting to adequately test our Presentation classes.
16  *
17  * @author lance
18  */

19 public class TextileTest extends TestCase
20 {
21     String JavaDoc textileStr = "*strong* plain _emphasis_ * _emphaticStrong_ * ";
22     String JavaDoc expected = "<p><strong>strong</strong> plain <em>emphasis</em> <strong> <em>emphaticStrong</em> </strong></p>";
23   
24     /*
25      * This fails because Textile4J appears to place a tab (\t)
26      * at the beginning of the result. If the result is .trim()'ed
27      * then it passes.
28      */

29     public void testTextile()
30     {
31         PagePlugin textile = new TextilePlugin();
32         
33         String JavaDoc result = textile.render(textileStr);
34         //System.out.println(expected);
35
//System.out.println(result);
36
assertEquals("this will fail until Textile4J is fixed.", expected, result);
37     }
38     
39     /* (non-Javadoc)
40      * @see junit.framework.TestCase#setUp()
41      */

42     protected void setUp() throws Exception JavaDoc
43     {
44         super.setUp();
45     }
46
47     /* (non-Javadoc)
48      * @see junit.framework.TestCase#tearDown()
49      */

50     protected void tearDown() throws Exception JavaDoc
51     {
52        super.tearDown();
53     }
54
55     public static Test suite()
56     {
57         return new TestSuite(TextileTest.class);
58     }
59
60 }
61
Popular Tags