From b604f27b616fe8679a28fe2f5daed62f8f22159c Mon Sep 17 00:00:00 2001 From: aclement Date: Tue, 6 Jan 2009 22:07:16 +0000 Subject: [PATCH] 258206: package declaration support in the model --- .../tools/MultiProjectIncrementalTests.java | 44 ++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java b/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java index 207a924bf..639b54ec0 100644 --- a/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java +++ b/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java @@ -247,6 +247,35 @@ public class MultiProjectIncrementalTests extends AbstractMultiProjectIncrementa // incomplete } + /** + * Test what is in the model for package declarations and import statements. Package Declaration nodes are new + * in AspectJ 1.6.4. Import statements are contained with an 'import references' node. + */ + public void testImportHandles() { + String p = "Imports"; + initialiseProject(p); + build(p); + + IProgramElement root = getModelFor(p).getHierarchy().getRoot(); + + // Looking for 'package p.q' + IProgramElement ipe = findElementAtLine(root, 1); + ipe = (IProgramElement)ipe.getChildren().get(0); // package decl is first entry in the type + System.out.println(ipe.getHandleIdentifier()+" "+ipe.getKind()); + assertEquals(IProgramElement.Kind.PACKAGE_DECLARATION, ipe.getKind()); + assertEquals("=Imports