01: package net.sourceforge.jaxor.parser.tests;
02:
03: import junit.framework.TestCase;
04: import net.sourceforge.jaxor.parser.JMethod;
05: import net.sourceforge.jaxor.parser.Javadoc;
06:
07: /*
08: * User: Mike
09: * Date: Oct 21, 2002
10: * Time: 6:47:37 PM
11: */
12:
13: public class JMethodTest extends TestCase {
14: private JMethod _method;
15:
16: protected void setUp() throws Exception {
17: _method = new JMethod();
18: _method.setType("int");
19: _method.setName("getTotal");
20: }
21:
22: public void testMethodSig() {
23: assertEquals("public int getTotal();", _method.getInterface());
24: }
25:
26: public void testJavadoc() {
27: String comments = "/** this is a comment */";
28: Javadoc doc = new Javadoc();
29: doc.addCharacterData(comments);
30: _method.addJavadoc(doc);
31:
32: assertEquals(comments + "\n\tpublic int getTotal();", _method
33: .getInterface());
34: }
35: }
|