From f6d9aaaf05eca3aaf06d3a769a83f302b0501dca Mon Sep 17 00:00:00 2001 From: Andy Clement Date: Sat, 29 Sep 2018 07:47:57 -0700 Subject: 1.9.2.RC1 changes --- testing/newsrc/org/aspectj/testing/AjcTest.java | 3 +++ testing/newsrc/org/aspectj/testing/AntSpec.java | 15 +++++++++++ .../XMLBasedAjcTestCaseForJava10OrLater.java | 8 +++--- .../XMLBasedAjcTestCaseForJava11OrLater.java | 31 ++++++++++++++++++++++ 4 files changed, 53 insertions(+), 4 deletions(-) create mode 100644 testing/newsrc/org/aspectj/testing/XMLBasedAjcTestCaseForJava11OrLater.java (limited to 'testing') 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 testSteps = new ArrayList(); @@ -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); + } + +} -- cgit v1.2.3