diff options
author | mkersten <mkersten> | 2003-02-18 09:23:58 +0000 |
---|---|---|
committer | mkersten <mkersten> | 2003-02-18 09:23:58 +0000 |
commit | 32a7e80fac54b553e98e5049e9f9f5b8bb765a60 (patch) | |
tree | 001112385a72b41c9751f2625ea8bab93b582304 /ajde/testsrc/org/aspectj | |
parent | ab6b18d68794cfee99eaf1f2a914c501eb596f9d (diff) | |
download | aspectj-32a7e80fac54b553e98e5049e9f9f5b8bb765a60.tar.gz aspectj-32a7e80fac54b553e98e5049e9f9f5b8bb765a60.zip |
Fixed source line mapping errors.
Fixed formatting of pointcuts.
Added a few more tests for above.
Diffstat (limited to 'ajde/testsrc/org/aspectj')
-rw-r--r-- | ajde/testsrc/org/aspectj/ajde/StructureModelTest.java | 22 |
1 files changed, 22 insertions, 0 deletions
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( |