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.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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. * <p>
  30. * TODO: Activate after JDT Core implementation and merge.
  31. */
  32. public void testUnnamedPatterns() {
  33. //runTest("unnamed patterns");
  34. System.out.println("Unnamed patterns still are not implemented with the Java 21 release Eclipse 2023-12 (4.30)");
  35. }
  36. /**
  37. * Still not implemented with the Java 21 release Eclipse 2023-12 (4.30),
  38. * see <a href="https://github.com/eclipse-jdt/eclipse.jdt.core/issues/893">GitHub issue 893</a>.
  39. * <p>
  40. * TODO: Activate after JDT Core implementation and merge.
  41. */
  42. public void testUnnamedPatternsAspect() {
  43. //runTest("unnamed patterns aspect");
  44. System.out.println("Unnamed patterns still are not implemented with the Java 21 release Eclipse 2023-12 (4.30)");
  45. }
  46. /**
  47. * Same as {@link Ajc10xTests#test052()}, but compiled to target 21 instead of 1.4
  48. */
  49. public void testUnderscoreInPointcutPattern1() {
  50. runTest("underscore can still be used in pointcut patterns on Java 21+ - 1");
  51. }
  52. public void testUnderscoreInPointcutPattern2() {
  53. runTest("underscore can still be used in pointcut patterns on Java 21+ - 2");
  54. }
  55. public void testNamedClassWithSimpleMainMethod() {
  56. runTest("named class with simple main method");
  57. }
  58. public void testNamedAspectWithSimpleMainMethod() {
  59. runTest("named aspect with simple main method");
  60. }
  61. /**
  62. * Still not implemented with the Java 21 release Eclipse 2023-12 (4.30),
  63. * see <a href="https://github.com/eclipse-jdt/eclipse.jdt.core/issues/1106">GitHub issue 1106</a>.
  64. * <p>
  65. * TODO: Activate after JDT Core implementation and merge.
  66. */
  67. public void testUnnamedClassWithSimpleMainMethod() {
  68. //runTest("unnamed class with simple main method");
  69. System.out.println("Unnamed classes still are not implemented with the Java 21 release Eclipse 2023-12 (4.30)");
  70. }
  71. public static Test suite() {
  72. return XMLBasedAjcTestCase.loadSuite(Java21PreviewFeaturesTests.class);
  73. }
  74. @Override
  75. protected java.net.URL getSpecFile() {
  76. return getClassResource("ajc1921.xml");
  77. }
  78. }