aboutsummaryrefslogtreecommitdiffstats
path: root/testing/src
diff options
context:
space:
mode:
authorAlexander Kriegisch <Alexander@Kriegisch.name>2021-03-17 23:38:08 +0700
committerAlexander Kriegisch <Alexander@Kriegisch.name>2021-03-17 23:38:08 +0700
commit4e5430011fc9283074339b39754b0f07ff5d8a04 (patch)
treec56b73057f7255faee0b5a04532155c281db65e0 /testing/src
parent58830078585fd045c92737ce56cb693b903f5545 (diff)
downloadaspectj-4e5430011fc9283074339b39754b0f07ff5d8a04.tar.gz
aspectj-4e5430011fc9283074339b39754b0f07ff5d8a04.zip
Add Java 15 / AspectJ 1.9.7 test suite
Also fix some minor details in Java 14 suite Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
Diffstat (limited to 'testing/src')
-rw-r--r--testing/src/test/java/org/aspectj/testing/XMLBasedAjcTestCaseForJava15Only.java39
1 files changed, 39 insertions, 0 deletions
diff --git a/testing/src/test/java/org/aspectj/testing/XMLBasedAjcTestCaseForJava15Only.java b/testing/src/test/java/org/aspectj/testing/XMLBasedAjcTestCaseForJava15Only.java
new file mode 100644
index 000000000..82fe4045c
--- /dev/null
+++ b/testing/src/test/java/org/aspectj/testing/XMLBasedAjcTestCaseForJava15Only.java
@@ -0,0 +1,39 @@
+/* *******************************************************************
+ * Copyright (c) 2021 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 Alexander Kriegisch
+ */
+public abstract class XMLBasedAjcTestCaseForJava15Only extends XMLBasedAjcTestCase {
+
+ @Override
+ public void runTest(String title) {
+ // Activate this block after upgrading to JDT Core Java 16
+ /*
+ throw new IllegalStateException(
+ "These tests need a Java 15 level AspectJ compiler " +
+ "(e.g. because they use version-specific preview features). " +
+ "This compiler does not support preview features of a previous version anymore."
+ );
+ */
+ if (!LangUtil.is15VMOrGreater() || LangUtil.is16VMOrGreater()) {
+ throw new IllegalStateException(
+ "These tests should be run on Java 15 only " +
+ "(e.g. because they use version-specific preview features)"
+ );
+ }
+ super.runTest(title);
+ }
+
+}