diff options
author | Andy Clement <aclement@gopivotal.com> | 2014-08-08 12:58:17 -0700 |
---|---|---|
committer | Andy Clement <aclement@gopivotal.com> | 2014-08-08 12:58:17 -0700 |
commit | 0419c01193d055b77a9ba2ee408a5dcbba4162b0 (patch) | |
tree | 50dfea1aa83997f210cc27b34d82d1249cffa688 /ajdoc/testsrc | |
parent | 44642d61cce6f3fee45699c821b8da38ddfed642 (diff) | |
download | aspectj-0419c01193d055b77a9ba2ee408a5dcbba4162b0.tar.gz aspectj-0419c01193d055b77a9ba2ee408a5dcbba4162b0.zip |
fixing for Javadoc differences in 1.8
Diffstat (limited to 'ajdoc/testsrc')
3 files changed, 52 insertions, 32 deletions
diff --git a/ajdoc/testsrc/org/aspectj/tools/ajdoc/AjdocOutputChecker.java b/ajdoc/testsrc/org/aspectj/tools/ajdoc/AjdocOutputChecker.java index d46b2a4af..10e22fbf6 100644 --- a/ajdoc/testsrc/org/aspectj/tools/ajdoc/AjdocOutputChecker.java +++ b/ajdoc/testsrc/org/aspectj/tools/ajdoc/AjdocOutputChecker.java @@ -207,12 +207,12 @@ public class AjdocOutputChecker { // found the required main section String nextLine = reader.readLine(); while (nextLine != null && (nextLine.indexOf("========") == -1)) { - if (nextLine.indexOf("NAME=\""+source+"\"") != -1) { + if (nextLine.indexOf("NAME=\""+source+"\"") != -1 || nextLine.indexOf("name=\""+source+"\"") != -1) { // found the required subsection String subLine = reader.readLine(); while(subLine != null && (subLine.indexOf("========") == -1) - && (subLine.indexOf("NAME") == -1)) { + && (subLine.indexOf("NAME") == -1 && subLine.indexOf("name") == -1)) { int relIndex = subLine.indexOf(relationship.toString()); int targetIndex = subLine.indexOf(target); if ((relIndex != -1) && (targetIndex != -1)) { diff --git a/ajdoc/testsrc/org/aspectj/tools/ajdoc/CoverageTestCase.java b/ajdoc/testsrc/org/aspectj/tools/ajdoc/CoverageTestCase.java index db36be452..0c0a0f268 100644 --- a/ajdoc/testsrc/org/aspectj/tools/ajdoc/CoverageTestCase.java +++ b/ajdoc/testsrc/org/aspectj/tools/ajdoc/CoverageTestCase.java @@ -14,6 +14,8 @@ import java.io.File; import java.util.List; +import org.aspectj.util.LangUtil; + /** * A long way to go until full coverage, but this is the place to add more. @@ -253,7 +255,7 @@ public class CoverageTestCase extends AjdocTestCase { } String[] strings = { - "setX(int)", + toName("setX(int)"), "HREF=\"../foo/AdvisesRelationshipCoverage.html#before(): methodExecutionP..\""}; boolean b = AjdocOutputChecker.detailSectionContainsRel( htmlFile,"=== METHOD DETAIL", @@ -284,7 +286,7 @@ public class CoverageTestCase extends AjdocTestCase { } String[] strings = { - "Point()", + toName("Point()"), "HREF=\"../foo/AdvisesRelationshipCoverage.html#before(): constructorExecutionP..\""}; boolean b = AjdocOutputChecker.detailSectionContainsRel( htmlFile,"=== CONSTRUCTOR DETAIL", @@ -315,7 +317,7 @@ public class CoverageTestCase extends AjdocTestCase { } String[] strings = { - "changeX(int)", + toName("changeX(int)"), "HREF=\"../foo/AdvisesRelationshipCoverage.html#before(): callMethodP..\""}; boolean b = AjdocOutputChecker.detailSectionContainsRel( htmlFile,"=== METHOD DETAIL", @@ -346,7 +348,7 @@ public class CoverageTestCase extends AjdocTestCase { } String[] strings = { - "doIt()", + toName("doIt()"), "HREF=\"../foo/AdvisesRelationshipCoverage.html#before(): callConstructorP..\""}; boolean b = AjdocOutputChecker.detailSectionContainsRel( htmlFile,"=== METHOD DETAIL", @@ -377,7 +379,7 @@ public class CoverageTestCase extends AjdocTestCase { } String[] strings = { - "getX()", + toName("getX()"), "HREF=\"../foo/AdvisesRelationshipCoverage.html#before(): getP..\""}; boolean b = AjdocOutputChecker.detailSectionContainsRel( htmlFile,"=== METHOD DETAIL", @@ -410,28 +412,28 @@ public class CoverageTestCase extends AjdocTestCase { String href = "HREF=\"../foo/AdvisesRelationshipCoverage.html#before(): setP..\""; boolean b = AjdocOutputChecker.detailSectionContainsRel( htmlFile,"=== METHOD DETAIL", - "setX(int)", + toName("setX(int)"), HtmlDecorator.HtmlRelationshipKind.ADVISED_BY, href); assertTrue("the Method Detail should have setX(int) advised by " + href,b); b = AjdocOutputChecker.summarySectionContainsRel( htmlFile,"=== METHOD SUMMARY", - "setX(int)", + toName("setX(int)"), HtmlDecorator.HtmlRelationshipKind.ADVISED_BY, href); assertTrue("the Method Summary should have setX(int) advised by " + href,b); b = AjdocOutputChecker.detailSectionContainsRel( htmlFile,"=== CONSTRUCTOR DETAIL", - "Point()", + toName("Point()"), HtmlDecorator.HtmlRelationshipKind.ADVISED_BY, href); assertTrue("the Constructor Detail should have advised by " + href,b); b = AjdocOutputChecker.summarySectionContainsRel( htmlFile,"=== CONSTRUCTOR SUMMARY", - "Point()", + toName("Point()"), HtmlDecorator.HtmlRelationshipKind.ADVISED_BY, href); assertTrue("the Constructor Summary should have advised by " + href,b); @@ -457,7 +459,7 @@ public class CoverageTestCase extends AjdocTestCase { } String[] strings = { - "Point()", + toName("Point()"), "HREF=\"../foo/AdvisesRelationshipCoverage.html#before(): initializationP..\""}; boolean b = AjdocOutputChecker.detailSectionContainsRel( htmlFile,"=== CONSTRUCTOR DETAIL",strings[0], @@ -506,7 +508,7 @@ public class CoverageTestCase extends AjdocTestCase { } String[] strings = { - "doIt()", + toName("doIt()"), "HREF=\"../foo/AdvisesRelationshipCoverage.html#before(): handlerP..\""}; boolean b = AjdocOutputChecker.detailSectionContainsRel( htmlFile,"=== METHOD DETAIL", @@ -523,6 +525,13 @@ public class CoverageTestCase extends AjdocTestCase { assertTrue("the Method Summary should have " + strings[0]+" advised by " + strings[1],b); } + private String toName(String name) { + if (LangUtil.is18VMOrGreater()) { + name = name.replace('(','-'); + name = name.replace(')','-'); + } + return name; + } /** * Test that if have two before advice blocks from the same * aspect affect the same method, then both appear in the ajdoc @@ -537,7 +546,7 @@ public class CoverageTestCase extends AjdocTestCase { } String[] strings = { - "amethod()", + toName("amethod()"), "HREF=\"../pkg/A2.html#before(): p..\"", "HREF=\"../pkg/A2.html#before(): p2..\""}; boolean b = AjdocOutputChecker.detailSectionContainsRel( @@ -746,7 +755,7 @@ public class CoverageTestCase extends AjdocTestCase { b = AjdocOutputChecker.detailSectionContainsRel( htmlFile,"=== METHOD DETAIL", - "amethod()", + toName("amethod()"), HtmlDecorator.HtmlRelationshipKind.ADVISED_BY, "HREF=\"../pkg/ClassWithNestedAspect.NestedAspect.html#before(): p..\""); assertTrue("Should have 'amethod() advised by " + @@ -755,7 +764,7 @@ public class CoverageTestCase extends AjdocTestCase { b = AjdocOutputChecker.detailSectionContainsRel( htmlFile,"=== METHOD DETAIL", - "amethod()", + toName("amethod()"), HtmlDecorator.HtmlRelationshipKind.ADVISED_BY, "pkg.ClassWithNestedAspect.NestedAspect.NestedAspect.before(): p.."); assertFalse("Should not have the label " + @@ -764,7 +773,7 @@ public class CoverageTestCase extends AjdocTestCase { b = AjdocOutputChecker.summarySectionContainsRel( htmlFile,"=== METHOD SUMMARY", - "amethod()", + toName("amethod()"), HtmlDecorator.HtmlRelationshipKind.ADVISED_BY, "HREF=\"../pkg/ClassWithNestedAspect.NestedAspect.html#before(): p..\""); assertTrue("Should have 'amethod() advised by " + @@ -773,7 +782,7 @@ public class CoverageTestCase extends AjdocTestCase { b = AjdocOutputChecker.detailSectionContainsRel( htmlFile,"=== METHOD SUMMARY", - "amethod()", + toName("amethod()"), HtmlDecorator.HtmlRelationshipKind.ADVISED_BY, "pkg.ClassWithNestedAspect.NestedAspect.NestedAspect.before(): p.."); assertFalse("Should not have the label " + diff --git a/ajdoc/testsrc/org/aspectj/tools/ajdoc/DeclareFormsTest.java b/ajdoc/testsrc/org/aspectj/tools/ajdoc/DeclareFormsTest.java index 652d1a5e7..fbb711bdc 100644 --- a/ajdoc/testsrc/org/aspectj/tools/ajdoc/DeclareFormsTest.java +++ b/ajdoc/testsrc/org/aspectj/tools/ajdoc/DeclareFormsTest.java @@ -15,6 +15,8 @@ package org.aspectj.tools.ajdoc; import java.io.File; import java.util.List; +import org.aspectj.util.LangUtil; + /** * @author Mik Kersten */ @@ -124,14 +126,15 @@ public class DeclareFormsTest extends AjdocTestCase { boolean b = AjdocOutputChecker.detailSectionContainsRel( htmlFile,"=== METHOD DETAIL", - doIt, + LangUtil.is18VMOrGreater()?"doIt--":doIt, +// doIt, HtmlDecorator.HtmlRelationshipKind.MATCHES_DECLARE, declareWarningQuotes); assertTrue("Should have '" + doIt + " matches declare " + declareWarningQuotes + "' in the Declare Detail section", b); b = AjdocOutputChecker.summarySectionContainsRel( htmlFile,"=== METHOD SUMMARY", - doIt, + LangUtil.is18VMOrGreater()?"doIt--":doIt, HtmlDecorator.HtmlRelationshipKind.MATCHES_DECLARE, declareWarningQuotes); assertTrue("Should have '" + doIt + " matches declare " + @@ -156,14 +159,14 @@ public class DeclareFormsTest extends AjdocTestCase { boolean b = AjdocOutputChecker.detailSectionContainsRel( htmlFile,"=== METHOD DETAIL", - "setX(int)", + LangUtil.is18VMOrGreater()?"setX-int-":"setX(int)", HtmlDecorator.HtmlRelationshipKind.MATCHES_DECLARE, "declare warning: quot;blahquot;"); assertTrue("Should have 'setX(int) matches declare declare warning: quot;blahquot;" + "' in the Method Detail section", b); b = AjdocOutputChecker.summarySectionContainsRel( htmlFile,"=== METHOD SUMMARY", - "setX(int)", + LangUtil.is18VMOrGreater()?"setX-int-":"setX(int)", HtmlDecorator.HtmlRelationshipKind.MATCHES_DECLARE, "declare warning: quot;blahquot;"); assertTrue("Should have 'setX(int) matches declare declare warning: quot;blahquot;" + @@ -272,20 +275,28 @@ public class DeclareFormsTest extends AjdocTestCase { boolean b = AjdocOutputChecker.detailSectionContainsRel( htmlFile,"=== METHOD DETAIL", - doIt, + toName(doIt), HtmlDecorator.HtmlRelationshipKind.SOFTENED_BY, declareSoft); assertTrue("Should have '" + doIt + " softened by " + declareSoft + "' in the Method Detail section", b); b = AjdocOutputChecker.summarySectionContainsRel( htmlFile,"=== METHOD SUMMARY", - doIt, + toName(doIt), HtmlDecorator.HtmlRelationshipKind.SOFTENED_BY, declareSoft); assertTrue("Should have '" + doIt + " softened by " + declareSoft + "' in the Method Summary section", b); } + private String toName(String name) { + if (LangUtil.is18VMOrGreater()) { + name = name.replace('(','-'); + name = name.replace(')','-'); + } + return name; + } + /** * Declare annotation should have the 'annotates' relationship * in the ajdoc for the declaring aspect @@ -348,7 +359,7 @@ public class DeclareFormsTest extends AjdocTestCase { boolean b = AjdocOutputChecker.detailSectionContainsRel( htmlFile,"=== METHOD DETAIL", - "amethod()", + toName("amethod()"), HtmlDecorator.HtmlRelationshipKind.ANNOTATED_BY, "declare @method: public * foo.C.*(..) : @MyAnnotation"); assertTrue("Should have 'amethod() annotated by " + @@ -356,7 +367,7 @@ public class DeclareFormsTest extends AjdocTestCase { "' in the Method Detail section", b); b = AjdocOutputChecker.summarySectionContainsRel( htmlFile,"=== METHOD SUMMARY", - "amethod()", + toName("amethod()"), HtmlDecorator.HtmlRelationshipKind.ANNOTATED_BY, "declare @method: public * foo.C.*(..) : @MyAnnotation"); assertTrue("Should have 'amethod() annotated by " + @@ -382,7 +393,7 @@ public class DeclareFormsTest extends AjdocTestCase { boolean b = AjdocOutputChecker.detailSectionContainsRel( htmlFile,"=== CONSTRUCTOR DETAIL", - "C(java.lang.String)", + toName("C(java.lang.String)"), HtmlDecorator.HtmlRelationshipKind.ANNOTATED_BY, "declare @constructor: foo.C.new(..) : @MyAnnotation"); assertTrue("Should have '" + doIt + " annotated by " + @@ -390,7 +401,7 @@ public class DeclareFormsTest extends AjdocTestCase { "' in the Method Detail section", b); b = AjdocOutputChecker.summarySectionContainsRel( htmlFile,"=== CONSTRUCTOR SUMMARY", - "C(java.lang.String)", + toName("C(java.lang.String)"), HtmlDecorator.HtmlRelationshipKind.ANNOTATED_BY, "declare @constructor: foo.C.new(..) : @MyAnnotation"); assertTrue("Should have '" + doIt + " annotated by " + @@ -473,14 +484,14 @@ public class DeclareFormsTest extends AjdocTestCase { boolean b = AjdocOutputChecker.detailSectionContainsRel( htmlFile,"=== METHOD DETAIL", - "amethod()", + toName("amethod()"), HtmlDecorator.HtmlRelationshipKind.MATCHES_DECLARE, "declare warning: quot;warningquot;"); assertTrue("Should have 'amethod() matches declare declare warning: " + "quot;warningquot;' in the Method Detail section", b); b = AjdocOutputChecker.summarySectionContainsRel( htmlFile,"=== METHOD SUMMARY", - "amethod()", + toName("amethod()"), HtmlDecorator.HtmlRelationshipKind.MATCHES_DECLARE, "declare warning: quot;warningquot;"); assertTrue("Should have 'amethod() matches declare declare warning: " + @@ -488,14 +499,14 @@ public class DeclareFormsTest extends AjdocTestCase { b = AjdocOutputChecker.detailSectionContainsRel( htmlFile,"=== METHOD DETAIL", - "amethod()", + toName("amethod()"), HtmlDecorator.HtmlRelationshipKind.ADVISED_BY, "before(): p.."); assertTrue("the Method Detail should have amethod() advised by before(): p..",b); b = AjdocOutputChecker.summarySectionContainsRel( htmlFile,"=== METHOD SUMMARY", - "amethod()", + toName("amethod()"), HtmlDecorator.HtmlRelationshipKind.ADVISED_BY, "before(): p.."); assertTrue("the Method Summary should have amethod() advised by before(): p..",b); |