View Javadoc

1   /**
2    * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
3    */
4   package net.sourceforge.pmd.dfa;
5   
6   import net.sourceforge.pmd.PMD;
7   import net.sourceforge.pmd.lang.dfa.pathfinder.CurrentPath;
8   import net.sourceforge.pmd.lang.dfa.pathfinder.DAAPathFinder;
9   import net.sourceforge.pmd.lang.dfa.pathfinder.Executable;
10  import net.sourceforge.pmd.lang.java.ast.ASTMethodDeclarator;
11  import net.sourceforge.pmd.testframework.ParserTst;
12  
13  import org.junit.Test;
14  
15  public class DAAPathFinderTest extends ParserTst implements Executable {
16  
17      @Test
18      public void testTwoUpdateDefs() throws Throwable {
19          ASTMethodDeclarator meth = getOrderedNodes(ASTMethodDeclarator.class, TWO_UPDATE_DEFS).get(0);
20          DAAPathFinder a = new DAAPathFinder(meth.getDataFlowNode().getFlow().get(0), this);
21  //        a.run();
22      }
23  
24      public void execute(CurrentPath path) {
25      }
26  
27  
28      private static final String TWO_UPDATE_DEFS =
29              "class Foo {" + PMD.EOL +
30              " void bar(int x) {" + PMD.EOL +
31              "  for (int i=0; i<10; i++, j--) {}" + PMD.EOL +
32              " }" + PMD.EOL +
33              "}";
34  
35      public static junit.framework.Test suite() {
36          return new junit.framework.JUnit4TestAdapter(DAAPathFinderTest.class);
37      }
38  }