aboutsummaryrefslogtreecommitdiffstats
path: root/testing/src
diff options
context:
space:
mode:
authorAlexander Kriegisch <Alexander@Kriegisch.name>2021-06-26 16:16:18 +0700
committerAlexander Kriegisch <Alexander@Kriegisch.name>2021-06-26 16:51:19 +0700
commit9de03c3ea52f78678d8c47296395d5f01d031a48 (patch)
tree748d092412c09670f2781c38cea1ebe9b86c689d /testing/src
parentdfcf1d77a65344934f0e642907819f16b5a3af0a (diff)
downloadaspectj-9de03c3ea52f78678d8c47296395d5f01d031a48.tar.gz
aspectj-9de03c3ea52f78678d8c47296395d5f01d031a48.zip
Add AspectJ 1.9.7 and Java 17 test skeletons
Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
Diffstat (limited to 'testing/src')
-rw-r--r--testing/src/test/java/org/aspectj/testing/XMLBasedAjcTestCaseForJava17Only.java39
-rw-r--r--testing/src/test/java/org/aspectj/testing/XMLBasedAjcTestCaseForJava17OrLater.java27
2 files changed, 66 insertions, 0 deletions
diff --git a/testing/src/test/java/org/aspectj/testing/XMLBasedAjcTestCaseForJava17Only.java b/testing/src/test/java/org/aspectj/testing/XMLBasedAjcTestCaseForJava17Only.java
new file mode 100644
index 000000000..e20ee7af7
--- /dev/null
+++ b/testing/src/test/java/org/aspectj/testing/XMLBasedAjcTestCaseForJava17Only.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 v 2.0
+ * which accompanies this distribution and is available at
+ * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt
+ * ******************************************************************/
+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 XMLBasedAjcTestCaseForJava17Only extends XMLBasedAjcTestCase {
+
+ @Override
+ public void setUp() throws Exception {
+ // Activate this block after upgrading to JDT Core Java 18
+ /*
+ throw new IllegalStateException(
+ "These tests need a Java 17 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.is17VMOrGreater() || LangUtil.is18VMOrGreater()) {
+ throw new IllegalStateException(
+ "These tests should be run on Java 17 only " +
+ "(e.g. because they use version-specific preview features)"
+ );
+ }
+ super.setUp();
+ }
+
+}
diff --git a/testing/src/test/java/org/aspectj/testing/XMLBasedAjcTestCaseForJava17OrLater.java b/testing/src/test/java/org/aspectj/testing/XMLBasedAjcTestCaseForJava17OrLater.java
new file mode 100644
index 000000000..1e18e2f7a
--- /dev/null
+++ b/testing/src/test/java/org/aspectj/testing/XMLBasedAjcTestCaseForJava17OrLater.java
@@ -0,0 +1,27 @@
+/* *******************************************************************
+ * Copyright (c) 2021 Contributors
+ * All rights reserved.
+ * This program and the accompanying materials are made available
+ * under the terms of the Eclipse Public License v 2.0
+ * which accompanies this distribution and is available at
+ * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt
+ * ******************************************************************/
+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 XMLBasedAjcTestCaseForJava17OrLater extends XMLBasedAjcTestCase {
+
+ @Override
+ public void setUp() throws Exception {
+ if (!LangUtil.is17VMOrGreater())
+ throw new IllegalStateException("These tests should be run on Java 17 or later");
+ super.setUp();
+ }
+
+}