]> source.dussan.org Git - aspectj.git/commitdiff
fixed testFileNodeFind that would always pass to be more strict
authorjhugunin <jhugunin>
Thu, 8 May 2003 19:02:14 +0000 (19:02 +0000)
committerjhugunin <jhugunin>
Thu, 8 May 2003 19:02:14 +0000 (19:02 +0000)
  and then fixed the file it was operating on to be correct

ajde/testsrc/org/aspectj/ajde/StructureModelTest.java

index 11babe0c537f515ebd5b782fec2c757835a25763..23cfe4ffac7c77476fb419f4ee2b625a9c47d8b2 100644 (file)
@@ -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));
        }