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.
}
String[] strings = {
- "setX(int)",
+ toName("setX(int)"),
"HREF=\"../foo/AdvisesRelationshipCoverage.html#before(): methodExecutionP..\""};
boolean b = AjdocOutputChecker.detailSectionContainsRel(
htmlFile,"=== METHOD DETAIL",
}
String[] strings = {
- "Point()",
+ toName("Point()"),
"HREF=\"../foo/AdvisesRelationshipCoverage.html#before(): constructorExecutionP..\""};
boolean b = AjdocOutputChecker.detailSectionContainsRel(
htmlFile,"=== CONSTRUCTOR DETAIL",
}
String[] strings = {
- "changeX(int)",
+ toName("changeX(int)"),
"HREF=\"../foo/AdvisesRelationshipCoverage.html#before(): callMethodP..\""};
boolean b = AjdocOutputChecker.detailSectionContainsRel(
htmlFile,"=== METHOD DETAIL",
}
String[] strings = {
- "doIt()",
+ toName("doIt()"),
"HREF=\"../foo/AdvisesRelationshipCoverage.html#before(): callConstructorP..\""};
boolean b = AjdocOutputChecker.detailSectionContainsRel(
htmlFile,"=== METHOD DETAIL",
}
String[] strings = {
- "getX()",
+ toName("getX()"),
"HREF=\"../foo/AdvisesRelationshipCoverage.html#before(): getP..\""};
boolean b = AjdocOutputChecker.detailSectionContainsRel(
htmlFile,"=== METHOD DETAIL",
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);
}
String[] strings = {
- "Point()",
+ toName("Point()"),
"HREF=\"../foo/AdvisesRelationshipCoverage.html#before(): initializationP..\""};
boolean b = AjdocOutputChecker.detailSectionContainsRel(
htmlFile,"=== CONSTRUCTOR DETAIL",strings[0],
}
String[] strings = {
- "doIt()",
+ toName("doIt()"),
"HREF=\"../foo/AdvisesRelationshipCoverage.html#before(): handlerP..\""};
boolean b = AjdocOutputChecker.detailSectionContainsRel(
htmlFile,"=== METHOD DETAIL",
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
}
String[] strings = {
- "amethod()",
+ toName("amethod()"),
"HREF=\"../pkg/A2.html#before(): p..\"",
"HREF=\"../pkg/A2.html#before(): p2..\""};
boolean b = AjdocOutputChecker.detailSectionContainsRel(
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 " +
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 " +
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 " +
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 " +
import java.io.File;
import java.util.List;
+import org.aspectj.util.LangUtil;
+
/**
* @author Mik Kersten
*/
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 " +
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;" +
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
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 " +
"' 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 " +
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 " +
"' 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 " +
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: " +
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);