use of net.sourceforge.pmd.lang.java.ast.ASTMethodDeclarator in project pmd by pmd.
the class DAAPathFinderTest method testTwoUpdateDefs.
@Test
public void testTwoUpdateDefs() {
ASTMethodDeclarator meth = getOrderedNodes(ASTMethodDeclarator.class, TWO_UPDATE_DEFS).get(0);
DAAPathFinder a = new DAAPathFinder(meth.getDataFlowNode().getFlow().get(0), this);
// a.run();
}
use of net.sourceforge.pmd.lang.java.ast.ASTMethodDeclarator in project pmd by pmd.
the class GeneralFiddlingTest method test1.
@Test
public void test1() {
ASTCompilationUnit acu = buildDFA(TEST1);
ASTMethodDeclarator meth = acu.findDescendantsOfType(ASTMethodDeclarator.class).get(0);
DataFlowNode n = meth.getDataFlowNode();
List<DataFlowNode> f = n.getFlow();
assertEquals(6, f.size());
assertEquals("Undefinition(x)", String.valueOf(f.get(0).getVariableAccess().get(0)));
assertEquals(0, f.get(1).getVariableAccess().size());
assertEquals("Definition(x)", String.valueOf(f.get(2).getVariableAccess().get(0)));
assertEquals("Reference(x)", String.valueOf(f.get(3).getVariableAccess().get(0)));
assertEquals("Definition(x)", String.valueOf(f.get(4).getVariableAccess().get(0)));
assertEquals("Undefinition(x)", String.valueOf(f.get(5).getVariableAccess().get(0)));
// for (DataFlowNode dfan : f) {
// System.out.println("Flow starting on line " + dfan.getLine());
// List<VariableAccess> va = dfan.getVariableAccess();
// for (VariableAccess o : va) {
// System.out.println(" variable: " + o);
// }
// }
}
Aggregations