1 package net.sourceforge.pmd.lang.java.ast;
2
3 import static org.junit.Assert.assertFalse;
4 import static org.junit.Assert.assertTrue;
5 import net.sourceforge.pmd.lang.java.ParserTst;
6
7 import org.junit.Test;
8
9
10 public class ASTBlockStatementTest extends ParserTst {
11
12 @Test
13 public void testIsAllocation() {
14 ASTBlockStatement bs = new ASTBlockStatement(0);
15 bs.jjtAddChild(new ASTAllocationExpression(1), 0);
16 assertTrue(bs.isAllocation());
17 }
18
19 @Test
20 public void testIsAllocation2() {
21 ASTBlockStatement bs = new ASTBlockStatement(0);
22 bs.jjtAddChild(new ASTAssertStatement(1), 0);
23 assertFalse(bs.isAllocation());
24 }
25
26 public static junit.framework.Test suite() {
27 return new junit.framework.JUnit4TestAdapter(ASTBlockStatementTest.class);
28 }
29 }