From d4a5c74c9ffd54a15298117d9a3ca3e43b30d7b1 Mon Sep 17 00:00:00 2001 From: aclement Date: Wed, 13 Aug 2008 18:32:53 +0000 Subject: [PATCH] 241047: testcode --- tests/bugs162/pr241047/SomeAspect.java | 13 +++++++++++ tests/bugs162/pr241047/SomeBaseClass.java | 20 ++++++++++++++++ tests/bugs162/pr241047/SomeBaseClass2.java | 6 +++++ tests/bugs162/pr241047/SomeBaseClass3.java | 7 ++++++ tests/bugs162/pr241047/SomeInterface.java | 1 + tests/bugs162/pr241047/SomeSubClass.java | 8 +++++++ tests/bugs162/pr241047/SomeSubClass2.java | 9 ++++++++ tests/bugs162/pr241047/SomeSubClass3.java | 8 +++++++ .../systemtest/ajc162/Ajc162Tests.java | 1 + .../org/aspectj/systemtest/ajc162/ajc162.xml | 23 +++++++++++++++++++ 10 files changed, 96 insertions(+) create mode 100644 tests/bugs162/pr241047/SomeAspect.java create mode 100644 tests/bugs162/pr241047/SomeBaseClass.java create mode 100644 tests/bugs162/pr241047/SomeBaseClass2.java create mode 100644 tests/bugs162/pr241047/SomeBaseClass3.java create mode 100644 tests/bugs162/pr241047/SomeInterface.java create mode 100644 tests/bugs162/pr241047/SomeSubClass.java create mode 100644 tests/bugs162/pr241047/SomeSubClass2.java create mode 100644 tests/bugs162/pr241047/SomeSubClass3.java diff --git a/tests/bugs162/pr241047/SomeAspect.java b/tests/bugs162/pr241047/SomeAspect.java new file mode 100644 index 000000000..bcbf806a0 --- /dev/null +++ b/tests/bugs162/pr241047/SomeAspect.java @@ -0,0 +1,13 @@ +public aspect SomeAspect { + declare parents: SomeBaseClass implements SomeInterface; + declare parents: SomeBaseClass3 implements SomeInterface; + + before() : execution(* (SomeInterface+).tag*(..)) { + System.out.println("correct advice :-)"); + } + + before() : execution(* (!SomeInterface+).tag*(..)) { + System.out.println("this advice should never run..."); + } +} + diff --git a/tests/bugs162/pr241047/SomeBaseClass.java b/tests/bugs162/pr241047/SomeBaseClass.java new file mode 100644 index 000000000..0bd809d26 --- /dev/null +++ b/tests/bugs162/pr241047/SomeBaseClass.java @@ -0,0 +1,20 @@ +public class SomeBaseClass { + + public void tag_someBaseMethod() { + System.out.println("some base method"); + } + + public static void main(String[] args) { + new SomeBaseClass().tag_someBaseMethod(); + new SomeSubClass().tag_someMethod(); // this does not match correctly... + System.out.println(""); + + new SomeBaseClass2().tag_someBaseMethod(); + new SomeSubClass2().tag_someMethod(); + System.out.println(""); + + new SomeBaseClass3().tag_someBaseMethod(); + new SomeSubClass3().tag_someMethod(); + } +} + diff --git a/tests/bugs162/pr241047/SomeBaseClass2.java b/tests/bugs162/pr241047/SomeBaseClass2.java new file mode 100644 index 000000000..36f76aa0b --- /dev/null +++ b/tests/bugs162/pr241047/SomeBaseClass2.java @@ -0,0 +1,6 @@ +public class SomeBaseClass2 implements SomeInterface { + public void tag_someBaseMethod() { + System.out.println("some base method2"); + } +} + diff --git a/tests/bugs162/pr241047/SomeBaseClass3.java b/tests/bugs162/pr241047/SomeBaseClass3.java new file mode 100644 index 000000000..a7d02fbbe --- /dev/null +++ b/tests/bugs162/pr241047/SomeBaseClass3.java @@ -0,0 +1,7 @@ +public class SomeBaseClass3 { + public void tag_someBaseMethod() { + System.out.println("some base method3"); + } +} + + diff --git a/tests/bugs162/pr241047/SomeInterface.java b/tests/bugs162/pr241047/SomeInterface.java new file mode 100644 index 000000000..c6750f6a3 --- /dev/null +++ b/tests/bugs162/pr241047/SomeInterface.java @@ -0,0 +1 @@ +public interface SomeInterface {} diff --git a/tests/bugs162/pr241047/SomeSubClass.java b/tests/bugs162/pr241047/SomeSubClass.java new file mode 100644 index 000000000..ac8f761a1 --- /dev/null +++ b/tests/bugs162/pr241047/SomeSubClass.java @@ -0,0 +1,8 @@ +public class SomeSubClass extends SomeBaseClass { + + // this method is not matched correctly... + public void tag_someMethod() { + System.out.println("some sub method"); + } +} + diff --git a/tests/bugs162/pr241047/SomeSubClass2.java b/tests/bugs162/pr241047/SomeSubClass2.java new file mode 100644 index 000000000..7d67a4226 --- /dev/null +++ b/tests/bugs162/pr241047/SomeSubClass2.java @@ -0,0 +1,9 @@ +public class SomeSubClass2 extends SomeBaseClass2 { + + // this method matches correctly + public void tag_someMethod() { + System.out.println("some sub method2"); + } +} + + \ No newline at end of file diff --git a/tests/bugs162/pr241047/SomeSubClass3.java b/tests/bugs162/pr241047/SomeSubClass3.java new file mode 100644 index 000000000..1df3135f4 --- /dev/null +++ b/tests/bugs162/pr241047/SomeSubClass3.java @@ -0,0 +1,8 @@ +public class SomeSubClass3 extends SomeBaseClass3 { + + // this method matches correctly + public void tag_someMethod() { + System.out.println("some sub method3"); + } +} + diff --git a/tests/src/org/aspectj/systemtest/ajc162/Ajc162Tests.java b/tests/src/org/aspectj/systemtest/ajc162/Ajc162Tests.java index 0871d5b86..17139b718 100644 --- a/tests/src/org/aspectj/systemtest/ajc162/Ajc162Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc162/Ajc162Tests.java @@ -19,6 +19,7 @@ import org.aspectj.testing.XMLBasedAjcTestCase; public class Ajc162Tests extends org.aspectj.testing.XMLBasedAjcTestCase { // AspectJ1.6.2 + public void testGenericDecp_pr241047() { runTest("generic decp"); } public void testGenericItds_pr242797_1() { runTest("generic itds - 1"); } // public void testParamAnnosPipelining_pr241847() { runTest("param annos pipelining");} // public void testParamAnnoInner_pr241861() { runTest("param annotation inner class"); } diff --git a/tests/src/org/aspectj/systemtest/ajc162/ajc162.xml b/tests/src/org/aspectj/systemtest/ajc162/ajc162.xml index 1fc19bbbf..c9833c847 100644 --- a/tests/src/org/aspectj/systemtest/ajc162/ajc162.xml +++ b/tests/src/org/aspectj/systemtest/ajc162/ajc162.xml @@ -3,6 +3,29 @@ + + + + + + + + + + + + + + + + + + + + + + + -- 2.39.5