use of net.sourceforge.pmd.lang.plsql.ast.ASTVariableOrConstantDeclarator in project pmd by pmd.
the class StatementAndBraceFinderTest method testVariableOrConstantDeclaratorParentChildLinks.
@Test
public void testVariableOrConstantDeclaratorParentChildLinks() {
ASTVariableOrConstantDeclarator vd = getOrderedNodes(ASTVariableOrConstantDeclarator.class, TEST2).get(0);
// ASTMethodDeclaration vdParent = (ASTMethodDeclaration)
// ((DataFlowNode) vd.getDataFlowNode().getParents().get(0)).getNode();
ASTProgramUnit vdParent = (ASTProgramUnit) vd.getDataFlowNode().getParents().get(0).getNode();
// Validate the two-way link between Program Unit and Variable
assertEquals(vd, vdParent.getDataFlowNode().getChildren().get(0).getNode());
assertEquals(vdParent, vd.getDataFlowNode().getParents().get(0).getNode());
}
Aggregations