01: package test.net.sourceforge.pmd.ast;
02:
03: import static org.junit.Assert.assertFalse;
04: import static org.junit.Assert.assertTrue;
05: import net.sourceforge.pmd.ast.ASTAllocationExpression;
06: import net.sourceforge.pmd.ast.ASTAssertStatement;
07: import net.sourceforge.pmd.ast.ASTBlockStatement;
08:
09: import org.junit.Test;
10:
11: import test.net.sourceforge.pmd.testframework.ParserTst;
12:
13: public class ASTBlockStatementTest extends ParserTst {
14:
15: @Test
16: public void testIsAllocation() {
17: ASTBlockStatement bs = new ASTBlockStatement(0);
18: bs.jjtAddChild(new ASTAllocationExpression(1), 0);
19: assertTrue(bs.isAllocation());
20: }
21:
22: @Test
23: public void testIsAllocation2() {
24: ASTBlockStatement bs = new ASTBlockStatement(0);
25: bs.jjtAddChild(new ASTAssertStatement(1), 0);
26: assertFalse(bs.isAllocation());
27: }
28:
29: public static junit.framework.Test suite() {
30: return new junit.framework.JUnit4TestAdapter(
31: ASTBlockStatementTest.class);
32: }
33: }
|