From be60722eab5c7f95d55df6f16baf41eaba671d85 Mon Sep 17 00:00:00 2001 From: Alexander Kriegisch Date: Sun, 8 Jan 2023 11:00:46 +0100 Subject: Add regression tests for GitHub bug #24 Relates to https://github.com/eclipse/org.aspectj/issues/24. Signed-off-by: Alexander Kriegisch --- tests/bugs1919/github_24/ExactlyMatchingAspect.aj | 9 +++ tests/bugs1919/github_24/FuzzilyMatchingAspect.aj | 9 +++ tests/bugs1919/github_24/MaybeMissingClass.java | 16 ++++ .../aspectj/systemtest/ajc1919/Bugs1919Tests.java | 16 ++++ .../org/aspectj/systemtest/ajc1919/ajc1919.xml | 92 ++++++++++++++++++++++ 5 files changed, 142 insertions(+) create mode 100644 tests/bugs1919/github_24/ExactlyMatchingAspect.aj create mode 100644 tests/bugs1919/github_24/FuzzilyMatchingAspect.aj create mode 100644 tests/bugs1919/github_24/MaybeMissingClass.java diff --git a/tests/bugs1919/github_24/ExactlyMatchingAspect.aj b/tests/bugs1919/github_24/ExactlyMatchingAspect.aj new file mode 100644 index 000000000..8a78394c3 --- /dev/null +++ b/tests/bugs1919/github_24/ExactlyMatchingAspect.aj @@ -0,0 +1,9 @@ +public aspect ExactlyMatchingAspect { + after() : execution(public MaybeMissingClass MaybeMissingClass.*()) { + System.out.println(thisJoinPoint); + } + + after() : execution(public MaybeMissingClass[] MaybeMissingClass.*()) { + System.out.println(thisJoinPoint); + } +} diff --git a/tests/bugs1919/github_24/FuzzilyMatchingAspect.aj b/tests/bugs1919/github_24/FuzzilyMatchingAspect.aj new file mode 100644 index 000000000..999282873 --- /dev/null +++ b/tests/bugs1919/github_24/FuzzilyMatchingAspect.aj @@ -0,0 +1,9 @@ +public aspect FuzzilyMatchingAspect { + after() : execution(public MaybeMissing* MaybeMissing*.*()) { + System.out.println(thisJoinPoint); + } + + after() : execution(public MaybeMissing*[] MaybeMissing*.*()) { + System.out.println(thisJoinPoint); + } +} diff --git a/tests/bugs1919/github_24/MaybeMissingClass.java b/tests/bugs1919/github_24/MaybeMissingClass.java new file mode 100644 index 000000000..3fa5fa274 --- /dev/null +++ b/tests/bugs1919/github_24/MaybeMissingClass.java @@ -0,0 +1,16 @@ +public class MaybeMissingClass { + public static void main(String[] args) { + f1(); + f2(); + } + + public static MaybeMissingClass f1() { + System.out.println("MaybeMissingClass.f1"); + return null; + } + + public static MaybeMissingClass[] f2() { + System.out.println("MaybeMissingClass.f2"); + return null; + } +} 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 ae3c54398..c20f9f2cf 100644 --- a/tests/src/test/java/org/aspectj/systemtest/ajc1919/Bugs1919Tests.java +++ b/tests/src/test/java/org/aspectj/systemtest/ajc1919/Bugs1919Tests.java @@ -31,6 +31,22 @@ public class Bugs1919Tests extends XMLBasedAjcTestCase { 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 static Test suite() { return XMLBasedAjcTestCase.loadSuite(Bugs1919Tests.class); } 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 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit v1.2.3