01: package net.sourceforge.jaxor.parser.tests;
02:
03: import com.thoughtworks.qdox.model.JavaClass;
04: import com.thoughtworks.qdox.model.JavaMethod;
05: import com.thoughtworks.qdox.model.Type;
06: import junit.framework.TestCase;
07: import net.sourceforge.jaxor.parser.SourceClass;
08:
09: import java.util.List;
10:
11: /*
12: * User: Mike
13: * Date: Aug 12, 2003
14: * Time: 10:35:41 PM
15: */
16:
17: public class SourceClassTest extends TestCase {
18:
19: public void testParsing() {
20: JavaClass j = new JavaClass(null);
21: JavaMethod method = new JavaMethod();
22: method.setName("myMethod");
23: method.setModifiers(new String[] { "public" });
24: Type type = new Type("Long");
25: method.setReturns(type);
26: method.setExceptions(new Type[] { new Type("Exception") });
27: j.addMethod(method);
28: SourceClass source = new SourceClass(j);
29: List list = source.getImplMethods();
30: assertEquals(1, list.size());
31:
32: assertEquals("public Long myMethod()throws Exception;", list
33: .get(0));
34: }
35: }
|