1 package net.sourceforge.pmd.lang.java.ast; 2 3 import static org.junit.Assert.assertEquals; 4 5 import org.junit.Test; 6 7 public class ASTMethodDeclarationTest { 8 9 @Test 10 public void testGetVariableName() { 11 int id = 0; 12 13 ASTMethodDeclaration md = new ASTMethodDeclaration(id++); 14 ASTMethodDeclarator de = new ASTMethodDeclarator(id++); 15 de.setImage("foo"); 16 md.jjtAddChild(de, 0); 17 18 assertEquals("foo", md.getMethodName()); 19 } 20 21 public static junit.framework.Test suite() { 22 return new junit.framework.JUnit4TestAdapter(ASTMethodDeclarationTest.class); 23 } 24 }