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.

Bugs1921Tests.java 3.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. /*******************************************************************************
  2. * Copyright (c) 2023 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.ajc1921;
  9. import junit.framework.Test;
  10. import org.aspectj.testing.XMLBasedAjcTestCase;
  11. /**
  12. * @author Alexander Kriegisch
  13. */
  14. public class Bugs1921Tests extends XMLBasedAjcTestCase {
  15. public void testSwitchWith_Integer_MAX_VALUE() {
  16. runTest("switch with Integer.MAX_VALUE case");
  17. }
  18. public void testParenthesisedExpressionWithAjKeyword() {
  19. runTest("parenthesised expression with AspectJ keyword");
  20. }
  21. public void testInterfaceInnerAspectImplicitlyStatic() {
  22. runTest("inner aspect of interface is implicitly static");
  23. }
  24. public void testExactArrayTypeMatchCompiledTogether() {
  25. runTest("exact array type matching, aspect compiled together with target class");
  26. }
  27. public void testExactArrayTypeMatchCompiledSeparately() {
  28. runTest("exact array type matching, aspect compiled separately from target class");
  29. }
  30. public void testFuzzyArrayTypeMatchCompiledTogether() {
  31. runTest("fuzzy array type matching, aspect compiled together with target class");
  32. }
  33. public void testFuzzyArrayTypeMatchCompiledSeparately() {
  34. runTest("fuzzy array type matching, aspect compiled separately from target class");
  35. }
  36. public void test_GitHub_214() {
  37. runTest("ArrayIndexOutOfBoundsException with Xlint unorderedAdviceAtShadow=warning");
  38. }
  39. /**
  40. * Add correct annotations to multiple ITD methods with the same name and same number of arguments, i.e. copy the
  41. * annotations correctly from the aspect into the target class instead of falsely always copying the annotations (if
  42. * any) from the first ITD method found.
  43. * <p>
  44. * See <a href="https://github.com/eclipse-aspectj/aspectj/issues/246">GitHub issue 246</a>.
  45. */
  46. public void test_GitHub_246() {
  47. runTest("add correct annotations to multiple ITD methods with the same name and same number of arguments");
  48. }
  49. /**
  50. * Make sure to create one {@code ajc$inlineAccessMethod} for identically named (overloaded) private aspect methods.
  51. * <p>
  52. * See <a href="https://github.com/eclipse-aspectj/aspectj/issues/250">GitHub issue 250</a>.
  53. */
  54. public void test_GitHub_250() {
  55. runTest("correctly handle overloaded private methods in aspects");
  56. }
  57. /**
  58. * If one generic method overrides another one with a narrower return type, avoid matching bridge methods.
  59. * <p>
  60. * See <a href="https://github.com/spring-projects/spring-framework/issues/27761">Spring GitHub issue 27761</a>.
  61. * <p>
  62. * This test uses an ASM-modified class file reproducing the problem seen in Spring in plain AspectJ. Before the
  63. * bugfix, it fails with <b>"advice defined in RepositoryAspect has not been applied [Xlint:adviceDidNotMatch]".</b>
  64. */
  65. public void test_Spring_GitHub_27761() {
  66. runTest("do not match bridge methods");
  67. }
  68. /**
  69. * In 1.9.20, a regression bug occurred, matching negated types like '!void' and '!String' incorrectly.
  70. * <p>
  71. * See <a href="https://github.com/eclipse-aspectj/aspectj/issues/257">GitHub issue 257</a>.
  72. */
  73. public void test_GitHub_257() {
  74. runTest("handle negated type patterns correctly");
  75. }
  76. public static Test suite() {
  77. return XMLBasedAjcTestCase.loadSuite(Bugs1921Tests.class);
  78. }
  79. @Override
  80. protected java.net.URL getSpecFile() {
  81. return getClassResource("ajc1921.xml");
  82. }
  83. }