]> source.dussan.org Git - aspectj.git/commitdiff
164340: ajdoc fix and test
authoraclement <aclement>
Wed, 11 Jun 2008 17:24:42 +0000 (17:24 +0000)
committeraclement <aclement>
Wed, 11 Jun 2008 17:24:42 +0000 (17:24 +0000)
ajdoc/testdata/pr164340/C.java [new file with mode: 0644]
ajdoc/testsrc/org/aspectj/tools/ajdoc/BugTests.java

diff --git a/ajdoc/testdata/pr164340/C.java b/ajdoc/testdata/pr164340/C.java
new file mode 100644 (file)
index 0000000..482dbf4
--- /dev/null
@@ -0,0 +1,15 @@
+public class C {
+
+       /**
+        * This is a constructor
+        */
+       public C() {
+       }
+
+       /**
+        * This is method foo
+        */
+       public void foo() {
+       }
+
+}
index 4db3c19f5f7e3d5bbef1f5be766da46caa06a1b1..c1749875fa0790ddff4e5e52bb13b5deca3aea75 100644 (file)
@@ -156,4 +156,26 @@ public class BugTests extends AjdocTestCase {
                                "appear in ajdoc output but it did not", 
                                AjdocOutputChecker.containsString(htmlFile, goo));
        }
+       
+       /**
+        * Comments for a constructor should be included in the ajdoc output
+        */
+       public void testPr164340() throws Exception {
+               initialiseProject("pr164340");
+               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 methodDesc = "This is method foo";
+               String constDesc = "This is a constructor";
+               assertTrue("expected method description 'This is method foo' to appear" +
+                               " in ajdoc output but it did not", 
+                               AjdocOutputChecker.containsString(htmlFile, methodDesc));
+               assertTrue("expected constructor description 'This is a constructor' to " +
+                               "appear in ajdoc output but it did not", 
+                               AjdocOutputChecker.containsString(htmlFile, constDesc));
+       }
 }