From: jhugunin Date: Thu, 8 May 2003 19:02:14 +0000 (+0000) Subject: fixed testFileNodeFind that would always pass to be more strict X-Git-Tag: V1_1_0_RC2~28 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=dd62db936c6a9c22f04d4e1bc754b1f6bc15b64a;p=aspectj.git fixed testFileNodeFind that would always pass to be more strict and then fixed the file it was operating on to be correct --- diff --git a/ajde/testsrc/org/aspectj/ajde/StructureModelTest.java b/ajde/testsrc/org/aspectj/ajde/StructureModelTest.java index 11babe0c5..23cfe4ffa 100644 --- a/ajde/testsrc/org/aspectj/ajde/StructureModelTest.java +++ b/ajde/testsrc/org/aspectj/ajde/StructureModelTest.java @@ -92,8 +92,10 @@ public class StructureModelTest extends AjdeTestCase { public void testPointcutName() throws IOException { File testFile = createFile("figures-coverage/figures/Main.java"); + //System.err.println("PointcutName, testFile: " + testFile.getCanonicalPath() + " exists: " + testFile.exists()); StructureNode node = Ajde.getDefault().getStructureModelManager().getStructureModel().findRootNodeForSourceFile( testFile.getCanonicalPath()); + //System.err.println(" node: " + node); assertTrue("find result", node != null) ; ProgramElementNode pNode = (ProgramElementNode)((ProgramElementNode)node).getChildren().get(1); ProgramElementNode pointcut = (ProgramElementNode)pNode.getChildren().get(0); @@ -103,10 +105,13 @@ public class StructureModelTest extends AjdeTestCase { } public void testFileNodeFind() throws IOException { - File testFile = createFile("testdata/examples/figures-coverage/figures/Main.java"); + File testFile = createFile("figures-coverage/figures/Main.java"); + //System.err.println("NodeFind, testFile: " + testFile.getCanonicalPath() + " exists: " + testFile.exists()); StructureNode node = Ajde.getDefault().getStructureModelManager().getStructureModel().findNodeForSourceLine( testFile.getCanonicalPath(), 1); + //System.err.println(" node: " + node); assertTrue("find result", node != null) ; + assertEquals("find result has children", 2, node.getChildren().size()) ; ProgramElementNode pNode = (ProgramElementNode)node; assertTrue("found node: " + pNode.getName(), pNode.getProgramElementKind().equals(ProgramElementNode.Kind.FILE_JAVA)); }