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.

Java14PreviewFeaturesTests.java 1.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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.ajc196;
  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 Java14PreviewFeaturesTests extends JavaVersionSpecificXMLBasedAjcTestCase {
  17. private static final Constants.ClassFileVersion classFileVersion = Constants.ClassFileVersion.of(14);
  18. public Java14PreviewFeaturesTests() {
  19. super(14, 14);
  20. }
  21. public void testRecords() {
  22. runTest("simple record");
  23. checkVersion("Person", classFileVersion.MAJOR, classFileVersion.PREVIEW_MINOR);
  24. }
  25. public void testRecords2() {
  26. runTest("using a record");
  27. }
  28. public void testInstanceofPatterns() {
  29. runTest("instanceof patterns");
  30. }
  31. public void testAdvisingRecords() {
  32. runTest("advising records");
  33. }
  34. public void testTextBlock1() {
  35. runTest("textblock 1");
  36. }
  37. public void testTextBlock2() {
  38. runTest("textblock 2");
  39. }
  40. public static Test suite() {
  41. return XMLBasedAjcTestCase.loadSuite(Java14PreviewFeaturesTests.class);
  42. }
  43. @Override
  44. protected java.net.URL getSpecFile() {
  45. return getClassResource("ajc196.xml");
  46. }
  47. }