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 1.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. checkVersion("Employee", Constants.MAJOR_17, Constants.MINOR_17);
  20. checkVersion("Manager", Constants.MAJOR_17, Constants.MINOR_17);
  21. }
  22. public void testSealedClassWithIllegalSubclass() {
  23. runTest("sealed class with illegal subclass");
  24. checkVersion("Person", Constants.MAJOR_17, Constants.MINOR_17);
  25. }
  26. public void testWeaveSealedClass() {
  27. runTest("weave sealed class");
  28. checkVersion("PersonAspect", Constants.MAJOR_17, Constants.MINOR_17);
  29. }
  30. public static Test suite() {
  31. return XMLBasedAjcTestCase.loadSuite(Ajc198TestsJava.class);
  32. }
  33. @Override
  34. protected java.net.URL getSpecFile() {
  35. return getClassResource("ajc198.xml");
  36. }
  37. }