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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*******************************************************************************
  2. * Copyright (c) 2022 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. public void testSwitchPatternMatchingPreview2Error1() {
  32. runTest("switch pattern matching preview 2 error 1");
  33. }
  34. public void testSwitchPatternMatchingPreview2Error2() {
  35. runTest("switch pattern matching preview 2 error 2");
  36. }
  37. public void testSwitchPatternMatchingPreview2Java() {
  38. runTest("switch pattern matching preview 2 java");
  39. checkVersion("SwitchPatternPreview2OK", Constants.MAJOR_18, Constants.PREVIEW_MINOR_VERSION);
  40. }
  41. public void testSwitchPatternMatchingPreview2Aspect() {
  42. runTest("switch pattern matching preview 2 aspect");
  43. checkVersion("SwitchPatternPreview2Aspect", Constants.MAJOR_18, Constants.PREVIEW_MINOR_VERSION);
  44. checkVersion("Application", Constants.MAJOR_18, Constants.PREVIEW_MINOR_VERSION);
  45. }
  46. public static Test suite() {
  47. return XMLBasedAjcTestCase.loadSuite(Java18PreviewFeaturesTests.class);
  48. }
  49. @Override
  50. protected java.net.URL getSpecFile() {
  51. return getClassResource("ajc199.xml");
  52. }
  53. }