diff options
author | Alexander Kriegisch <Alexander@Kriegisch.name> | 2023-08-15 08:58:14 +0700 |
---|---|---|
committer | Alexander Kriegisch <Alexander@Kriegisch.name> | 2023-08-15 08:58:14 +0700 |
commit | 565f37b1970268234d9a823e2631ba3ed3e03037 (patch) | |
tree | dc627f09995beee7932da7056a2be279294d9c0e | |
parent | 364059c00f2393b8221cea29bdb6b7eabfd5b5c0 (diff) | |
download | aspectj-565f37b1970268234d9a823e2631ba3ed3e03037.tar.gz aspectj-565f37b1970268234d9a823e2631ba3ed3e03037.zip |
Move 1.9.20 bug regression tests to the correct spots
Originally, I had intended to release a minor 1.9.19.1 release to fix
some bugs. But then, Java 20 support was implemented and merged, so the
next release will be 1.9.20. Therefore, I moved some bug regression
tests to the 1.9.20 suite.
Relates to #254.
Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
-rw-r--r-- | tests/bugs1920/github_162/InterfaceWithInnerClass.java (renamed from tests/bugs1919/github_162/InterfaceWithInnerClass.java) | 0 | ||||
-rw-r--r-- | tests/bugs1920/github_190/SwitchCaseWith_Integer_MAX_VALUE.java (renamed from tests/bugs1919/github_190/SwitchCaseWith_Integer_MAX_VALUE.java) | 0 | ||||
-rw-r--r-- | tests/bugs1920/github_20/ParenthesisedAJKeywords.java (renamed from tests/bugs1919/github_20/ParenthesisedAJKeywords.java) | 0 | ||||
-rw-r--r-- | tests/bugs1920/github_214/Application.java (renamed from tests/bugs1919/github_214/Application.java) | 0 | ||||
-rw-r--r-- | tests/bugs1920/github_214/FirstAspect.java (renamed from tests/bugs1919/github_214/FirstAspect.java) | 0 | ||||
-rw-r--r-- | tests/bugs1920/github_214/MarkerOne.java (renamed from tests/bugs1919/github_214/MarkerOne.java) | 0 | ||||
-rw-r--r-- | tests/bugs1920/github_214/MarkerTwo.java (renamed from tests/bugs1919/github_214/MarkerTwo.java) | 0 | ||||
-rw-r--r-- | tests/bugs1920/github_214/SecondAspect.java (renamed from tests/bugs1919/github_214/SecondAspect.java) | 0 | ||||
-rw-r--r-- | tests/bugs1920/github_24/ExactlyMatchingAspect.aj (renamed from tests/bugs1919/github_24/ExactlyMatchingAspect.aj) | 0 | ||||
-rw-r--r-- | tests/bugs1920/github_24/FuzzilyMatchingAspect.aj (renamed from tests/bugs1919/github_24/FuzzilyMatchingAspect.aj) | 0 | ||||
-rw-r--r-- | tests/bugs1920/github_24/MaybeMissingClass.java (renamed from tests/bugs1919/github_24/MaybeMissingClass.java) | 0 | ||||
-rw-r--r-- | tests/src/test/java/org/aspectj/systemtest/ajc1919/Bugs1919Tests.java | 32 | ||||
-rw-r--r-- | tests/src/test/java/org/aspectj/systemtest/ajc1920/Bugs1920Tests.java | 32 | ||||
-rw-r--r-- | tests/src/test/resources/org/aspectj/systemtest/ajc1919/ajc1919.xml | 215 | ||||
-rw-r--r-- | tests/src/test/resources/org/aspectj/systemtest/ajc1920/ajc1920.xml | 215 |
15 files changed, 247 insertions, 247 deletions
diff --git a/tests/bugs1919/github_162/InterfaceWithInnerClass.java b/tests/bugs1920/github_162/InterfaceWithInnerClass.java index f26975cc0..f26975cc0 100644 --- a/tests/bugs1919/github_162/InterfaceWithInnerClass.java +++ b/tests/bugs1920/github_162/InterfaceWithInnerClass.java diff --git a/tests/bugs1919/github_190/SwitchCaseWith_Integer_MAX_VALUE.java b/tests/bugs1920/github_190/SwitchCaseWith_Integer_MAX_VALUE.java index d083fe60f..d083fe60f 100644 --- a/tests/bugs1919/github_190/SwitchCaseWith_Integer_MAX_VALUE.java +++ b/tests/bugs1920/github_190/SwitchCaseWith_Integer_MAX_VALUE.java diff --git a/tests/bugs1919/github_20/ParenthesisedAJKeywords.java b/tests/bugs1920/github_20/ParenthesisedAJKeywords.java index 1ba013c57..1ba013c57 100644 --- a/tests/bugs1919/github_20/ParenthesisedAJKeywords.java +++ b/tests/bugs1920/github_20/ParenthesisedAJKeywords.java diff --git a/tests/bugs1919/github_214/Application.java b/tests/bugs1920/github_214/Application.java index 5401e0875..5401e0875 100644 --- a/tests/bugs1919/github_214/Application.java +++ b/tests/bugs1920/github_214/Application.java diff --git a/tests/bugs1919/github_214/FirstAspect.java b/tests/bugs1920/github_214/FirstAspect.java index 274e3a122..274e3a122 100644 --- a/tests/bugs1919/github_214/FirstAspect.java +++ b/tests/bugs1920/github_214/FirstAspect.java diff --git a/tests/bugs1919/github_214/MarkerOne.java b/tests/bugs1920/github_214/MarkerOne.java index c59c42afc..c59c42afc 100644 --- a/tests/bugs1919/github_214/MarkerOne.java +++ b/tests/bugs1920/github_214/MarkerOne.java diff --git a/tests/bugs1919/github_214/MarkerTwo.java b/tests/bugs1920/github_214/MarkerTwo.java index 213851d93..213851d93 100644 --- a/tests/bugs1919/github_214/MarkerTwo.java +++ b/tests/bugs1920/github_214/MarkerTwo.java diff --git a/tests/bugs1919/github_214/SecondAspect.java b/tests/bugs1920/github_214/SecondAspect.java index a4cc1bdb2..a4cc1bdb2 100644 --- a/tests/bugs1919/github_214/SecondAspect.java +++ b/tests/bugs1920/github_214/SecondAspect.java diff --git a/tests/bugs1919/github_24/ExactlyMatchingAspect.aj b/tests/bugs1920/github_24/ExactlyMatchingAspect.aj index a884d00fc..a884d00fc 100644 --- a/tests/bugs1919/github_24/ExactlyMatchingAspect.aj +++ b/tests/bugs1920/github_24/ExactlyMatchingAspect.aj diff --git a/tests/bugs1919/github_24/FuzzilyMatchingAspect.aj b/tests/bugs1920/github_24/FuzzilyMatchingAspect.aj index b40c13c62..b40c13c62 100644 --- a/tests/bugs1919/github_24/FuzzilyMatchingAspect.aj +++ b/tests/bugs1920/github_24/FuzzilyMatchingAspect.aj diff --git a/tests/bugs1919/github_24/MaybeMissingClass.java b/tests/bugs1920/github_24/MaybeMissingClass.java index 17952583b..17952583b 100644 --- a/tests/bugs1919/github_24/MaybeMissingClass.java +++ b/tests/bugs1920/github_24/MaybeMissingClass.java diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc1919/Bugs1919Tests.java b/tests/src/test/java/org/aspectj/systemtest/ajc1919/Bugs1919Tests.java index ba4f99ade..3c921f51a 100644 --- a/tests/src/test/java/org/aspectj/systemtest/ajc1919/Bugs1919Tests.java +++ b/tests/src/test/java/org/aspectj/systemtest/ajc1919/Bugs1919Tests.java @@ -19,38 +19,6 @@ public class Bugs1919Tests extends XMLBasedAjcTestCase { runTest("declare annotation with SOURCE retention"); } - public void testSwitchWith_Integer_MAX_VALUE() { - runTest("switch with Integer.MAX_VALUE case"); - } - - public void testParenthesisedExpressionWithAjKeyword() { - runTest("parenthesised expression with AspectJ keyword"); - } - - public void testInterfaceInnerAspectImplicitlyStatic() { - runTest("inner aspect of interface is implicitly static"); - } - - public void testExactArrayTypeMatchCompiledTogether() { - runTest("exact array type matching, aspect compiled together with target class"); - } - - public void testExactArrayTypeMatchCompiledSeparately() { - runTest("exact array type matching, aspect compiled separately from target class"); - } - - public void testFuzzyArrayTypeMatchCompiledTogether() { - runTest("fuzzy array type matching, aspect compiled together with target class"); - } - - public void testFuzzyArrayTypeMatchCompiledSeparately() { - runTest("fuzzy array type matching, aspect compiled separately from target class"); - } - - public void test_GitHub_214() { - runTest("ArrayIndexOutOfBoundsException with Xlint unorderedAdviceAtShadow=warning"); - } - public static Test suite() { return XMLBasedAjcTestCase.loadSuite(Bugs1919Tests.class); } diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc1920/Bugs1920Tests.java b/tests/src/test/java/org/aspectj/systemtest/ajc1920/Bugs1920Tests.java index 593fdb198..574f1b7aa 100644 --- a/tests/src/test/java/org/aspectj/systemtest/ajc1920/Bugs1920Tests.java +++ b/tests/src/test/java/org/aspectj/systemtest/ajc1920/Bugs1920Tests.java @@ -15,6 +15,38 @@ import org.aspectj.testing.XMLBasedAjcTestCase; */ public class Bugs1920Tests extends XMLBasedAjcTestCase { + public void testSwitchWith_Integer_MAX_VALUE() { + runTest("switch with Integer.MAX_VALUE case"); + } + + public void testParenthesisedExpressionWithAjKeyword() { + runTest("parenthesised expression with AspectJ keyword"); + } + + public void testInterfaceInnerAspectImplicitlyStatic() { + runTest("inner aspect of interface is implicitly static"); + } + + public void testExactArrayTypeMatchCompiledTogether() { + runTest("exact array type matching, aspect compiled together with target class"); + } + + public void testExactArrayTypeMatchCompiledSeparately() { + runTest("exact array type matching, aspect compiled separately from target class"); + } + + public void testFuzzyArrayTypeMatchCompiledTogether() { + runTest("fuzzy array type matching, aspect compiled together with target class"); + } + + public void testFuzzyArrayTypeMatchCompiledSeparately() { + runTest("fuzzy array type matching, aspect compiled separately from target class"); + } + + public void test_GitHub_214() { + runTest("ArrayIndexOutOfBoundsException with Xlint unorderedAdviceAtShadow=warning"); + } + /** * Add correct annotations to multiple ITD methods with the same name and same number of arguments, i.e. copy the * annotations correctly from the aspect into the target class instead of falsely always copying the annotations (if diff --git a/tests/src/test/resources/org/aspectj/systemtest/ajc1919/ajc1919.xml b/tests/src/test/resources/org/aspectj/systemtest/ajc1919/ajc1919.xml index f8bccce64..dd3f2b1a2 100644 --- a/tests/src/test/resources/org/aspectj/systemtest/ajc1919/ajc1919.xml +++ b/tests/src/test/resources/org/aspectj/systemtest/ajc1919/ajc1919.xml @@ -172,219 +172,4 @@ </compile> </ajc-test> - <!-- RuntimeException in BcelWeaver, see https://github.com/eclipse/org.aspectj/issues/190 --> - <ajc-test dir="bugs1919/github_190" vm="1.5" title="switch with Integer.MAX_VALUE case"> - <compile files="SwitchCaseWith_Integer_MAX_VALUE.java" options="-1.5 -showWeaveInfo"> - <message kind="weave" text="Join point 'method-execution(java.lang.String SwitchCaseWith_Integer_MAX_VALUE.switchTest(int))'"/> - </compile> - <run class="SwitchCaseWith_Integer_MAX_VALUE"> - <stdout> - <line text="execution(String SwitchCaseWith_Integer_MAX_VALUE.switchTest(int))"/> - <line text="CASE_1"/> - </stdout> - </run> - </ajc-test> - - <!-- - 'Syntax error, insert "Expression" to complete Expression' when compiling parenthesised expressions - containing AspectJ keywords, e.g. '(before)', see https://github.com/eclipse/org.aspectj/issues/20 - --> - <ajc-test dir="bugs1919/github_20" vm="1.5" title="parenthesised expression with AspectJ keyword"> - <compile files="ParenthesisedAJKeywords.java" options="-1.5 -showWeaveInfo"/> - <run class="ParenthesisedAJKeywords"> - <stdout> - <line text="before"/> - <line text="after"/> - <line text="around"/> - <line text="aspect"/> - <line text="pointcut"/> - <line text="declare"/> - <line text="privileged"/> - </stdout> - </run> - </ajc-test> - - <!-- - 'inner aspects must be static' when compiling an interface with an inner aspect which was not explicitly declared - static, see https://github.com/eclipse/org.aspectj/issues/162 - --> - <ajc-test dir="bugs1919/github_162" vm="1.5" title="inner aspect of interface is implicitly static"> - <compile files="InterfaceWithInnerClass.java" options="-1.5 -showWeaveInfo"> - <message kind="weave" text="method-execution(int InterfaceWithInnerClass$ImplicitlyStatic.getNumber())' in Type 'InterfaceWithInnerClass$ImplicitlyStatic'"/> - <message kind="weave" text="method-execution(void InterfaceWithInnerClass$ImplicitlyStatic.main(java.lang.String[]))' in Type 'InterfaceWithInnerClass$ImplicitlyStatic'"/> - </compile> - <run class="InterfaceWithInnerClass$ImplicitlyStatic"> - <stdout> - <line text="execution(void InterfaceWithInnerClass.ImplicitlyStatic.main(String[]))"/> - <line text="execution(int InterfaceWithInnerClass.ImplicitlyStatic.getNumber())"/> - <line text="11"/> - </stdout> - </run> - </ajc-test> - - <!-- - When compiling aspect and target class together, matching works as expected, - see https://github.com/eclipse/org.aspectj/issues/24 - --> - <ajc-test dir="bugs1919/github_24" vm="1.5" title="exact array type matching, aspect compiled together with target class"> - <compile files="ExactlyMatchingAspect.aj MaybeMissingClass.java" options="-1.5 -showWeaveInfo"> - <!-- Even before the bugfix, in this case weaving worked as expected --> - <message kind="weave" text="method-execution(MaybeMissingClass MaybeMissingClass.f1())"/> - <message kind="weave" text="method-execution(MaybeMissingClass[] MaybeMissingClass.f2())"/> - <message kind="weave" text="method-execution(MaybeMissingClass[][] MaybeMissingClass.f3())"/> - <message kind="weave" text="method-execution(int MaybeMissingClass.f4())"/> - <message kind="weave" text="method-execution(int[] MaybeMissingClass.f5())"/> - <message kind="weave" text="method-execution(int[][] MaybeMissingClass.f6())"/> - </compile> - <run class="MaybeMissingClass"> - <stdout> - <line text="MaybeMissingClass.f1"/> - <line text="execution(MaybeMissingClass MaybeMissingClass.f1())"/> - <line text="MaybeMissingClass.f2"/> - <line text="execution(MaybeMissingClass[] MaybeMissingClass.f2())"/> - <line text="MaybeMissingClass.f3"/> - <line text="execution(MaybeMissingClass[][] MaybeMissingClass.f3())"/> - <line text="MaybeMissingClass.f4"/> - <line text="execution(int MaybeMissingClass.f4())"/> - <line text="MaybeMissingClass.f5"/> - <line text="execution(int[] MaybeMissingClass.f5())"/> - <line text="MaybeMissingClass.f6"/> - <line text="execution(int[][] MaybeMissingClass.f6())"/> - </stdout> - </run> - </ajc-test> - - <!-- - When compiling aspect and target class separately, too many joinpoints are matched, - see https://github.com/eclipse/org.aspectj/issues/24 - --> - <ajc-test dir="bugs1919/github_24" vm="1.5" title="exact array type matching, aspect compiled separately from target class"> - <compile files="ExactlyMatchingAspect.aj" options="-1.5 -showWeaveInfo" outjar="aspect.jar"> - <message kind="warning" text="no match for this type name: MaybeMissingClass [Xlint:invalidAbsoluteTypeName]"/> - <message kind="warning" text="advice defined in ExactlyMatchingAspect has not been applied [Xlint:adviceDidNotMatch]"/> - </compile> - <compile files="MaybeMissingClass.java" options="-1.5 -showWeaveInfo" aspectpath="aspect.jar"> - <!-- Before the bugfix, f1 would be woven twice, f2 not at all--> - <message kind="weave" text="method-execution(MaybeMissingClass MaybeMissingClass.f1())"/> - <message kind="weave" text="method-execution(MaybeMissingClass[] MaybeMissingClass.f2())"/> - <message kind="weave" text="method-execution(MaybeMissingClass[][] MaybeMissingClass.f3())"/> - <message kind="weave" text="method-execution(int MaybeMissingClass.f4())"/> - <message kind="weave" text="method-execution(int[] MaybeMissingClass.f5())"/> - <message kind="weave" text="method-execution(int[][] MaybeMissingClass.f6())"/> - </compile> - <run class="MaybeMissingClass" classpath="aspect.jar"> - <stdout> - <line text="MaybeMissingClass.f1"/> - <line text="execution(MaybeMissingClass MaybeMissingClass.f1())"/> - <line text="MaybeMissingClass.f2"/> - <line text="execution(MaybeMissingClass[] MaybeMissingClass.f2())"/> - <line text="MaybeMissingClass.f3"/> - <line text="execution(MaybeMissingClass[][] MaybeMissingClass.f3())"/> - <line text="MaybeMissingClass.f4"/> - <line text="execution(int MaybeMissingClass.f4())"/> - <line text="MaybeMissingClass.f5"/> - <line text="execution(int[] MaybeMissingClass.f5())"/> - <line text="MaybeMissingClass.f6"/> - <line text="execution(int[][] MaybeMissingClass.f6())"/> - </stdout> - </run> - </ajc-test> - - <!-- - When compiling aspect and target class together, too many joinpoints are matched, - see https://github.com/eclipse/org.aspectj/issues/24 - --> - <ajc-test dir="bugs1919/github_24" vm="1.5" title="fuzzy array type matching, aspect compiled together with target class"> - <compile files="FuzzilyMatchingAspect.aj MaybeMissingClass.java" options="-1.5 -showWeaveInfo"> - <!-- Before the bugfix, both f1 and f2 would be woven twice --> - <message kind="weave" text="method-execution(MaybeMissingClass MaybeMissingClass.f1())"/> - <message kind="weave" text="method-execution(MaybeMissingClass[] MaybeMissingClass.f2())"/> - <message kind="weave" text="method-execution(MaybeMissingClass[][] MaybeMissingClass.f3())"/> - <message kind="weave" text="method-execution(int MaybeMissingClass.f4())"/> - <message kind="weave" text="method-execution(int[] MaybeMissingClass.f5())"/> - <message kind="weave" text="method-execution(int[][] MaybeMissingClass.f6())"/> - </compile> - <run class="MaybeMissingClass"> - <stdout> - <line text="MaybeMissingClass.f1"/> - <line text="execution(MaybeMissingClass MaybeMissingClass.f1())"/> - <line text="MaybeMissingClass.f2"/> - <line text="execution(MaybeMissingClass[] MaybeMissingClass.f2())"/> - <line text="MaybeMissingClass.f3"/> - <line text="execution(MaybeMissingClass[][] MaybeMissingClass.f3())"/> - <line text="MaybeMissingClass.f4"/> - <line text="execution(int MaybeMissingClass.f4())"/> - <line text="MaybeMissingClass.f5"/> - <line text="execution(int[] MaybeMissingClass.f5())"/> - <line text="MaybeMissingClass.f6"/> - <line text="execution(int[][] MaybeMissingClass.f6())"/> - </stdout> - </run> - </ajc-test> - - <!-- - When compiling aspect and target class separately, too many joinpoints are matched, - see https://github.com/eclipse/org.aspectj/issues/24 - --> - <ajc-test dir="bugs1919/github_24" vm="1.5" title="fuzzy array type matching, aspect compiled separately from target class"> - <compile files="FuzzilyMatchingAspect.aj" options="-1.5 -showWeaveInfo" outjar="aspect.jar"> - <message kind="warning" text="advice defined in FuzzilyMatchingAspect has not been applied [Xlint:adviceDidNotMatch]"/> - </compile> - <compile files="MaybeMissingClass.java" options="-1.5 -showWeaveInfo" aspectpath="aspect.jar"> - <!-- Before the bugfix, both f1 and f2 would be woven twice --> - <message kind="weave" text="method-execution(MaybeMissingClass MaybeMissingClass.f1())"/> - <message kind="weave" text="method-execution(MaybeMissingClass[] MaybeMissingClass.f2())"/> - <message kind="weave" text="method-execution(MaybeMissingClass[][] MaybeMissingClass.f3())"/> - <message kind="weave" text="method-execution(int MaybeMissingClass.f4())"/> - <message kind="weave" text="method-execution(int[] MaybeMissingClass.f5())"/> - <message kind="weave" text="method-execution(int[][] MaybeMissingClass.f6())"/> - </compile> - <run class="MaybeMissingClass" classpath="aspect.jar"> - <stdout> - <line text="MaybeMissingClass.f1"/> - <line text="execution(MaybeMissingClass MaybeMissingClass.f1())"/> - <line text="MaybeMissingClass.f2"/> - <line text="execution(MaybeMissingClass[] MaybeMissingClass.f2())"/> - <line text="MaybeMissingClass.f3"/> - <line text="execution(MaybeMissingClass[][] MaybeMissingClass.f3())"/> - <line text="MaybeMissingClass.f4"/> - <line text="execution(int MaybeMissingClass.f4())"/> - <line text="MaybeMissingClass.f5"/> - <line text="execution(int[] MaybeMissingClass.f5())"/> - <line text="MaybeMissingClass.f6"/> - <line text="execution(int[][] MaybeMissingClass.f6())"/> - </stdout> - </run> - </ajc-test> - - <!-- - https://github.com/eclipse/org.aspectj/issues/214 - https://github.com/mojohaus/aspectj-maven-plugin/issues/164 - Problem with multiple, subsequent weaving steps and '-Xlint:warning' or '-Xlint:unorderedAdviceAtShadow=warning' - java.lang.ArrayIndexOutOfBoundsException: 1 - [ERROR] at org.aspectj.weaver.bcel.BcelShadow.prepareForMungers(BcelShadow.java:379) - [ERROR] at org.aspectj.weaver.Shadow.implement(Shadow.java:546) - --> - <ajc-test dir="bugs1919/github_214" vm="1.5" title="ArrayIndexOutOfBoundsException with Xlint unorderedAdviceAtShadow=warning"> - <compile files="FirstAspect.java MarkerOne.java" options="-1.8 -showWeaveInfo -Xlint:warning" outjar="first-aspect.jar"> - <message kind="warning" text="can not build thisJoinPoint lazily for this advice since it has no suitable guard [Xlint:noGuardForLazyTjp]"/> - <message kind="warning" text="advice defined in FirstAspect has not been applied [Xlint:adviceDidNotMatch]"/> - </compile> - <compile files="Application.java MarkerTwo.java" options="-1.5 -showWeaveInfo -Xlint:warning" classpath="$sandbox/first-aspect.jar" outjar="application.jar"/> - <compile files="SecondAspect.java" options="-1.5 -showWeaveInfo -Xlint:warning" aspectpath="first-aspect.jar" inpath="application.jar" outjar="second-aspect.jar"> - <message kind="warning" text="can not build thisJoinPoint lazily for this advice since it has no suitable guard [Xlint:noGuardForLazyTjp]"/> - <message kind="warning" text="at this shadow method-execution(void Application.greet(java.lang.String)) no precedence is specified between advice applying from aspect FirstAspect and aspect SecondAspect [Xlint:unorderedAdviceAtShadow]"/> - <message kind="warning" text="can not implement lazyTjp at joinpoint method-execution(void Application.greet(java.lang.String)) because of advice conflicts, see secondary locations to find conflicting advice [Xlint:multipleAdviceStoppingLazyTjp]"/> - <message kind="weave" text="method-execution(void Application.greet(java.lang.String))' in Type 'Application' (Application.java:4) advised by around advice from 'SecondAspect'"/> - <message kind="weave" text="method-execution(void Application.greet(java.lang.String))' in Type 'Application' (Application.java:4) advised by before advice from 'FirstAspect'"/> - </compile> - <run class="Application" classpath="$sandbox/second-aspect.jar,$sandbox/first-aspect.jar"> - <stdout> - <line text="FirstAspect: execution(void Application.greet(String))"/> - <line text="SecondAspect: execution(void Application.greet(String))"/> - <line text="Hello world!"/> - </stdout> - </run> - </ajc-test> - </suite> diff --git a/tests/src/test/resources/org/aspectj/systemtest/ajc1920/ajc1920.xml b/tests/src/test/resources/org/aspectj/systemtest/ajc1920/ajc1920.xml index ed301b4f3..402f50a2f 100644 --- a/tests/src/test/resources/org/aspectj/systemtest/ajc1920/ajc1920.xml +++ b/tests/src/test/resources/org/aspectj/systemtest/ajc1920/ajc1920.xml @@ -176,6 +176,221 @@ </run> </ajc-test> + <!-- RuntimeException in BcelWeaver, see https://github.com/eclipse/org.aspectj/issues/190 --> + <ajc-test dir="bugs1920/github_190" vm="1.5" title="switch with Integer.MAX_VALUE case"> + <compile files="SwitchCaseWith_Integer_MAX_VALUE.java" options="-1.5 -showWeaveInfo"> + <message kind="weave" text="Join point 'method-execution(java.lang.String SwitchCaseWith_Integer_MAX_VALUE.switchTest(int))'"/> + </compile> + <run class="SwitchCaseWith_Integer_MAX_VALUE"> + <stdout> + <line text="execution(String SwitchCaseWith_Integer_MAX_VALUE.switchTest(int))"/> + <line text="CASE_1"/> + </stdout> + </run> + </ajc-test> + + <!-- + 'Syntax error, insert "Expression" to complete Expression' when compiling parenthesised expressions + containing AspectJ keywords, e.g. '(before)', see https://github.com/eclipse/org.aspectj/issues/20 + --> + <ajc-test dir="bugs1920/github_20" vm="1.5" title="parenthesised expression with AspectJ keyword"> + <compile files="ParenthesisedAJKeywords.java" options="-1.5 -showWeaveInfo"/> + <run class="ParenthesisedAJKeywords"> + <stdout> + <line text="before"/> + <line text="after"/> + <line text="around"/> + <line text="aspect"/> + <line text="pointcut"/> + <line text="declare"/> + <line text="privileged"/> + </stdout> + </run> + </ajc-test> + + <!-- + 'inner aspects must be static' when compiling an interface with an inner aspect which was not explicitly declared + static, see https://github.com/eclipse/org.aspectj/issues/162 + --> + <ajc-test dir="bugs1920/github_162" vm="1.5" title="inner aspect of interface is implicitly static"> + <compile files="InterfaceWithInnerClass.java" options="-1.5 -showWeaveInfo"> + <message kind="weave" text="method-execution(int InterfaceWithInnerClass$ImplicitlyStatic.getNumber())' in Type 'InterfaceWithInnerClass$ImplicitlyStatic'"/> + <message kind="weave" text="method-execution(void InterfaceWithInnerClass$ImplicitlyStatic.main(java.lang.String[]))' in Type 'InterfaceWithInnerClass$ImplicitlyStatic'"/> + </compile> + <run class="InterfaceWithInnerClass$ImplicitlyStatic"> + <stdout> + <line text="execution(void InterfaceWithInnerClass.ImplicitlyStatic.main(String[]))"/> + <line text="execution(int InterfaceWithInnerClass.ImplicitlyStatic.getNumber())"/> + <line text="11"/> + </stdout> + </run> + </ajc-test> + + <!-- + When compiling aspect and target class together, matching works as expected, + see https://github.com/eclipse/org.aspectj/issues/24 + --> + <ajc-test dir="bugs1920/github_24" vm="1.5" title="exact array type matching, aspect compiled together with target class"> + <compile files="ExactlyMatchingAspect.aj MaybeMissingClass.java" options="-1.5 -showWeaveInfo"> + <!-- Even before the bugfix, in this case weaving worked as expected --> + <message kind="weave" text="method-execution(MaybeMissingClass MaybeMissingClass.f1())"/> + <message kind="weave" text="method-execution(MaybeMissingClass[] MaybeMissingClass.f2())"/> + <message kind="weave" text="method-execution(MaybeMissingClass[][] MaybeMissingClass.f3())"/> + <message kind="weave" text="method-execution(int MaybeMissingClass.f4())"/> + <message kind="weave" text="method-execution(int[] MaybeMissingClass.f5())"/> + <message kind="weave" text="method-execution(int[][] MaybeMissingClass.f6())"/> + </compile> + <run class="MaybeMissingClass"> + <stdout> + <line text="MaybeMissingClass.f1"/> + <line text="execution(MaybeMissingClass MaybeMissingClass.f1())"/> + <line text="MaybeMissingClass.f2"/> + <line text="execution(MaybeMissingClass[] MaybeMissingClass.f2())"/> + <line text="MaybeMissingClass.f3"/> + <line text="execution(MaybeMissingClass[][] MaybeMissingClass.f3())"/> + <line text="MaybeMissingClass.f4"/> + <line text="execution(int MaybeMissingClass.f4())"/> + <line text="MaybeMissingClass.f5"/> + <line text="execution(int[] MaybeMissingClass.f5())"/> + <line text="MaybeMissingClass.f6"/> + <line text="execution(int[][] MaybeMissingClass.f6())"/> + </stdout> + </run> + </ajc-test> + + <!-- + When compiling aspect and target class separately, too many joinpoints are matched, + see https://github.com/eclipse/org.aspectj/issues/24 + --> + <ajc-test dir="bugs1920/github_24" vm="1.5" title="exact array type matching, aspect compiled separately from target class"> + <compile files="ExactlyMatchingAspect.aj" options="-1.5 -showWeaveInfo" outjar="aspect.jar"> + <message kind="warning" text="no match for this type name: MaybeMissingClass [Xlint:invalidAbsoluteTypeName]"/> + <message kind="warning" text="advice defined in ExactlyMatchingAspect has not been applied [Xlint:adviceDidNotMatch]"/> + </compile> + <compile files="MaybeMissingClass.java" options="-1.5 -showWeaveInfo" aspectpath="aspect.jar"> + <!-- Before the bugfix, f1 would be woven twice, f2 not at all--> + <message kind="weave" text="method-execution(MaybeMissingClass MaybeMissingClass.f1())"/> + <message kind="weave" text="method-execution(MaybeMissingClass[] MaybeMissingClass.f2())"/> + <message kind="weave" text="method-execution(MaybeMissingClass[][] MaybeMissingClass.f3())"/> + <message kind="weave" text="method-execution(int MaybeMissingClass.f4())"/> + <message kind="weave" text="method-execution(int[] MaybeMissingClass.f5())"/> + <message kind="weave" text="method-execution(int[][] MaybeMissingClass.f6())"/> + </compile> + <run class="MaybeMissingClass" classpath="aspect.jar"> + <stdout> + <line text="MaybeMissingClass.f1"/> + <line text="execution(MaybeMissingClass MaybeMissingClass.f1())"/> + <line text="MaybeMissingClass.f2"/> + <line text="execution(MaybeMissingClass[] MaybeMissingClass.f2())"/> + <line text="MaybeMissingClass.f3"/> + <line text="execution(MaybeMissingClass[][] MaybeMissingClass.f3())"/> + <line text="MaybeMissingClass.f4"/> + <line text="execution(int MaybeMissingClass.f4())"/> + <line text="MaybeMissingClass.f5"/> + <line text="execution(int[] MaybeMissingClass.f5())"/> + <line text="MaybeMissingClass.f6"/> + <line text="execution(int[][] MaybeMissingClass.f6())"/> + </stdout> + </run> + </ajc-test> + + <!-- + When compiling aspect and target class together, too many joinpoints are matched, + see https://github.com/eclipse/org.aspectj/issues/24 + --> + <ajc-test dir="bugs1920/github_24" vm="1.5" title="fuzzy array type matching, aspect compiled together with target class"> + <compile files="FuzzilyMatchingAspect.aj MaybeMissingClass.java" options="-1.5 -showWeaveInfo"> + <!-- Before the bugfix, both f1 and f2 would be woven twice --> + <message kind="weave" text="method-execution(MaybeMissingClass MaybeMissingClass.f1())"/> + <message kind="weave" text="method-execution(MaybeMissingClass[] MaybeMissingClass.f2())"/> + <message kind="weave" text="method-execution(MaybeMissingClass[][] MaybeMissingClass.f3())"/> + <message kind="weave" text="method-execution(int MaybeMissingClass.f4())"/> + <message kind="weave" text="method-execution(int[] MaybeMissingClass.f5())"/> + <message kind="weave" text="method-execution(int[][] MaybeMissingClass.f6())"/> + </compile> + <run class="MaybeMissingClass"> + <stdout> + <line text="MaybeMissingClass.f1"/> + <line text="execution(MaybeMissingClass MaybeMissingClass.f1())"/> + <line text="MaybeMissingClass.f2"/> + <line text="execution(MaybeMissingClass[] MaybeMissingClass.f2())"/> + <line text="MaybeMissingClass.f3"/> + <line text="execution(MaybeMissingClass[][] MaybeMissingClass.f3())"/> + <line text="MaybeMissingClass.f4"/> + <line text="execution(int MaybeMissingClass.f4())"/> + <line text="MaybeMissingClass.f5"/> + <line text="execution(int[] MaybeMissingClass.f5())"/> + <line text="MaybeMissingClass.f6"/> + <line text="execution(int[][] MaybeMissingClass.f6())"/> + </stdout> + </run> + </ajc-test> + + <!-- + When compiling aspect and target class separately, too many joinpoints are matched, + see https://github.com/eclipse/org.aspectj/issues/24 + --> + <ajc-test dir="bugs1920/github_24" vm="1.5" title="fuzzy array type matching, aspect compiled separately from target class"> + <compile files="FuzzilyMatchingAspect.aj" options="-1.5 -showWeaveInfo" outjar="aspect.jar"> + <message kind="warning" text="advice defined in FuzzilyMatchingAspect has not been applied [Xlint:adviceDidNotMatch]"/> + </compile> + <compile files="MaybeMissingClass.java" options="-1.5 -showWeaveInfo" aspectpath="aspect.jar"> + <!-- Before the bugfix, both f1 and f2 would be woven twice --> + <message kind="weave" text="method-execution(MaybeMissingClass MaybeMissingClass.f1())"/> + <message kind="weave" text="method-execution(MaybeMissingClass[] MaybeMissingClass.f2())"/> + <message kind="weave" text="method-execution(MaybeMissingClass[][] MaybeMissingClass.f3())"/> + <message kind="weave" text="method-execution(int MaybeMissingClass.f4())"/> + <message kind="weave" text="method-execution(int[] MaybeMissingClass.f5())"/> + <message kind="weave" text="method-execution(int[][] MaybeMissingClass.f6())"/> + </compile> + <run class="MaybeMissingClass" classpath="aspect.jar"> + <stdout> + <line text="MaybeMissingClass.f1"/> + <line text="execution(MaybeMissingClass MaybeMissingClass.f1())"/> + <line text="MaybeMissingClass.f2"/> + <line text="execution(MaybeMissingClass[] MaybeMissingClass.f2())"/> + <line text="MaybeMissingClass.f3"/> + <line text="execution(MaybeMissingClass[][] MaybeMissingClass.f3())"/> + <line text="MaybeMissingClass.f4"/> + <line text="execution(int MaybeMissingClass.f4())"/> + <line text="MaybeMissingClass.f5"/> + <line text="execution(int[] MaybeMissingClass.f5())"/> + <line text="MaybeMissingClass.f6"/> + <line text="execution(int[][] MaybeMissingClass.f6())"/> + </stdout> + </run> + </ajc-test> + + <!-- + https://github.com/eclipse/org.aspectj/issues/214 + https://github.com/mojohaus/aspectj-maven-plugin/issues/164 + Problem with multiple, subsequent weaving steps and '-Xlint:warning' or '-Xlint:unorderedAdviceAtShadow=warning' + java.lang.ArrayIndexOutOfBoundsException: 1 + [ERROR] at org.aspectj.weaver.bcel.BcelShadow.prepareForMungers(BcelShadow.java:379) + [ERROR] at org.aspectj.weaver.Shadow.implement(Shadow.java:546) + --> + <ajc-test dir="bugs1920/github_214" vm="1.5" title="ArrayIndexOutOfBoundsException with Xlint unorderedAdviceAtShadow=warning"> + <compile files="FirstAspect.java MarkerOne.java" options="-1.8 -showWeaveInfo -Xlint:warning" outjar="first-aspect.jar"> + <message kind="warning" text="can not build thisJoinPoint lazily for this advice since it has no suitable guard [Xlint:noGuardForLazyTjp]"/> + <message kind="warning" text="advice defined in FirstAspect has not been applied [Xlint:adviceDidNotMatch]"/> + </compile> + <compile files="Application.java MarkerTwo.java" options="-1.5 -showWeaveInfo -Xlint:warning" classpath="$sandbox/first-aspect.jar" outjar="application.jar"/> + <compile files="SecondAspect.java" options="-1.5 -showWeaveInfo -Xlint:warning" aspectpath="first-aspect.jar" inpath="application.jar" outjar="second-aspect.jar"> + <message kind="warning" text="can not build thisJoinPoint lazily for this advice since it has no suitable guard [Xlint:noGuardForLazyTjp]"/> + <message kind="warning" text="at this shadow method-execution(void Application.greet(java.lang.String)) no precedence is specified between advice applying from aspect FirstAspect and aspect SecondAspect [Xlint:unorderedAdviceAtShadow]"/> + <message kind="warning" text="can not implement lazyTjp at joinpoint method-execution(void Application.greet(java.lang.String)) because of advice conflicts, see secondary locations to find conflicting advice [Xlint:multipleAdviceStoppingLazyTjp]"/> + <message kind="weave" text="method-execution(void Application.greet(java.lang.String))' in Type 'Application' (Application.java:4) advised by around advice from 'SecondAspect'"/> + <message kind="weave" text="method-execution(void Application.greet(java.lang.String))' in Type 'Application' (Application.java:4) advised by before advice from 'FirstAspect'"/> + </compile> + <run class="Application" classpath="$sandbox/second-aspect.jar,$sandbox/first-aspect.jar"> + <stdout> + <line text="FirstAspect: execution(void Application.greet(String))"/> + <line text="SecondAspect: execution(void Application.greet(String))"/> + <line text="Hello world!"/> + </stdout> + </run> + </ajc-test> + <!-- https://github.com/eclipse-aspectj/aspectj/issues/246 --> <ajc-test dir="bugs1920/github_246" vm="8" title="add correct annotations to multiple ITD methods with the same name and same number of arguments"> <compile files="First.java Second.java App.java ITDAspect.aj" options="-8"/> |