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 static org.junit.Assert.assertEquals;
7   import net.sourceforge.pmd.lang.Language;
8   import net.sourceforge.pmd.lang.ast.Node;
9   import net.sourceforge.pmd.lang.dfa.Structure;
10  import net.sourceforge.pmd.lang.java.ast.ASTMethodDeclaration;
11  
12  import org.junit.Test;
13  
14  public class StructureTest {
15  
16      @Test
17      public void testAddResultsinDFANodeContainingAddedNode() {
18          Structure s = new Structure(Language.JAVA.getDefaultVersion().getLanguageVersionHandler().getDataFlowHandler());
19          Node n = new ASTMethodDeclaration(1);
20          assertEquals(n, s.createNewNode(n).getNode());
21      }
22  
23      public static junit.framework.Test suite() {
24          return new junit.framework.JUnit4TestAdapter(StructureTest.class);
25      }
26  }