KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > ruby > RDocFormatterTest


1 /*
2  * RDocFormatterTest.java
3  * JUnit based test
4  *
5  * Created on March 9, 2007, 12:18 PM
6  */

7
8 package org.netbeans.modules.ruby;
9
10 import junit.framework.TestCase;
11
12 /**
13  *
14  * @author tor
15  */

16 public class RDocFormatterTest extends TestCase {
17     
18     public RDocFormatterTest(String JavaDoc testName) {
19         super(testName);
20     }
21     
22     protected void setUp() throws Exception JavaDoc {
23         super.setUp();
24     }
25
26     protected void tearDown() throws Exception JavaDoc {
27         super.tearDown();
28     }
29
30     public void testToHtml() {
31         RDocFormatter instance = new RDocFormatter();
32
33         instance.appendLine(" # Following does not work:<BR>\n");
34         instance.appendLine(" # test _italic_<BR>\n");
35         instance.appendLine(" # test *bold*<BR>\n");
36         instance.appendLine(" # <P>\n");
37         instance.appendLine(" # Folowing does:<BR>\n");
38         instance.appendLine(" # test +typewriter+<BR>\n");
39         instance.appendLine(" # test <em>italic_html</em><BR>\n");
40         instance.appendLine(" # test <b>bold_html</b><BR>\n");
41         instance.appendLine(" # test <tt>typewriter_html</tt><BR>\n");
42
43         String JavaDoc expected = "<pre>\n" +
44 " # Following does not work:<BR>\n" +
45 "<br> # test <i>italic</i><BR>\n" +
46 "<br> # test <b>bold</b><BR>\n" +
47 "<br> # <P>\n" +
48 "<br> # Folowing does:<BR>\n" +
49 "<br> # test <tt>typewriter</tt><BR>\n" +
50 "<br> # test <em>italic_html</em><BR>\n" +
51 "<br> # test <b>bold_html</b><BR>\n" +
52 "<br> # test <tt>typewriter_html</tt><BR>\n" +
53 "<br></pre>\n";
54         
55         String JavaDoc html = instance.toHtml();
56         assertEquals(expected, html);
57     }
58
59     // TODO test bullets, labels, preformat
60
}
61
Popular Tags