aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src/test/resources/org
diff options
context:
space:
mode:
authorAlexander Kriegisch <Alexander@Kriegisch.name>2023-01-08 11:00:46 +0100
committerAlexander Kriegisch <Alexander@Kriegisch.name>2023-01-15 14:41:51 +0100
commitbe60722eab5c7f95d55df6f16baf41eaba671d85 (patch)
treef301704aefe30de7ca2ca4be56bc59f74012c72b /tests/src/test/resources/org
parent0e3d9f0dbc853b168cf84118490ddcb487f2aa0f (diff)
downloadaspectj-be60722eab5c7f95d55df6f16baf41eaba671d85.tar.gz
aspectj-be60722eab5c7f95d55df6f16baf41eaba671d85.zip
Add regression tests for GitHub bug #24
Relates to https://github.com/eclipse/org.aspectj/issues/24. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
Diffstat (limited to 'tests/src/test/resources/org')
-rw-r--r--tests/src/test/resources/org/aspectj/systemtest/ajc1919/ajc1919.xml92
1 files changed, 92 insertions, 0 deletions
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 f89455941..67c0b6328 100644
--- a/tests/src/test/resources/org/aspectj/systemtest/ajc1919/ajc1919.xml
+++ b/tests/src/test/resources/org/aspectj/systemtest/ajc1919/ajc1919.xml
@@ -222,4 +222,96 @@
</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())'"/>
+ </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())"/>
+ </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="no match for this type name: MaybeMissingClass [Xlint:invalidAbsoluteTypeName]"/>
+ <message kind="warning" text="no match for this type name: MaybeMissingClass [Xlint:invalidAbsoluteTypeName]"/>
+ <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]"/>
+ <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())'"/>
+ </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())"/>
+ </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())'"/>
+ </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())"/>
+ </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]"/>
+ <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())'"/>
+ </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())"/>
+ </stdout>
+ </run>
+ </ajc-test>
+
</suite>