diff options
Diffstat (limited to 'tests/src/test')
-rw-r--r-- | tests/src/test/java/org/aspectj/systemtest/ajc1921/Java21PreviewFeaturesTests.java | 19 | ||||
-rw-r--r-- | tests/src/test/resources/org/aspectj/systemtest/ajc1921/ajc1921.xml | 33 |
2 files changed, 52 insertions, 0 deletions
diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc1921/Java21PreviewFeaturesTests.java b/tests/src/test/java/org/aspectj/systemtest/ajc1921/Java21PreviewFeaturesTests.java index bdde4b67e..79ce4c6cb 100644 --- a/tests/src/test/java/org/aspectj/systemtest/ajc1921/Java21PreviewFeaturesTests.java +++ b/tests/src/test/java/org/aspectj/systemtest/ajc1921/Java21PreviewFeaturesTests.java @@ -46,6 +46,25 @@ public class Java21PreviewFeaturesTests extends XMLBasedAjcTestCaseForJava21Only System.out.println("Unnamed patterns still are not implemented with the Java 21 release Eclipse 2023-12 (4.30)"); } + public void testNamedClassWithSimpleMainMethod() { + runTest("named class with simple main method"); + } + + public void testNamedAspectWithSimpleMainMethod() { + runTest("named aspect with simple main method"); + } + + /** + * Still not implemented with the Java 21 release Eclipse 2023-12 (4.30), + * see <a href="https://github.com/eclipse-jdt/eclipse.jdt.core/issues/1106">GitHub issue 1106</a>. + * <p> + * TODO: Activate after JDT Core implementation and merge. + */ + public void testUnnamedClassWithSimpleMainMethod() { + //runTest("unnamed class with simple main method"); + System.out.println("Unnamed classes still are not implemented with the Java 21 release Eclipse 2023-12 (4.30)"); + } + public static Test suite() { return XMLBasedAjcTestCase.loadSuite(Java21PreviewFeaturesTests.class); } diff --git a/tests/src/test/resources/org/aspectj/systemtest/ajc1921/ajc1921.xml b/tests/src/test/resources/org/aspectj/systemtest/ajc1921/ajc1921.xml index edb41fb31..0c31700b2 100644 --- a/tests/src/test/resources/org/aspectj/systemtest/ajc1921/ajc1921.xml +++ b/tests/src/test/resources/org/aspectj/systemtest/ajc1921/ajc1921.xml @@ -300,4 +300,37 @@ </run> </ajc-test> + <!-- Java 21 preview --> + <ajc-test dir="features1921/java21" vm="21" title="named class with simple main method"> + <!-- Compiles without preview mode, but needs preview mode to run --> + <compile files="NamedClassWithSimpleMainMethodPreview1.java" options="-21"/> + <run class="NamedClassWithSimpleMainMethodPreview1" vmargs="--enable-preview"> + <stdout> + <line text="Hello world!"/> + </stdout> + </run> + </ajc-test> + + <!-- Java 21 preview --> + <ajc-test dir="features1921/java21" vm="21" title="named aspect with simple main method"> + <!-- Compiles without preview mode, but needs preview mode to run --> + <compile files="NamedAspectWithSimpleMainMethodPreview1.aj" options="-21"/> + <run class="NamedAspectWithSimpleMainMethodPreview1" vmargs="--enable-preview"> + <stdout> + <line text="Hello world!"/> + </stdout> + </run> + </ajc-test> + + <!-- Java 21 preview --> + <!-- TODO: Activate after https://github.com/eclipse-jdt/eclipse.jdt.core/issues/1106 is done --> + <ajc-test dir="features1921/java21" vm="21" title="unnamed class with simple main method"> + <compile files="UnnamedClassWithSimpleMainMethodPreview1.java" options="--enable-preview -21"/> + <run class="UnnamedClassWithSimpleMainMethodPreview1" vmargs="--enable-preview"> + <stdout> + <line text="Hello world!"/> + </stdout> + </run> + </ajc-test> + </suite> |