]> source.dussan.org Git - aspectj.git/commitdiff
test and fix for 171953
authoraclement <aclement>
Thu, 15 Feb 2007 10:41:33 +0000 (10:41 +0000)
committeraclement <aclement>
Thu, 15 Feb 2007 10:41:33 +0000 (10:41 +0000)
tests/bugs160/pr171953/test/AbstractExecutable.java [new file with mode: 0644]
tests/bugs160/pr171953/test/AnotherExecutable.java [new file with mode: 0644]
tests/bugs160/pr171953/test/Executable.java [new file with mode: 0644]
tests/bugs160/pr171953/test/ExecutionAspect.aj [new file with mode: 0644]
tests/bugs160/pr171953/test/RunnableAspect.aj [new file with mode: 0644]
tests/bugs160/pr171953/test/SecondTestExecutable.java [new file with mode: 0644]
tests/bugs160/pr171953/test/SubTestExecutable.java [new file with mode: 0644]
tests/bugs160/pr171953/test/TestExecutable.java [new file with mode: 0644]
tests/src/org/aspectj/systemtest/ajc160/Ajc160Tests.java
tests/src/org/aspectj/systemtest/ajc160/ajc160.xml

diff --git a/tests/bugs160/pr171953/test/AbstractExecutable.java b/tests/bugs160/pr171953/test/AbstractExecutable.java
new file mode 100644 (file)
index 0000000..6d9f880
--- /dev/null
@@ -0,0 +1,5 @@
+package test;
+
+public abstract class AbstractExecutable implements AnotherExecutable {
+
+}
diff --git a/tests/bugs160/pr171953/test/AnotherExecutable.java b/tests/bugs160/pr171953/test/AnotherExecutable.java
new file mode 100644 (file)
index 0000000..75103a6
--- /dev/null
@@ -0,0 +1,5 @@
+package test;
+
+public interface AnotherExecutable extends Executable {
+
+}
diff --git a/tests/bugs160/pr171953/test/Executable.java b/tests/bugs160/pr171953/test/Executable.java
new file mode 100644 (file)
index 0000000..13cb945
--- /dev/null
@@ -0,0 +1,6 @@
+package test;
+
+public interface Executable {
+
+       void execute();
+}
diff --git a/tests/bugs160/pr171953/test/ExecutionAspect.aj b/tests/bugs160/pr171953/test/ExecutionAspect.aj
new file mode 100644 (file)
index 0000000..1dd0266
--- /dev/null
@@ -0,0 +1,12 @@
+package test;
+
+public aspect ExecutionAspect {
+
+declare parents: AbstractExecutable implements java.io.Serializable;
+
+       pointcut executions(Executable executable): execution(public void Executable.execute()) && this(executable);
+       
+       void around(Executable executable): executions(executable) {
+               System.err.println(thisJoinPoint);
+       }
+}
diff --git a/tests/bugs160/pr171953/test/RunnableAspect.aj b/tests/bugs160/pr171953/test/RunnableAspect.aj
new file mode 100644 (file)
index 0000000..fa12b7b
--- /dev/null
@@ -0,0 +1,11 @@
+package test;
+
+public aspect RunnableAspect {
+
+//     public void Executable.run() {
+//             execute();
+//     }
+//     
+//     //declare parents: (Executable+ && !Executable) implements Runnable;
+//     declare parents: AbstractExecutable implements java.io.Serializable;
+}
diff --git a/tests/bugs160/pr171953/test/SecondTestExecutable.java b/tests/bugs160/pr171953/test/SecondTestExecutable.java
new file mode 100644 (file)
index 0000000..1743a97
--- /dev/null
@@ -0,0 +1,13 @@
+package test;
+
+public class SecondTestExecutable extends AbstractExecutable {
+
+       public void execute() {
+               // should not happen because of ExecutionAspect prevents execution
+               throw new RuntimeException();
+       }
+       
+       public static void main(String[] args) {
+               new SecondTestExecutable().execute(); 
+       } 
+}
diff --git a/tests/bugs160/pr171953/test/SubTestExecutable.java b/tests/bugs160/pr171953/test/SubTestExecutable.java
new file mode 100644 (file)
index 0000000..8dd83bd
--- /dev/null
@@ -0,0 +1,9 @@
+package test;
+
+public class SubTestExecutable extends TestExecutable {
+
+       @Override
+       public void execute() {
+               super.execute();
+       }
+}
diff --git a/tests/bugs160/pr171953/test/TestExecutable.java b/tests/bugs160/pr171953/test/TestExecutable.java
new file mode 100644 (file)
index 0000000..bfd296a
--- /dev/null
@@ -0,0 +1,7 @@
+package test;
+
+public class TestExecutable implements Executable {
+
+       public void execute() {
+       }
+}
index 79dfe4c1877a696fea8943c611afdc207c79fc88..eb6c5a11671ca88c54ff7867c4a5bebd12bd0a34 100644 (file)
@@ -21,6 +21,8 @@ import junit.framework.Test;
  */
 public class Ajc160Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
        
