From 5a223d492823aeb1d5d655792193675811deb84a Mon Sep 17 00:00:00 2001 From: Alexander Kriegisch Date: Fri, 22 Mar 2024 20:53:10 +0100 Subject: Switch to Java 22 + add basic test suite The tests from Java 21 were copied to 22. Inactive ones were activated after their features under test were fixed/implemented. Preview ones were promotes to final ones for unnamed variables and patterns. TODO: Add tests for new Java 22 features and maybe adjust or amend existing feature tests, if preview or final characteristics have changed since Java 21. Signed-off-by: Alexander Kriegisch --- .../systemtest/ajc1922/AllTestsAspectJ1922.java | 50 ++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 tests/src/test/java/org/aspectj/systemtest/ajc1922/AllTestsAspectJ1922.java (limited to 'tests/src/test/java/org/aspectj/systemtest/ajc1922/AllTestsAspectJ1922.java') diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc1922/AllTestsAspectJ1922.java b/tests/src/test/java/org/aspectj/systemtest/ajc1922/AllTestsAspectJ1922.java new file mode 100644 index 000000000..b32e9edd2 --- /dev/null +++ b/tests/src/test/java/org/aspectj/systemtest/ajc1922/AllTestsAspectJ1922.java @@ -0,0 +1,50 @@ +/******************************************************************************* + * Copyright (c) 2024 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.systemtest.ajc1922; + +import junit.framework.Test; +import junit.framework.TestSuite; +import org.aspectj.tools.ant.taskdefs.AjcTask; +import org.aspectj.util.LangUtil; + +// AspectJ_JDK_Update +// - Copy 'ajc*' package with all classes to a new package, incrementing the version number in the package +// - Rename all classes, incrementing version numbers +// - Add this class to the suite in class AllTests19 +// - Increment version numbers in strings, method calls and constants to the appropriate values, creating necessary +// methods and constants classes providing them, if they do not exist yet +// - Also increment references to 'ajc*.xml' and 'sanity-tests-*.xml' test definition, copying the previous +// tests/src/test/resources/org/aspectj/systemtest/ajc* directory, incrementing all names and adjusting the XML +// file contents appropriately +// - Search for other 'AspectJ_JDK_Update' hints in the repository, also performing the necessary to-dos there +// - Remove this comment from the previous class version after copying this one + +/** + * @author Alexander Kriegisch + */ +public class AllTestsAspectJ1922 { + + private static final int JAVA_VERSION = 22; + + public static Test suite() { + TestSuite suite = new TestSuite("AspectJ 1.9.22 tests"); + suite.addTest(Bugs1922Tests.suite()); + if (LangUtil.isVMGreaterOrEqual(JAVA_VERSION)) { + suite.addTest(SanityTestsJava22.suite()); + suite.addTest(Ajc1922TestsJava.suite()); + } + + // Do not run tests using a previous compiler's preview features anymore. They would all fail. + if (AjcTask.JAVA_VERSION_MAX == JAVA_VERSION) { + if (LangUtil.isVMGreaterOrEqual(JAVA_VERSION) && LangUtil.isVMLessOrEqual(JAVA_VERSION)) { + suite.addTest(Java22PreviewFeaturesTests.suite()); + } + } + return suite; + } +} -- cgit v1.2.3