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.

Java17PreviewFeaturesTests.java 1.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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.ajc198;
  9. import junit.framework.Test;
  10. import org.aspectj.apache.bcel.Constants;
  11. import org.aspectj.testing.JavaVersionSpecificXMLBasedAjcTestCase;
  12. import org.aspectj.testing.XMLBasedAjcTestCase;
  13. /**
  14. * @author Alexander Kriegisch
  15. */
  16. public class Java17PreviewFeaturesTests extends JavaVersionSpecificXMLBasedAjcTestCase {
  17. private static final Constants.ClassFileVersion classFileVersion = Constants.ClassFileVersion.of(17);
  18. public Java17PreviewFeaturesTests() {
  19. super(17, 17);
  20. }
  21. public void testSwitchPatternMatchingCaseLabelDominatedByPrecedingError() {
  22. runTest("switch pattern matching error");
  23. }
  24. public void testSwitchPatternMatchingJava() {
  25. runTest("switch pattern matching java");
  26. checkVersion("SwitchPatternOK", classFileVersion.MAJOR, classFileVersion.PREVIEW_MINOR);
  27. }
  28. public void testSwitchPatternMatchingAspect() {
  29. runTest("switch pattern matching aspect");
  30. checkVersion("SwitchPatternAspect", classFileVersion.MAJOR, classFileVersion.PREVIEW_MINOR);
  31. checkVersion("Application", classFileVersion.MAJOR, classFileVersion.PREVIEW_MINOR);
  32. checkVersion("Shape", classFileVersion.MAJOR, classFileVersion.PREVIEW_MINOR);
  33. checkVersion("S", classFileVersion.MAJOR, classFileVersion.PREVIEW_MINOR);
  34. }
  35. public static Test suite() {
  36. return XMLBasedAjcTestCase.loadSuite(Java17PreviewFeaturesTests.class);
  37. }
  38. @Override
  39. protected java.net.URL getSpecFile() {
  40. return getClassResource("ajc198.xml");
  41. }
  42. }