01: package test.net.sourceforge.pmd.dfa;
02:
03: import org.junit.Test;
04:
05: import net.sourceforge.pmd.PMD;
06: import net.sourceforge.pmd.ast.ASTMethodDeclarator;
07: import net.sourceforge.pmd.dfa.pathfinder.CurrentPath;
08: import net.sourceforge.pmd.dfa.pathfinder.DAAPathFinder;
09: import net.sourceforge.pmd.dfa.pathfinder.Executable;
10: import test.net.sourceforge.pmd.testframework.ParserTst;
11:
12: public class DAAPathFinderTest extends ParserTst implements Executable {
13:
14: @Test
15: public void testTwoUpdateDefs() throws Throwable {
16: ASTMethodDeclarator meth = getOrderedNodes(
17: ASTMethodDeclarator.class, TWO_UPDATE_DEFS).get(0);
18: DAAPathFinder a = new DAAPathFinder(meth.getDataFlowNode()
19: .getFlow().get(0), this );
20: // a.run();
21: }
22:
23: public void execute(CurrentPath path) {
24: }
25:
26: private static final String TWO_UPDATE_DEFS = "class Foo {"
27: + PMD.EOL + " void bar(int x) {" + PMD.EOL
28: + " for (int i=0; i<10; i++, j--) {}" + PMD.EOL + " }"
29: + PMD.EOL + "}";
30:
31: public static junit.framework.Test suite() {
32: return new junit.framework.JUnit4TestAdapter(
33: DAAPathFinderTest.class);
34: }
35: }
|