View Javadoc

    1   package net.sourceforge.pmd.dfa;
    2
    3   import static org.junit.Assert.assertEquals;
    4   import net.sourceforge.pmd.lang.Language;
    5   import net.sourceforge.pmd.lang.ast.Node;
    6   import net.sourceforge.pmd.lang.dfa.Structure;
    7   import net.sourceforge.pmd.lang.java.ast.ASTMethodDeclaration;
    8
    9   import org.junit.Test;
    10
    11  public class StructureTest {
    12
    13      @Test
    14      public void testAddResultsinDFANodeContainingAddedNode() {
    15          Structure s = new Structure(Language.JAVA.getDefaultVersion().getLanguageVersionHandler().getDataFlowHandler());
    16          Node n = new ASTMethodDeclaration(1);
    17          assertEquals(n, s.createNewNode(n).getNode());
    18      }
    19
    20      public static junit.framework.Test suite() {
    21          return new junit.framework.JUnit4TestAdapter(StructureTest.class);
    22      }
    23  }