You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Java21PreviewFeaturesTests.java 3.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. /*******************************************************************************
  2. * Copyright (c) 2023 Contributors
  3. * All rights reserved. This program and the accompanying materials
  4. * are made available under the terms of the Eclipse Public License v 2.0
  5. * which accompanies this distribution, and is available at
  6. * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt
  7. *******************************************************************************/
  8. package org.aspectj.systemtest.ajc1921;
  9. import junit.framework.Test;
  10. import org.aspectj.systemtest.ajc10x.Ajc10xTests;
  11. import org.aspectj.testing.JavaVersionSpecificXMLBasedAjcTestCase;
  12. import org.aspectj.testing.XMLBasedAjcTestCase;
  13. /**
  14. * @author Alexander Kriegisch
  15. */
  16. public class Java21PreviewFeaturesTests extends JavaVersionSpecificXMLBasedAjcTestCase {
  17. public Java21PreviewFeaturesTests() {
  18. super(21, 21);
  19. }
  20. public void testStringPatterns() {
  21. runTest("string patterns");
  22. }
  23. public void testStringPatternsAspect() {
  24. runTest("string patterns aspect");
  25. }
  26. /**
  27. * Still not implemented with the Java 21 release Eclipse 2023-12 (4.30),
  28. * see <a href="https://github.com/eclipse-jdt/eclipse.jdt.core/issues/893">GitHub issue 893</a>.
  29. */
  30. public void testUnnamedPatterns() {
  31. //runTest("unnamed patterns");
  32. System.out.println("Unnamed patterns still are not implemented with the Java 21 release Eclipse 2023-12 (4.30)");
  33. }
  34. /**
  35. * Still not implemented with the Java 21 release Eclipse 2023-12 (4.30),
  36. * see <a href="https://github.com/eclipse-jdt/eclipse.jdt.core/issues/893">GitHub issue 893</a>.
  37. */
  38. public void testUnnamedPatternsAspect() {
  39. //runTest("unnamed patterns aspect");
  40. System.out.println("Unnamed patterns still are not implemented with the Java 21 release Eclipse 2023-12 (4.30)");
  41. }
  42. /**
  43. * Same as {@link Ajc10xTests#test052()}, but compiled to target 21 instead of 1.4
  44. */
  45. public void testUnderscoreInPointcutPattern1() {
  46. runTest("underscore can still be used in pointcut patterns on Java 21+ - 1");
  47. }
  48. public void testUnderscoreInPointcutPattern2() {
  49. runTest("underscore can still be used in pointcut patterns on Java 21+ - 2");
  50. }
  51. public void testNamedClassWithSimpleMainMethod() {
  52. runTest("named class with simple main method");
  53. }
  54. public void testNamedAspectWithSimpleMainMethod() {
  55. runTest("named aspect with simple main method");
  56. }
  57. /**
  58. * Still not implemented with the Java 21 release Eclipse 2023-12 (4.30),
  59. * see <a href="https://github.com/eclipse-jdt/eclipse.jdt.core/issues/1106">GitHub issue 1106</a>.
  60. */
  61. public void testUnnamedClassWithSimpleMainMethod() {
  62. //runTest("unnamed class with simple main method");
  63. System.out.println("Unnamed classes still are not implemented with the Java 21 release Eclipse 2023-12 (4.30)");
  64. }
  65. public static Test suite() {
  66. return XMLBasedAjcTestCase.loadSuite(Java21PreviewFeaturesTests.class);
  67. }
  68. @Override
  69. protected java.net.URL getSpecFile() {
  70. return getClassResource("ajc1921.xml");
  71. }
  72. }