From f6debc480abf456cab312a3538bb8c9430f9d6e2 Mon Sep 17 00:00:00 2001 From: aclement Date: Tue, 6 Jan 2009 22:05:57 +0000 Subject: [PATCH] 258206: package declaration support in the model --- .../aspectj/ajde/core/tests/model/StructureModelTests.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ajde.core/testsrc/org/aspectj/ajde/core/tests/model/StructureModelTests.java b/ajde.core/testsrc/org/aspectj/ajde/core/tests/model/StructureModelTests.java index f2980e141..249b9615a 100644 --- a/ajde.core/testsrc/org/aspectj/ajde/core/tests/model/StructureModelTests.java +++ b/ajde.core/testsrc/org/aspectj/ajde/core/tests/model/StructureModelTests.java @@ -56,7 +56,7 @@ public class StructureModelTests extends AjdeCoreTestCase { File testFile = openFile("figures" + File.separator + "Figure.java"); IProgramElement node = manager.getHierarchy().findElementForSourceFile(testFile.getAbsolutePath()); assertTrue("find result", node != null); - String child = ((IProgramElement) node.getChildren().get(1)).getName(); + String child = ((IProgramElement) node.getChildren().get(2)).getName(); assertTrue("expected Figure got child " + child, child.equals("Figure")); } @@ -64,7 +64,8 @@ public class StructureModelTests extends AjdeCoreTestCase { File testFile = openFile("figures" + File.separator + "Main.java"); IProgramElement node = manager.getHierarchy().findElementForSourceFile(testFile.getAbsolutePath()); assertTrue("find result", node != null); - IProgramElement pNode = (IProgramElement) (node).getChildren().get(2); + IProgramElement pNode = (IProgramElement) (node).getChildren().get(3); + assertEquals(IProgramElement.Kind.ASPECT,pNode.getKind()); IProgramElement pointcut = (IProgramElement) pNode.getChildren().get(0); assertTrue("kind", pointcut.getKind().equals(IProgramElement.Kind.POINTCUT)); assertTrue("found node: " + pointcut.getName(), pointcut.toLabelString().equals("testptct()")); @@ -78,7 +79,7 @@ public class StructureModelTests extends AjdeCoreTestCase { IProgramElement node = manager.getHierarchy().findElementForSourceLine(testFile.getAbsolutePath(), 1); assertTrue("find result", node != null); - assertEquals("find result has children", 3, node.getChildren().size()); + assertEquals("find result has children", 4, node.getChildren().size()); // package, import and 2 types assertTrue("found node: " + node.getName(), node.getKind().equals(IProgramElement.Kind.FILE_JAVA)); } -- 2.39.5