aboutsummaryrefslogtreecommitdiffstats
path: root/ajdoc
diff options
context:
space:
mode:
authorAndy Clement <aclement@pivotal.io>2018-09-29 07:47:57 -0700
committerAndy Clement <aclement@pivotal.io>2018-09-29 07:47:57 -0700
commitf6d9aaaf05eca3aaf06d3a769a83f302b0501dca (patch)
treef2f8b3c99f0bd2a77a570f1bf230c2d7aca23647 /ajdoc
parent8aeb774d210a42240f2d6d89dd89e947a084fd7f (diff)
downloadaspectj-f6d9aaaf05eca3aaf06d3a769a83f302b0501dca.tar.gz
aspectj-f6d9aaaf05eca3aaf06d3a769a83f302b0501dca.zip
1.9.2.RC1 changesV1_9_2_RC1
Diffstat (limited to 'ajdoc')
-rw-r--r--ajdoc/testsrc/org/aspectj/tools/ajdoc/AjdocOutputChecker.java8
-rw-r--r--ajdoc/testsrc/org/aspectj/tools/ajdoc/CoverageTestCase.java28
-rw-r--r--ajdoc/testsrc/org/aspectj/tools/ajdoc/DeclareFormsTest.java17
3 files changed, 34 insertions, 19 deletions
diff --git a/ajdoc/testsrc/org/aspectj/tools/ajdoc/AjdocOutputChecker.java b/ajdoc/testsrc/org/aspectj/tools/ajdoc/AjdocOutputChecker.java
index dbe5125c5..485b5d80b 100644
--- a/ajdoc/testsrc/org/aspectj/tools/ajdoc/AjdocOutputChecker.java
+++ b/ajdoc/testsrc/org/aspectj/tools/ajdoc/AjdocOutputChecker.java
@@ -16,6 +16,8 @@ import java.io.FileReader;
import java.util.ArrayList;
import java.util.List;
+import org.aspectj.util.LangUtil;
+
/**
* Helper class to check whether the ajdoc contains the expected
* information.
@@ -205,7 +207,9 @@ public class AjdocOutputChecker {
// found the required main section
String nextLine = reader.readLine();
while (nextLine != null && (nextLine.indexOf("========") == -1)) {
- if (nextLine.indexOf("NAME=\""+source+"\"") != -1 || nextLine.indexOf("name=\""+source+"\"") != -1) {
+ // On JDK11 it looks like <a id="doIt()"> on earlier JDKs it can look like <a name="doit">
+ if ((LangUtil.is11VMOrGreater() && nextLine.indexOf("ID=\""+source+"\"") != -1 || nextLine.indexOf("id=\""+source+"\"") != -1) ||
+ nextLine.indexOf("NAME=\""+source+"\"") != -1 || nextLine.indexOf("name=\""+source+"\"") != -1) {
// found the required subsection
String subLine = reader.readLine();
while(subLine != null
@@ -235,7 +239,7 @@ public class AjdocOutputChecker {
reader.close();
return false;
}
-
+
/**
* Returns whether the supplied source has the expected
* relationship and target within the given summary section
diff --git a/ajdoc/testsrc/org/aspectj/tools/ajdoc/CoverageTestCase.java b/ajdoc/testsrc/org/aspectj/tools/ajdoc/CoverageTestCase.java
index af9ab0ed9..e73b94dae 100644
--- a/ajdoc/testsrc/org/aspectj/tools/ajdoc/CoverageTestCase.java
+++ b/ajdoc/testsrc/org/aspectj/tools/ajdoc/CoverageTestCase.java
@@ -329,7 +329,7 @@ public class CoverageTestCase extends AjdocTestCase {
}
String[] strings = {
- toName("Point()"),
+ LangUtil.is11VMOrGreater()?"&lt;init&gt;()":toName("Point()"),
"HREF=\"../foo/AdvisesRelationshipCoverage.html#before(): constructorExecutionP..\""};
boolean b = AjdocOutputChecker.detailSectionContainsRel(
htmlFile,"=== CONSTRUCTOR DETAIL",
@@ -337,10 +337,16 @@ public class CoverageTestCase extends AjdocTestCase {
HtmlDecorator.HtmlRelationshipKind.ADVISED_BY,
strings[1]);
assertTrue("the Constructor Detail should have " + strings[0]+" advised by " + strings[1],b);
-
+
+ // Pre-JDK 11:
+ // This precedes the line containing strings[1]
+ // <td class="colOne"><code><span class="memberNameLink"><a href="../foo/Point.html#Point--">Point</a></span>()</code>
+ // On JDK 11:
+ // This precedes the line containing strings[1]
+ // <th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="#%3Cinit%3E()">Point</a></span>()</code></th>
b = AjdocOutputChecker.summarySectionContainsRel(
htmlFile,"=== CONSTRUCTOR SUMMARY",
- strings[0],
+ LangUtil.is11VMOrGreater()?"#%3Cinit%3E()":toName("Point()"),
HtmlDecorator.HtmlRelationshipKind.ADVISED_BY,
strings[1]);
assertTrue("the Constructor Summary should have " + strings[0]+" advised by " + strings[1],b);
@@ -469,14 +475,14 @@ public class CoverageTestCase extends AjdocTestCase {
b = AjdocOutputChecker.detailSectionContainsRel(
htmlFile,"=== CONSTRUCTOR DETAIL",
- toName("Point()"),
+ LangUtil.is11VMOrGreater()?"&lt;init&gt;()":toName("Point()"),
HtmlDecorator.HtmlRelationshipKind.ADVISED_BY,
href);
assertTrue("the Constructor Detail should have advised by " + href,b);
b = AjdocOutputChecker.summarySectionContainsRel(
htmlFile,"=== CONSTRUCTOR SUMMARY",
- toName("Point()"),
+ LangUtil.is11VMOrGreater()?"#%3Cinit%3E()":toName("Point()"),
HtmlDecorator.HtmlRelationshipKind.ADVISED_BY,
href);
assertTrue("the Constructor Summary should have advised by " + href,b);
@@ -502,15 +508,19 @@ public class CoverageTestCase extends AjdocTestCase {
}
String[] strings = {
- toName("Point()"),
+ LangUtil.is11VMOrGreater()?"&lt;init&gt;()":toName("Point()"),
"HREF=\"../foo/AdvisesRelationshipCoverage.html#before(): initializationP..\""};
boolean b = AjdocOutputChecker.detailSectionContainsRel(
- htmlFile,"=== CONSTRUCTOR DETAIL",strings[0],
+ htmlFile,
+ "=== CONSTRUCTOR DETAIL",
+ strings[0],
HtmlDecorator.HtmlRelationshipKind.ADVISED_BY,
strings[1]);
assertTrue("the Method Detail should have 'setX(int) advised by ... before()'",b);
b = AjdocOutputChecker.summarySectionContainsRel(
- htmlFile,"=== CONSTRUCTOR SUMMARY",strings[0],
+ htmlFile,
+ "=== CONSTRUCTOR SUMMARY",
+ LangUtil.is11VMOrGreater()?"#%3Cinit%3E()":strings[0],
HtmlDecorator.HtmlRelationshipKind.ADVISED_BY,
strings[1]);
assertTrue("the Method Summary should have 'setX(int) advised by ... before()'",b);
@@ -569,7 +579,7 @@ public class CoverageTestCase extends AjdocTestCase {
}
private String toName(String name) {
- if (LangUtil.is18VMOrGreater()) {
+ if (LangUtil.is18VMOrGreater() && !LangUtil.is11VMOrGreater()) {
name = name.replace('(','-');
name = name.replace(')','-');
}
diff --git a/ajdoc/testsrc/org/aspectj/tools/ajdoc/DeclareFormsTest.java b/ajdoc/testsrc/org/aspectj/tools/ajdoc/DeclareFormsTest.java
index 130a43a9e..8dc4c24fe 100644
--- a/ajdoc/testsrc/org/aspectj/tools/ajdoc/DeclareFormsTest.java
+++ b/ajdoc/testsrc/org/aspectj/tools/ajdoc/DeclareFormsTest.java
@@ -126,15 +126,14 @@ public class DeclareFormsTest extends AjdocTestCase {
boolean b = AjdocOutputChecker.detailSectionContainsRel(
htmlFile,"=== METHOD DETAIL",
- LangUtil.is18VMOrGreater()?"doIt--":doIt,
-// doIt,
+ toName(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",
- LangUtil.is18VMOrGreater()?"doIt--":doIt,
+ toName(doIt),
HtmlDecorator.HtmlRelationshipKind.MATCHES_DECLARE,
declareWarningQuotes);
assertTrue("Should have '" + doIt + " matches declare " +
@@ -159,14 +158,16 @@ public class DeclareFormsTest extends AjdocTestCase {
boolean b = AjdocOutputChecker.detailSectionContainsRel(
htmlFile,"=== METHOD DETAIL",
- LangUtil.is18VMOrGreater()?"setX-int-":"setX(int)",
+ toName("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",
- LangUtil.is18VMOrGreater()?"setX-int-":"setX(int)",
+ toName("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;" +
@@ -290,7 +291,7 @@ public class DeclareFormsTest extends AjdocTestCase {
}
private String toName(String name) {
- if (LangUtil.is18VMOrGreater()) {
+ if (LangUtil.is18VMOrGreater() && !LangUtil.is11VMOrGreater()) {
name = name.replace('(','-');
name = name.replace(')','-');
}
@@ -393,7 +394,7 @@ public class DeclareFormsTest extends AjdocTestCase {
boolean b = AjdocOutputChecker.detailSectionContainsRel(
htmlFile,"=== CONSTRUCTOR DETAIL",
- toName("C(java.lang.String)"),
+ LangUtil.is11VMOrGreater()?"&lt;init&gt;(java.lang.String)":toName("C(java.lang.String)"),
HtmlDecorator.HtmlRelationshipKind.ANNOTATED_BY,
"declare @constructor: foo.C.new(..) : @MyAnnotation");
assertTrue("Should have '" + doIt + " annotated by " +
@@ -401,7 +402,7 @@ public class DeclareFormsTest extends AjdocTestCase {
"' in the Method Detail section", b);
b = AjdocOutputChecker.summarySectionContainsRel(
htmlFile,"=== CONSTRUCTOR SUMMARY",
- toName("C(java.lang.String)"),
+ LangUtil.is11VMOrGreater()?"#%3Cinit%3E(java.lang.String)":toName("C(java.lang.String)"),
HtmlDecorator.HtmlRelationshipKind.ANNOTATED_BY,
"declare @constructor: foo.C.new(..) : @MyAnnotation");
assertTrue("Should have '" + doIt + " annotated by " +