    1   package test.net.sourceforge.pmd.ast;
    2
    3   import net.sourceforge.pmd.ast.ASTAllocationExpression;
    4   import net.sourceforge.pmd.ast.ASTAssertStatement;
    5   import net.sourceforge.pmd.ast.ASTBlockStatement;
    6   import test.net.sourceforge.pmd.testframework.ParserTst;
    7
    8   public class ASTBlockStatementTest extends ParserTst {
    9
    10
    11      public void testIsAllocation() {
    12          ASTBlockStatement bs = new ASTBlockStatement(0);
    13          bs.jjtAddChild(new ASTAllocationExpression(1), 0);
    14          assertTrue(bs.isAllocation());
    15      }
    16
    17      public void testIsAllocation2() {
    18          ASTBlockStatement bs = new ASTBlockStatement(0);
    19          bs.jjtAddChild(new ASTAssertStatement(1), 0);
    20          assertFalse(bs.isAllocation());
    21      }
    22
    23  }