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

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