aboutsummaryrefslogtreecommitdiffstats
path: root/testing
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 /testing
parent8aeb774d210a42240f2d6d89dd89e947a084fd7f (diff)
downloadaspectj-f6d9aaaf05eca3aaf06d3a769a83f302b0501dca.tar.gz
aspectj-f6d9aaaf05eca3aaf06d3a769a83f302b0501dca.zip
1.9.2.RC1 changesV1_9_2_RC1
Diffstat (limited to 'testing')
-rw-r--r--testing/newsrc/org/aspectj/testing/AjcTest.java3
-rw-r--r--testing/newsrc/org/aspectj/testing/AntSpec.java15
-rw-r--r--testing/newsrc/org/aspectj/testing/XMLBasedAjcTestCaseForJava10OrLater.java8
-rw-r--r--testing/newsrc/org/aspectj/testing/XMLBasedAjcTestCaseForJava11OrLater.java31
4 files changed, 53 insertions, 4 deletions
diff --git a/testing/newsrc/org/aspectj/testing/AjcTest.java b/testing/newsrc/org/aspectj/testing/AjcTest.java
index d56bc6e37..4cb9a8722 100644
--- a/testing/newsrc/org/aspectj/testing/AjcTest.java
+++ b/testing/newsrc/org/aspectj/testing/AjcTest.java
@@ -28,6 +28,7 @@ public class AjcTest {
private static boolean is18VMOrGreater = false;
private static boolean is19VMOrGreater = false;
private static boolean is10VMOrGreater = false;
+ private static boolean is11VMOrGreater = false;
static { // matching logic is also in org.aspectj.util.LangUtil
is14VMOrGreater = LangUtil.is14VMOrGreater();
@@ -37,6 +38,7 @@ public class AjcTest {
is18VMOrGreater = LangUtil.is18VMOrGreater();
is19VMOrGreater = LangUtil.is19VMOrGreater();
is10VMOrGreater = LangUtil.is10VMOrGreater();
+ is11VMOrGreater = LangUtil.is11VMOrGreater();
}
private List<ITestStep> testSteps = new ArrayList<ITestStep>();
@@ -81,6 +83,7 @@ public class AjcTest {
if (vmLevel.equals("1.8")) canRun = is18VMOrGreater;
if (vmLevel.equals("1.9")) canRun = is19VMOrGreater;
if (vmLevel.equals("10")) canRun = is10VMOrGreater;
+ if (vmLevel.equals("11")) canRun = is11VMOrGreater;
if (!canRun) {
System.out.println("***SKIPPING TEST***" + getTitle()+ " needs " + getVmLevel()
+ ", currently running on " + System.getProperty("java.vm.version"));
diff --git a/testing/newsrc/org/aspectj/testing/AntSpec.java b/testing/newsrc/org/aspectj/testing/AntSpec.java
index 802783684..ceba08b29 100644
--- a/testing/newsrc/org/aspectj/testing/AntSpec.java
+++ b/testing/newsrc/org/aspectj/testing/AntSpec.java
@@ -199,6 +199,21 @@ public class AntSpec implements ITestStep {
if (stderr2.indexOf("Class JavaLaunchHelper is implemented in both")!=-1 && stderr2.indexOf('\n')!=-1) {
stderr2 = stderr2.replaceAll("objc\\[[0-9]*\\]: Class JavaLaunchHelper is implemented in both [^\n]*\n","");
}
+ // JDK 11 is complaining about illegal reflective calls - temporary measure ignore these - does that get all tests passing and this is the last problem?
+ if (stderr2.indexOf("WARNING: Illegal reflective access using Lookup on org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor") != -1) {
+// WARNING: An illegal reflective access operation has occurred
+// WARNING: Illegal reflective access using Lookup on org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor (file:/Users/aclement/gits/org.aspectj/loadtime/bin/) to class java.lang.ClassLoader
+// WARNING: Please consider reporting this to the maintainers of org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor
+// WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
+// WARNING: All illegal access operations will be denied in a future release
+
+ stderr2 = stderr2.replaceAll("WARNING: An illegal reflective access operation has occurred\n","");
+ stderr2 = stderr2.replaceAll("WARNING: Illegal reflective access using Lookup on org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor[^\n]*\n","");
+ stderr2 = stderr2.replaceAll("WARNING: Please consider reporting this to the maintainers of org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor\n","");
+ stderr2 = stderr2.replaceAll("WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations\n","");
+ stderr2 = stderr2.replaceAll("WARNING: All illegal access operations will be denied in a future release\n","");
+ }
+
m_stdErrSpec.matchAgainst(stderr2);
}
}
diff --git a/testing/newsrc/org/aspectj/testing/XMLBasedAjcTestCaseForJava10OrLater.java b/testing/newsrc/org/aspectj/testing/XMLBasedAjcTestCaseForJava10OrLater.java
index 492106d4d..4a8c63f11 100644
--- a/testing/newsrc/org/aspectj/testing/XMLBasedAjcTestCaseForJava10OrLater.java
+++ b/testing/newsrc/org/aspectj/testing/XMLBasedAjcTestCaseForJava10OrLater.java
@@ -11,8 +11,10 @@
* ******************************************************************/
package org.aspectj.testing;
+import org.aspectj.util.LangUtil;
+
/**
- * Makes sure tests are running on the right level of JDK.
+ * Ensure sure tests are running on the right level of JDK.
*
* @author Andy Clement
*/
@@ -20,9 +22,7 @@ public abstract class XMLBasedAjcTestCaseForJava10OrLater extends XMLBasedAjcTes
@Override
public void runTest(String title) {
- // Check we are on Java10
- String property = System.getProperty("java.version");
- if (!property.startsWith("10")) {
+ if (!LangUtil.is10VMOrGreater()) {
throw new IllegalStateException("These tests should be run on Java 10 or later");
}
super.runTest(title);
diff --git a/testing/newsrc/org/aspectj/testing/XMLBasedAjcTestCaseForJava11OrLater.java b/testing/newsrc/org/aspectj/testing/XMLBasedAjcTestCaseForJava11OrLater.java
new file mode 100644
index 000000000..b71fc19e9
--- /dev/null
+++ b/testing/newsrc/org/aspectj/testing/XMLBasedAjcTestCaseForJava11OrLater.java
@@ -0,0 +1,31 @@
+/* *******************************************************************
+ * Copyright (c) 2018 Contributors
+ * All rights reserved.
+ * This program and the accompanying materials are made available
+ * under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Andy Clement
+ * ******************************************************************/
+package org.aspectj.testing;
+
+/**
+ * Makes sure tests are running on the right level of JDK.
+ *
+ * @author Andy Clement
+ */
+public abstract class XMLBasedAjcTestCaseForJava11OrLater extends XMLBasedAjcTestCase {
+
+ @Override
+ public void runTest(String title) {
+ // Check we are on Java11
+ String property = System.getProperty("java.version");
+ if (!property.startsWith("11")) {
+ throw new IllegalStateException("These tests should be run on Java 11 or later");
+ }
+ super.runTest(title);
+ }
+
+}