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.

Ajc198TestsJava.java 2.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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.XMLBasedAjcTestCase;
  12. import org.aspectj.testing.XMLBasedAjcTestCaseForJava17OrLater;
  13. /**
  14. * @author Alexander Kriegisch
  15. */
  16. public class Ajc198TestsJava extends XMLBasedAjcTestCaseForJava17OrLater {
  17. public void testSealedClassWithLegalSubclasses() {
  18. runTest("sealed class with legal subclasses");
  19. // TODO: replace 0 by Constants.PREVIEW_MINOR_VERSION after no longer using EA build, but final JDK version
  20. checkVersion("Employee", Constants.MAJOR_17, 0 /*Constants.PREVIEW_MINOR_VERSION*/);
  21. checkVersion("Manager", Constants.MAJOR_17, 0 /*Constants.PREVIEW_MINOR_VERSION*/);
  22. }
  23. public void testSealedClassWithIllegalSubclass() {
  24. runTest("sealed class with illegal subclass");
  25. // TODO: replace 0 by Constants.PREVIEW_MINOR_VERSION after no longer using EA build, but final JDK version
  26. checkVersion("Person", Constants.MAJOR_17, 0 /*Constants.PREVIEW_MINOR_VERSION*/);
  27. }
  28. public void testWeaveSealedClass() {
  29. runTest("weave sealed class");
  30. // TODO: replace 0 by Constants.PREVIEW_MINOR_VERSION after no longer using EA build, but final JDK version
  31. checkVersion("PersonAspect", Constants.MAJOR_17, 0 /*Constants.PREVIEW_MINOR_VERSION*/);
  32. }
  33. public void testAnnotationStyleSpecialIfClauses() {
  34. runTest("annotation style A");
  35. }
  36. public void testAnnotationStylePointcutInheritanceWithIfClauses() {
  37. runTest("annotation style B");
  38. }
  39. public static Test suite() {
  40. return XMLBasedAjcTestCase.loadSuite(Ajc198TestsJava.class);
  41. }
  42. @Override
  43. protected java.net.URL getSpecFile() {
  44. return getClassResource("ajc198.xml");
  45. }
  46. }