01: package test.net.sourceforge.pmd.ast;
02:
03: import static org.junit.Assert.assertEquals;
04: import net.sourceforge.pmd.ast.ASTMethodDeclaration;
05: import net.sourceforge.pmd.ast.ASTMethodDeclarator;
06:
07: import org.junit.Test;
08:
09: public class ASTMethodDeclarationTest {
10:
11: @Test
12: public void testGetVariableName() {
13: int id = 0;
14:
15: ASTMethodDeclaration md = new ASTMethodDeclaration(id++);
16: ASTMethodDeclarator de = new ASTMethodDeclarator(id++);
17: de.setImage("foo");
18: md.jjtAddChild(de, 0);
19:
20: assertEquals("foo", md.getMethodName());
21: }
22:
23: public static junit.framework.Test suite() {
24: return new junit.framework.JUnit4TestAdapter(
25: ASTMethodDeclarationTest.class);
26: }
27: }
|