]> source.dussan.org Git - aspectj.git/commitdiff
241047: testcode
authoraclement <aclement>
Wed, 13 Aug 2008 18:32:53 +0000 (18:32 +0000)
committeraclement <aclement>
Wed, 13 Aug 2008 18:32:53 +0000 (18:32 +0000)
tests/bugs162/pr241047/SomeAspect.java [new file with mode: 0644]
tests/bugs162/pr241047/SomeBaseClass.java [new file with mode: 0644]
tests/bugs162/pr241047/SomeBaseClass2.java [new file with mode: 0644]
tests/bugs162/pr241047/SomeBaseClass3.java [new file with mode: 0644]
tests/bugs162/pr241047/SomeInterface.java [new file with mode: 0644]
tests/bugs162/pr241047/SomeSubClass.java [new file with mode: 0644]
tests/bugs162/pr241047/SomeSubClass2.java [new file with mode: 0644]
tests/bugs162/pr241047/SomeSubClass3.java [new file with mode: 0644]
tests/src/org/aspectj/systemtest/ajc162/Ajc162Tests.java
tests/src/org/aspectj/systemtest/ajc162/ajc162.xml

diff --git a/tests/bugs162/pr241047/SomeAspect.java b/tests/bugs162/pr241047/SomeAspect.java
new file mode 100644 (file)
index 0000000..bcbf806
--- /dev/null
@@ -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 (file)
index 0000000..0bd809d
--- /dev/null
@@ -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 (file)
index 0000000..36f76aa
--- /dev/null
@@ -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 (file)
index 0000000..a7d02fb
--- /dev/null
@@ -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 (file)
index 0000000..c6750f6
--- /dev/null
@@ -0,0 +1 @@
+public interface SomeInterface {}
diff --git a/tests/bugs162/pr241047/SomeSubClass.java b/tests/bugs162/pr241047/SomeSubClass.java
new file mode 100644 (file)
index 0000000..ac8f761
--- /dev/null
@@ -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 (file)
index 0000000..7d67a42
--- /dev/null
@@ -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 (file)
index 0000000..1df3135
--- /dev/null
@@ -0,0 +1,8 @@
+public class SomeSubClass3 extends SomeBaseClass3 {
+
+ // this method matches correctly
+ public void tag_someMethod() {
+  System.out.println("some sub method3");
+ }
+}
+
index 0871d5b86fc9492e001ebd269138978ee75bbd02..17139b7186585940cca41b3b52ca59d6b0f7f212 100644 (file)
@@ -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"); }
index 1fc19bbbfc8de85fff0680b510f558ab7a1e9352..c9833c84776beb8df9b9de0506577214ba18c530 100644 (file)
@@ -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>