View Javadoc
1   package net.sourceforge.pmd.lang.java.ast;
2   
3   import net.sourceforge.pmd.PMD;
4   import net.sourceforge.pmd.lang.java.ParserTst;
5   
6   import org.junit.Test;
7   
8   
9   public class ASTInitializerTest extends ParserTst {
10  
11      @Test
12      public void testDontCrashOnBlockStatement() throws Throwable {
13          getNodes(ASTInitializer.class, TEST1);
14      }
15  
16      private static final String TEST1 =
17              "public class Foo {" + PMD.EOL +
18              " {" + PMD.EOL +
19              "   x = 5;" + PMD.EOL +
20              " }" + PMD.EOL +
21              "}";
22  
23      public static junit.framework.Test suite() {
24          return new junit.framework.JUnit4TestAdapter(ASTInitializerTest.class);
25      }
26  }