diff options
author | Alexander Kriegisch <Alexander@Kriegisch.name> | 2022-03-21 10:45:00 +0700 |
---|---|---|
committer | Alexander Kriegisch <Alexander@Kriegisch.name> | 2022-03-21 10:51:35 +0700 |
commit | 6dc09db0ca1589f8c53c4dca054e3a852eaaecba (patch) | |
tree | 9c480f1ab92b26d141a249513d89942b1a1e6b73 /tests/src/test/java/org/aspectj/systemtest/ajc198 | |
parent | d3a06a6942b6f69ce9b5b4403d3c1cf1803cf01e (diff) | |
download | aspectj-6dc09db0ca1589f8c53c4dca054e3a852eaaecba.tar.gz aspectj-6dc09db0ca1589f8c53c4dca054e3a852eaaecba.zip |
Prepare code, tests and docs for Java 18
- JDT Core dependency in pom.xml
- Constants.java
- LangUtil.java
- AjcTask.java
- messages_aspectj.properties
- XMLBasedAjcTestCaseForJava17Only.java
- XMLBasedAjcTestCaseForJava18*.java
- tests/bugs199
- tests/features199
- JavaVersionCompatibility.md
- README-199.html
- GitHub CI build
Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
Diffstat (limited to 'tests/src/test/java/org/aspectj/systemtest/ajc198')
3 files changed, 27 insertions, 57 deletions
diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc198/Ajc198TestsJava.java b/tests/src/test/java/org/aspectj/systemtest/ajc198/Ajc198TestsJava.java index ef597c8f1..3e6ead467 100644 --- a/tests/src/test/java/org/aspectj/systemtest/ajc198/Ajc198TestsJava.java +++ b/tests/src/test/java/org/aspectj/systemtest/ajc198/Ajc198TestsJava.java @@ -17,35 +17,29 @@ import org.aspectj.testing.XMLBasedAjcTestCaseForJava17OrLater; */ public class Ajc198TestsJava extends XMLBasedAjcTestCaseForJava17OrLater { - public void testSealedClassWithLegalSubclasses() { - runTest("sealed class with legal subclasses"); - // TODO: replace 0 by Constants.PREVIEW_MINOR_VERSION after no longer using EA - // build, but final JDK version - checkVersion("Employee", Constants.MAJOR_17, 0 /* Constants.PREVIEW_MINOR_VERSION */); - checkVersion("Manager", Constants.MAJOR_17, 0 /* Constants.PREVIEW_MINOR_VERSION */); - } - - public void testSealedClassWithIllegalSubclass() { - runTest("sealed class with illegal subclass"); - // TODO: replace 0 by Constants.PREVIEW_MINOR_VERSION after no longer using EA - // build, but final JDK version - checkVersion("Person", Constants.MAJOR_17, 0 /* Constants.PREVIEW_MINOR_VERSION */); - } - - public void testWeaveSealedClass() { - runTest("weave sealed class"); - // TODO: replace 0 by Constants.PREVIEW_MINOR_VERSION after no longer using EA - // build, but final JDK version - checkVersion("PersonAspect", Constants.MAJOR_17, 0 /* Constants.PREVIEW_MINOR_VERSION */); - } - - public static Test suite() { - return XMLBasedAjcTestCase.loadSuite(Ajc198TestsJava.class); - } - - @Override - protected java.net.URL getSpecFile() { - return getClassResource("ajc198.xml"); - } + public void testSealedClassWithLegalSubclasses() { + runTest("sealed class with legal subclasses"); + checkVersion("Employee", Constants.MAJOR_17, Constants.MINOR_17); + checkVersion("Manager", Constants.MAJOR_17, Constants.MINOR_17); + } + + public void testSealedClassWithIllegalSubclass() { + runTest("sealed class with illegal subclass"); + checkVersion("Person", Constants.MAJOR_17, Constants.MINOR_17); + } + + public void testWeaveSealedClass() { + runTest("weave sealed class"); + checkVersion("PersonAspect", Constants.MAJOR_17, Constants.MINOR_17); + } + + public static Test suite() { + return XMLBasedAjcTestCase.loadSuite(Ajc198TestsJava.class); + } + + @Override + protected java.net.URL getSpecFile() { + return getClassResource("ajc198.xml"); + } } diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc198/AllTestsAspectJ198.java b/tests/src/test/java/org/aspectj/systemtest/ajc198/AllTestsAspectJ198.java index 3cfc7a149..929b5749d 100644 --- a/tests/src/test/java/org/aspectj/systemtest/ajc198/AllTestsAspectJ198.java +++ b/tests/src/test/java/org/aspectj/systemtest/ajc198/AllTestsAspectJ198.java @@ -29,9 +29,12 @@ public class AllTestsAspectJ198 { suite.addTest(SanityTestsJava17.suite()); suite.addTest(Ajc198TestsJava.suite()); } + // Do not run tests using a previous compiler's preview features anymore. They would all fail. + /* if (LangUtil.is17VMOrGreater() && !LangUtil.is18VMOrGreater()) { suite.addTest(Java17PreviewFeaturesTests.suite()); } + */ return suite; } } diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc198/Bugs198Tests.java b/tests/src/test/java/org/aspectj/systemtest/ajc198/Bugs198Tests.java index 7982ec630..cb3b781bb 100644 --- a/tests/src/test/java/org/aspectj/systemtest/ajc198/Bugs198Tests.java +++ b/tests/src/test/java/org/aspectj/systemtest/ajc198/Bugs198Tests.java @@ -21,33 +21,6 @@ public class Bugs198Tests extends XMLBasedAjcTestCase { runTest("ITD annotation with mandatory parameter via aspectpath"); } - public void testAnnotationStyleSpecialIfClauses() { - runTest("annotation style A"); - } - - public void testAnnotationStylePointcutInheritanceWithIfClauses() { - runTest("annotation style B"); - } - - public void testAnnotationStyleSpecialIfClauses2_gh120() { - runTest("annotation style C"); - } - - public void testAnnotationStyleSpecialIfClauses3_gh120() { - runTest("annotation style D"); - } - - public void testAnnotationStyleNegatedIf_gh122() { - runTest("annotation style negated if"); - } - - public void testGitHub_125() { - try (PropertyEnvironment env = ScopedSystemProperties.newPropertyEnvironment()) { - env.setProperty("org.aspectj.weaver.openarchives", "20"); - runTest("compiler can re-open closed JARs"); - } - } - public static Test suite() { return XMLBasedAjcTestCase.loadSuite(Bugs198Tests.class); } |