From 8d7f7e1d4ad5e302b60074db044636817ba4e5a5 Mon Sep 17 00:00:00 2001 From: aclement Date: Wed, 11 Jun 2008 17:24:42 +0000 Subject: [PATCH] 164340: ajdoc fix and test --- ajdoc/testdata/pr164340/C.java | 15 +++++++++++++ .../org/aspectj/tools/ajdoc/BugTests.java | 22 +++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 ajdoc/testdata/pr164340/C.java diff --git a/ajdoc/testdata/pr164340/C.java b/ajdoc/testdata/pr164340/C.java new file mode 100644 index 000000000..482dbf481 --- /dev/null +++ b/ajdoc/testdata/pr164340/C.java @@ -0,0 +1,15 @@ +public class C { + + /** + * This is a constructor + */ + public C() { + } + + /** + * This is method foo + */ + public void foo() { + } + +} diff --git a/ajdoc/testsrc/org/aspectj/tools/ajdoc/BugTests.java b/ajdoc/testsrc/org/aspectj/tools/ajdoc/BugTests.java index 4db3c19f5..c1749875f 100644 --- a/ajdoc/testsrc/org/aspectj/tools/ajdoc/BugTests.java +++ b/ajdoc/testsrc/org/aspectj/tools/ajdoc/BugTests.java @@ -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)); + } } -- 2.39.5