📄 imagefinderfunctiontest.java
字号:
/** * BSD-style license; for more info see http://pmd.sourceforge.net/license.html*/package test.net.sourceforge.pmd.symboltable;import junit.framework.TestCase;import net.sourceforge.pmd.ast.ASTVariableDeclaratorId;import net.sourceforge.pmd.symboltable.ImageFinderFunction;import net.sourceforge.pmd.symboltable.NameDeclaration;import net.sourceforge.pmd.symboltable.VariableNameDeclaration;import java.util.ArrayList;import java.util.List;public class ImageFinderFunctionTest extends TestCase { public void testSingleImage() { ImageFinderFunction f = new ImageFinderFunction("foo"); ASTVariableDeclaratorId node = new ASTVariableDeclaratorId(1); node.setImage("foo"); NameDeclaration decl = new VariableNameDeclaration(node); f.applyTo(decl); assertEquals(decl, f.getDecl()); } public void testSeveralImages() { List imgs = new ArrayList(); imgs.add("Foo.foo"); imgs.add("foo"); ImageFinderFunction f = new ImageFinderFunction(imgs); ASTVariableDeclaratorId node = new ASTVariableDeclaratorId(1); node.setImage("foo"); NameDeclaration decl = new VariableNameDeclaration(node); f.applyTo(decl); assertEquals(decl, f.getDecl()); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -