View Javadoc

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