diff options
author | aclement <aclement> | 2008-08-13 18:32:53 +0000 |
---|---|---|
committer | aclement <aclement> | 2008-08-13 18:32:53 +0000 |
commit | d4a5c74c9ffd54a15298117d9a3ca3e43b30d7b1 (patch) | |
tree | 8153bad86a45e89333252e8f1c60c864407eee6d /tests | |
parent | 6e045d6f04519fc7cc541157f10e5ce0cdc079b7 (diff) | |
download | aspectj-d4a5c74c9ffd54a15298117d9a3ca3e43b30d7b1.tar.gz aspectj-d4a5c74c9ffd54a15298117d9a3ca3e43b30d7b1.zip |
241047: testcode
Diffstat (limited to 'tests')
-rw-r--r-- | tests/bugs162/pr241047/SomeAspect.java | 13 | ||||
-rw-r--r-- | tests/bugs162/pr241047/SomeBaseClass.java | 20 | ||||
-rw-r--r-- | tests/bugs162/pr241047/SomeBaseClass2.java | 6 | ||||
-rw-r--r-- | tests/bugs162/pr241047/SomeBaseClass3.java | 7 | ||||
-rw-r--r-- | tests/bugs162/pr241047/SomeInterface.java | 1 | ||||
-rw-r--r-- | tests/bugs162/pr241047/SomeSubClass.java | 8 | ||||
-rw-r--r-- | tests/bugs162/pr241047/SomeSubClass2.java | 9 | ||||
-rw-r--r-- | tests/bugs162/pr241047/SomeSubClass3.java | 8 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc162/Ajc162Tests.java | 1 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc162/ajc162.xml | 23 |
10 files changed, 96 insertions, 0 deletions
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<Type extends Object> { + + public void tag_someBaseMethod() { + System.out.println("some base method"); + } + + public static void main(String[] args) { + new SomeBaseClass<Object>().tag_someBaseMethod(); + new SomeSubClass().tag_someMethod(); // this does not match correctly... + System.out.println(""); + + new SomeBaseClass2<Object>().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<Type extends Object> 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<Integer> { + + // 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<Integer> { + + // 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 @@ <!-- AspectJ v1.6.2 Tests --> <suite> + <ajc-test dir="bugs162/pr241047" title="generic decp"> + <compile files="SomeAspect.java SomeBaseClass.java SomeSubClass.java SomeSubClass2.java SomeSubClass3.java SomeInterface.java SomeBaseClass2.java SomeBaseClass3.java" options=" -Xlint:ignore -1.5"> + </compile> + <run class="SomeBaseClass"> + <stdout> + <line text="correct advice :-)"/> + <line text="some base method"/> + <line text="correct advice :-)"/> + <line text="some sub method"/> + <line text=""/> + <line text="correct advice :-)"/> + <line text="some base method2"/> + <line text="correct advice :-)"/> + <line text="some sub method2"/> + <line text=""/> + <line text="correct advice :-)"/> + <line text="some base method3"/> + <line text="correct advice :-)"/> + <line text="some sub method3"/> + </stdout> + </run> + </ajc-test> + <ajc-test dir="bugs162/pr242797/case1" title="generic itds - 1"> <compile files="ClassUtils.java CMEFinder.java Finder.java H2Deployment.java Localized.java LocalizedFinder.java OnetElement.java OnetFinder.java Partitioned.java PartitionedFinder.java" options="-1.5"> </compile> |