]> source.dussan.org Git - aspectj.git/commitdiff
164356: test and fix: ajdoc
authoraclement <aclement>
Thu, 20 Mar 2008 00:12:46 +0000 (00:12 +0000)
committeraclement <aclement>
Thu, 20 Mar 2008 00:12:46 +0000 (00:12 +0000)
ajdoc/testdata/pr164356/C.java [new file with mode: 0644]
ajdoc/testsrc/org/aspectj/tools/ajdoc/BugTests.java

diff --git a/ajdoc/testdata/pr164356/C.java b/ajdoc/testdata/pr164356/C.java
new file mode 100644 (file)
index 0000000..cb3891e
--- /dev/null
@@ -0,0 +1,21 @@
+public class C {
+
+    // foo's ordinary comment
+    /**
+     * description of foo
+     */
+    public void foo() {
+    }
+
+    //************
+    /**
+     * description of bar
+     */
+    public void bar() {
+    }
+    
+    //******* description of goo
+    public void goo() {
+    }
+
+}
index eeb8f141a48306c4789d4ee574bfb5bc353796eb..4db3c19f5f7e3d5bbef1f5be766da46caa06a1b1 100644 (file)
@@ -130,4 +130,30 @@ public class BugTests extends AjdocTestCase {
                assertTrue("expected build of project to abort",Main.hasAborted());             
        }
        
+       /**
+        * javadoc comments should still appear even if preceded by 
+        * 'normal' comments
+        */
+       public void testPr164356() throws Exception {
+               initialiseProject("pr164356");
+               File[] files = {new File(getAbsoluteProjectDir() + "/C.java")};
+               runAjdoc(files);
+           File htmlFile = new File(getAbsolutePathOutdir() + "/C.html");
+               if (htmlFile == null || !htmlFile.exists()) {
+                       fail("couldn't find " + htmlFile.getAbsolutePath() + 
+                                       " (ajc aborted: " + Main.hasAborted() + ")");
+               }
+               String foo = "description of foo";
+               String bar = "description of bar";
+               String goo = "description of goo";
+               assertTrue("expected method description 'description of foo' to appear" +
+                               " in ajdoc output but it did not", 
+                               AjdocOutputChecker.containsString(htmlFile, foo));
+               assertTrue("expected method description 'description of bar' to " +
+                               "appear in ajdoc output but it did not", 
+                               AjdocOutputChecker.containsString(htmlFile, bar));
+               assertFalse("didn't expect method description 'description of goo' to " +
+                               "appear in ajdoc output but it did not", 
+                               AjdocOutputChecker.containsString(htmlFile, goo));
+       }
 }