1 package net.sourceforge.pmd.dfa;
2
3 import org.junit.Test;
4
5 import net.sourceforge.pmd.PMD;
6 import net.sourceforge.pmd.lang.dfa.pathfinder.CurrentPath;
7 import net.sourceforge.pmd.lang.dfa.pathfinder.DAAPathFinder;
8 import net.sourceforge.pmd.lang.dfa.pathfinder.Executable;
9 import net.sourceforge.pmd.lang.java.ast.ASTMethodDeclarator;
10 import 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(ASTMethodDeclarator.class, TWO_UPDATE_DEFS).get(0);
17 DAAPathFinder a = new DAAPathFinder(meth.getDataFlowNode().getFlow().get(0), this);
18
19 }
20
21 public void execute(CurrentPath path) {
22 }
23
24
25 private static final String TWO_UPDATE_DEFS =
26 "class Foo {" + PMD.EOL +
27 " void bar(int x) {" + PMD.EOL +
28 " for (int i=0; i<10; i++, j--) {}" + PMD.EOL +
29 " }" + PMD.EOL +
30 "}";
31
32 public static junit.framework.Test suite() {
33 return new junit.framework.JUnit4TestAdapter(DAAPathFinderTest.class);
34 }
35 }