]> source.dussan.org Git - aspectj.git/commitdiff
Do not run tests using Java 14 preview features on this Java 15 compiler
authorAlexander Kriegisch <Alexander@Kriegisch.name>
Wed, 17 Mar 2021 07:55:51 +0000 (14:55 +0700)
committerAlexander Kriegisch <Alexander@Kriegisch.name>
Wed, 17 Mar 2021 07:55:51 +0000 (14:55 +0700)
These tests need a Java 14 level AspectJ compiler, because they use
version-specific preview features. This compiler has been upgraded
to a Java 15 compliant JDT Core already, i.e. it does not support
preview features of a previous version anymore.

An error message similar to the above explanation will appear when
trying to run any XMLBasedAjcTestCaseForJava14Only subclass, such as
Ajc196PreviewFeaturesTests (currently the only one).

When running AllTestsAspectJ196, Ajc196PreviewFeaturesTests will not be
added to the test suite anymore.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
testing/src/test/java/org/aspectj/testing/XMLBasedAjcTestCaseForJava14Only.java
tests/src/test/java/org/aspectj/systemtest/ajc196/AllTestsAspectJ196.java

index 3bdb4d6be474df374b830c51661464eea15242dd..5a25c9a7322f3c9152018fb431cb06210df82438 100644 (file)
@@ -19,6 +19,12 @@ public abstract class XMLBasedAjcTestCaseForJava14Only extends XMLBasedAjcTestCa
 
        @Override
        public void runTest(String title) {
+               throw new IllegalStateException(
+                       "These tests need a Java 14 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.is14VMOrGreater() || LangUtil.is15VMOrGreater()) {
                        throw new IllegalStateException(
                                "These tests should be run on Java 14 only " +
@@ -26,6 +32,7 @@ public abstract class XMLBasedAjcTestCaseForJava14Only extends XMLBasedAjcTestCa
                        );
                }
                super.runTest(title);
+               */
        }
 
 }
index fa2a3aea26d284b5be8839dacb071e944c757399..32e95c06bb6b4b2888a097026aa04cd2e8e3ba89 100644 (file)
@@ -23,9 +23,12 @@ public class AllTestsAspectJ196 {
                        suite.addTest(Ajc196Tests.suite());
                        suite.addTest(SanityTestsJava14.suite());
                }
+               // Do not run tests using a previous compiler's preview features anymore. They would all fail.
+/*
                if (LangUtil.is14VMOrGreater() && !LangUtil.is15VMOrGreater()) {
                        suite.addTest(Ajc196PreviewFeaturesTests.suite());
                }
+*/
                return suite;
        }
 }