From 32a7e80fac54b553e98e5049e9f9f5b8bb765a60 Mon Sep 17 00:00:00 2001 From: mkersten Date: Tue, 18 Feb 2003 09:23:58 +0000 Subject: Fixed source line mapping errors. Fixed formatting of pointcuts. Added a few more tests for above. --- .../org/aspectj/ajde/StructureModelTest.java | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'ajde/testsrc') diff --git a/ajde/testsrc/org/aspectj/ajde/StructureModelTest.java b/ajde/testsrc/org/aspectj/ajde/StructureModelTest.java index eb5834dd4..adf926665 100644 --- a/ajde/testsrc/org/aspectj/ajde/StructureModelTest.java +++ b/ajde/testsrc/org/aspectj/ajde/StructureModelTest.java @@ -76,6 +76,28 @@ public class StructureModelTest extends AjdeTestCase { // assertTrue("matches", foundNode.getParent() == fieldNode.getParent()); // } + + public void testRootForSourceFile() throws IOException { + File testFile = createFile("figures-coverage/figures/Figure.java"); + StructureNode node = Ajde.getDefault().getStructureModelManager().getStructureModel().findRootNodeForSourceFile( + testFile.getCanonicalPath()); + assertTrue("find result", node != null) ; + ProgramElementNode pNode = (ProgramElementNode)node; + assertTrue("found child", ((StructureNode)pNode.getChildren().get(0)).getName().equals("Figure")); + } + + public void testPointcutName() throws IOException { + File testFile = createFile("figures-coverage/figures/Main.java"); + StructureNode node = Ajde.getDefault().getStructureModelManager().getStructureModel().findRootNodeForSourceFile( + testFile.getCanonicalPath()); + assertTrue("find result", node != null) ; + ProgramElementNode pNode = (ProgramElementNode)((ProgramElementNode)node).getChildren().get(1); + ProgramElementNode pointcut = (ProgramElementNode)pNode.getChildren().get(0); + assertTrue("kind", pointcut.getProgramElementKind().equals(ProgramElementNode.Kind.POINTCUT)); + assertTrue("found node: " + pointcut.getName(), pointcut.getName().equals("testptct")); + + } + public void testFileNodeFind() throws IOException { File testFile = createFile("testdata/examples/figures-coverage/figures/Main.java"); StructureNode node = Ajde.getDefault().getStructureModelManager().getStructureModel().findNodeForSourceLine( -- cgit v1.2.3