aboutsummaryrefslogtreecommitdiffstats
path: root/testing
diff options
context:
space:
mode:
authorAlexander Kriegisch <Alexander@Kriegisch.name>2021-03-13 13:54:45 +0700
committerAlexander Kriegisch <Alexander@Kriegisch.name>2021-03-16 08:22:16 +0700
commitfff8eef683e8b7e426319101d3bb9dec56c7d7d6 (patch)
tree4152bb3ebc7f314d3077820f2475d144ff50334a /testing
parent7fab8259c448aa3185bab27e7bc813bc3512b8a3 (diff)
downloadaspectj-fff8eef683e8b7e426319101d3bb9dec56c7d7d6.tar.gz
aspectj-fff8eef683e8b7e426319101d3bb9dec56c7d7d6.zip
Add Java 15 class vile version to BCEL constants, adjust test tools etc.
Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
Diffstat (limited to 'testing')
-rw-r--r--testing/src/test/java/org/aspectj/testing/AjcTest.java47
-rw-r--r--testing/src/test/java/org/aspectj/testing/XMLBasedAjcTestCaseForJava15OrLater.java28
2 files changed, 45 insertions, 30 deletions
diff --git a/testing/src/test/java/org/aspectj/testing/AjcTest.java b/testing/src/test/java/org/aspectj/testing/AjcTest.java
index 5f39368a6..ee0349c81 100644
--- a/testing/src/test/java/org/aspectj/testing/AjcTest.java
+++ b/testing/src/test/java/org/aspectj/testing/AjcTest.java
@@ -20,32 +20,19 @@ import org.aspectj.util.LangUtil;
*/
public class AjcTest {
- // private static boolean is13VMOrGreater = true;
+ // private static boolean is1dot3VMOrGreater = true;
private static boolean is1dot4VMOrGreater = true;
- private static boolean is15VMOrGreater = false;
- private static boolean is16VMOrGreater = false;
- private static boolean is17VMOrGreater = false;
- private static boolean is18VMOrGreater = false;
- private static boolean is19VMOrGreater = false;
- private static boolean is10VMOrGreater = false;
- private static boolean is11VMOrGreater = false;
- private static boolean is12VMOrGreater = false;
- private static boolean is13VMOrGreater = false;
- private static boolean is14VMOrGreater = false;
-
- static { // matching logic is also in org.aspectj.util.LangUtil
- is1dot4VMOrGreater = true;
- is15VMOrGreater = true;
- is16VMOrGreater = true;
- is17VMOrGreater = true;
- is18VMOrGreater = true;
- is19VMOrGreater = LangUtil.is9VMOrGreater();
- is10VMOrGreater = LangUtil.is10VMOrGreater();
- is11VMOrGreater = LangUtil.is11VMOrGreater();
- is12VMOrGreater = LangUtil.is12VMOrGreater();
- is13VMOrGreater = LangUtil.is13VMOrGreater();
- is14VMOrGreater = LangUtil.is14VMOrGreater();
- }
+ private static boolean is1dot5VMOrGreater = true;
+ private static boolean is1dot6VMOrGreater = true;
+ private static boolean is1dot7VMOrGreater = true;
+ private static boolean is1dot8VMOrGreater = true;
+ private static boolean is9VMOrGreater = LangUtil.is9VMOrGreater();
+ private static boolean is10VMOrGreater = LangUtil.is10VMOrGreater();
+ private static boolean is11VMOrGreater = LangUtil.is11VMOrGreater();
+ private static boolean is12VMOrGreater = LangUtil.is12VMOrGreater();
+ private static boolean is13VMOrGreater = LangUtil.is13VMOrGreater();
+ private static boolean is14VMOrGreater = LangUtil.is14VMOrGreater();
+ private static boolean is15VMOrGreater = LangUtil.is15VMOrGreater();
private List<ITestStep> testSteps = new ArrayList<>();
@@ -83,11 +70,11 @@ public class AjcTest {
if (vmLevel.equals("1.3")) return true;
boolean canRun = true;
if (vmLevel.equals("1.4")) canRun = is1dot4VMOrGreater;
- if (vmLevel.equals("1.5")) canRun = is15VMOrGreater;
- if (vmLevel.equals("1.6")) canRun = is16VMOrGreater;
- if (vmLevel.equals("1.7")) canRun = is17VMOrGreater;
- if (vmLevel.equals("1.8")) canRun = is18VMOrGreater;
- if (vmLevel.equals("1.9")) canRun = is19VMOrGreater;
+ if (vmLevel.equals("1.5")) canRun = is1dot5VMOrGreater;
+ if (vmLevel.equals("1.6")) canRun = is1dot6VMOrGreater;
+ if (vmLevel.equals("1.7")) canRun = is1dot7VMOrGreater;
+ if (vmLevel.equals("1.8")) canRun = is1dot8VMOrGreater;
+ if (vmLevel.equals("1.9")) canRun = is9VMOrGreater;
if (vmLevel.equals("10")) canRun = is10VMOrGreater;
if (vmLevel.equals("11")) canRun = is11VMOrGreater;
if (vmLevel.equals("12")) canRun = is12VMOrGreater;
diff --git a/testing/src/test/java/org/aspectj/testing/XMLBasedAjcTestCaseForJava15OrLater.java b/testing/src/test/java/org/aspectj/testing/XMLBasedAjcTestCaseForJava15OrLater.java
new file mode 100644
index 000000000..90b7feda1
--- /dev/null
+++ b/testing/src/test/java/org/aspectj/testing/XMLBasedAjcTestCaseForJava15OrLater.java
@@ -0,0 +1,28 @@
+/* *******************************************************************
+ * Copyright (c) 2020 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
+ * ******************************************************************/
+package org.aspectj.testing;
+
+import org.aspectj.util.LangUtil;
+
+/**
+ * Makes sure tests are running on the right level of JDK.
+ *
+ * @author Andy Clement
+ */
+public abstract class XMLBasedAjcTestCaseForJava15OrLater extends XMLBasedAjcTestCase {
+
+ @Override
+ public void runTest(String title) {
+ if (!LangUtil.is15VMOrGreater()) {
+ throw new IllegalStateException("These tests should be run on Java 15 or later");
+ }
+ super.runTest(title);
+ }
+
+}