+  public void testItdAndJoinpointSignatureCollection_ok_pr171953() { runTest("problem with itd and join point signature collection - ok");}
+  public void testItdAndJoinpointSignatureCollection_bad_pr171953() { runTest("problem with itd and join point signature collection - bad");}
   public void testGenericMethodsAndItds_pr171952() { runTest("generic methods and ITDs");}
   //public void testUsingDecpAnnotationWithoutAspectAnnotation_pr169428() { runTest("using decp annotation without aspect annotation");}
   public void testItdsParameterizedParameters_pr170467() { runTest("itds and parameterized parameters");}
index bdca3440d52b98d550471f3e0cb1ef2f7113fb95..792f59c5d0650f64b3f2c906c4d417e67192982b 100644 (file)
@@ -5,6 +5,26 @@
 
  <!-- first section - dont need a 1.6 vm but fixed in the 1.6 branch of AspectJ -->
  
+   <ajc-test dir="bugs160/pr171953" title="problem with itd and join point signature collection - bad">
+     <compile options="-1.5 -showWeaveInfo" files="test/AbstractExecutable.java,test/AnotherExecutable.java,test/Executable.java,test/ExecutionAspect.aj,test/SecondTestExecutable.java test/SubTestExecutable.java test/TestExecutable.java">
+       <message kind="weave" text="Join point 'method-execution(void test.SecondTestExecutable.execute())' in Type 'test.SecondTestExecutable' (SecondTestExecutable.java:5) advised by around advice from 'test.ExecutionAspect' (ExecutionAspect.aj:9)"/>
+       <message kind="weave" text="Extending interface set for type 'test.AbstractExecutable' (AbstractExecutable.java) to include 'java.io.Serializable' (ExecutionAspect.aj)"/>
+       <message kind="weave" text="Join point 'method-execution(void test.SubTestExecutable.execute())' in Type 'test.SubTestExecutable' (SubTestExecutable.java:6) advised by around advice from 'test.ExecutionAspect' (ExecutionAspect.aj:9)"/>
+       <message kind="weave" text="Join point 'method-execution(void test.TestExecutable.execute())' in Type 'test.TestExecutable' (TestExecutable.java:5) advised by around advice from 'test.ExecutionAspect' (ExecutionAspect.aj:9)"/>
+     </compile>       
+     <run class="test.SecondTestExecutable"/>
+   </ajc-test>
+
+   <ajc-test dir="bugs160/pr171953" title="problem with itd and join point signature collection - ok">
+     <compile options="-1.5 -showWeaveInfo" files="test/SecondTestExecutable.java test/AbstractExecutable.java test/AnotherExecutable.java  test/Executable.java test/ExecutionAspect.aj test/RunnableAspect.aj test/SubTestExecutable.java test/TestExecutable.java">
+       <message kind="weave" text="Join point 'method-execution(void test.SecondTestExecutable.execute())' in Type 'test.SecondTestExecutable' (SecondTestExecutable.java:5) advised by around advice from 'test.ExecutionAspect' (ExecutionAspect.aj:9)"/>
+       <message kind="weave" text="Extending interface set for type 'test.AbstractExecutable' (AbstractExecutable.java) to include 'java.io.Serializable' (ExecutionAspect.aj)"/>
+       <message kind="weave" text="Join point 'method-execution(void test.SubTestExecutable.execute())' in Type 'test.SubTestExecutable' (SubTestExecutable.java:6) advised by around advice from 'test.ExecutionAspect' (ExecutionAspect.aj:9)"/>
+       <message kind="weave" text="Join point 'method-execution(void test.TestExecutable.execute())' in Type 'test.TestExecutable' (TestExecutable.java:5) advised by around advice from 'test.ExecutionAspect' (ExecutionAspect.aj:9)"/>
+     </compile>       
+     <run class="test.SecondTestExecutable"/>
+   </ajc-test>
+
     <ajc-test dir="bugs160/pr171952" title="generic methods and ITDs">
       <compile files="Foo.java,FooAspect.java" options="-1.5"/>
     </ajc-test>