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.

Java18PreviewFeaturesTests.java 2.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /*******************************************************************************
  2. * Copyright (c) 2021 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.ajc199;
  9. import junit.framework.Test;
  10. import org.aspectj.apache.bcel.Constants;
  11. import org.aspectj.testing.XMLBasedAjcTestCase;
  12. import org.aspectj.testing.XMLBasedAjcTestCaseForJava18Only;
  13. /**
  14. * @author Alexander Kriegisch
  15. */
  16. public class Java18PreviewFeaturesTests extends XMLBasedAjcTestCaseForJava18Only {
  17. public void testSwitchPatternMatchingCaseLabelDominatedByPrecedingError() {
  18. runTest("switch pattern matching error");
  19. }
  20. public void testSwitchPatternMatchingJava() {
  21. runTest("switch pattern matching java");
  22. checkVersion("SwitchPatternOK", Constants.MAJOR_18, Constants.PREVIEW_MINOR_VERSION);
  23. }
  24. public void testSwitchPatternMatchingAspect() {
  25. runTest("switch pattern matching aspect");
  26. checkVersion("SwitchPatternAspect", Constants.MAJOR_18, Constants.PREVIEW_MINOR_VERSION);
  27. checkVersion("Application", Constants.MAJOR_18, Constants.PREVIEW_MINOR_VERSION);
  28. checkVersion("Shape", Constants.MAJOR_18, Constants.PREVIEW_MINOR_VERSION);
  29. checkVersion("S", Constants.MAJOR_18, Constants.PREVIEW_MINOR_VERSION);
  30. }
  31. // TODO:
  32. // JDT Core does not seem to have implemented JEP 420 yet,
  33. // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=576746.
  34. // Therefore, deactivate the special tests for now.
  35. /*
  36. public void testSwitchPatternMatchingPreview2Error() {
  37. runTest("switch pattern matching preview 2 error");
  38. }
  39. public void testSwitchPatternMatchingPreview2Java() {
  40. runTest("switch pattern matching preview 2 java");
  41. checkVersion("SwitchPatternOK", Constants.MAJOR_18, Constants.PREVIEW_MINOR_VERSION);
  42. }
  43. public void testSwitchPatternMatchingPreview2Aspect() {
  44. runTest("switch pattern matching preview 2 aspect");
  45. checkVersion("SwitchPatternAspect", Constants.MAJOR_18, Constants.PREVIEW_MINOR_VERSION);
  46. checkVersion("Application", Constants.MAJOR_18, Constants.PREVIEW_MINOR_VERSION);
  47. checkVersion("Shape", Constants.MAJOR_18, Constants.PREVIEW_MINOR_VERSION);
  48. checkVersion("S", Constants.MAJOR_18, Constants.PREVIEW_MINOR_VERSION);
  49. }
  50. */
  51. public static Test suite() {
  52. return XMLBasedAjcTestCase.loadSuite(Java18PreviewFeaturesTests.class);
  53. }
  54. @Override
  55. protected java.net.URL getSpecFile() {
  56. return getClassResource("ajc199.xml");
  57. }
  58. }