diff options
author | aclement <aclement> | 2007-02-15 10:41:33 +0000 |
---|---|---|
committer | aclement <aclement> | 2007-02-15 10:41:33 +0000 |
commit | b385e38ee74765c80845193e32bff2370dd78903 (patch) | |
tree | 10aa4bc6c2154d0724f355c0c23b5a35cea7480f | |
parent | 2447dfe82db042aa10fa5c2a4ba0646c37dc26d7 (diff) | |
download | aspectj-b385e38ee74765c80845193e32bff2370dd78903.tar.gz aspectj-b385e38ee74765c80845193e32bff2370dd78903.zip |
test and fix for 171953
-rw-r--r-- | tests/bugs160/pr171953/test/AbstractExecutable.java | 5 | ||||
-rw-r--r-- | tests/bugs160/pr171953/test/AnotherExecutable.java | 5 | ||||
-rw-r--r-- | tests/bugs160/pr171953/test/Executable.java | 6 | ||||
-rw-r--r-- | tests/bugs160/pr171953/test/ExecutionAspect.aj | 12 | ||||
-rw-r--r-- | tests/bugs160/pr171953/test/RunnableAspect.aj | 11 | ||||
-rw-r--r-- | tests/bugs160/pr171953/test/SecondTestExecutable.java | 13 | ||||
-rw-r--r-- | tests/bugs160/pr171953/test/SubTestExecutable.java | 9 | ||||
-rw-r--r-- | tests/bugs160/pr171953/test/TestExecutable.java | 7 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc160/Ajc160Tests.java | 2 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc160/ajc160.xml | 20 |
10 files changed, 90 insertions, 0 deletions
diff --git a/tests/bugs160/pr171953/test/AbstractExecutable.java b/tests/bugs160/pr171953/test/AbstractExecutable.java new file mode 100644 index 000000000..6d9f880a6 --- /dev/null +++ b/tests/bugs160/pr171953/test/AbstractExecutable.java @@ -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 index 000000000..75103a696 --- /dev/null +++ b/tests/bugs160/pr171953/test/AnotherExecutable.java @@ -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 index 000000000..13cb945b1 --- /dev/null +++ b/tests/bugs160/pr171953/test/Executable.java @@ -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 index 000000000..1dd0266d8 --- /dev/null +++ b/tests/bugs160/pr171953/test/ExecutionAspect.aj @@ -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 index 000000000..fa12b7b99 --- /dev/null +++ b/tests/bugs160/pr171953/test/RunnableAspect.aj @@ -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 index 000000000..1743a9728 --- /dev/null +++ b/tests/bugs160/pr171953/test/SecondTestExecutable.java @@ -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 index 000000000..8dd83bd03 --- /dev/null +++ b/tests/bugs160/pr171953/test/SubTestExecutable.java @@ -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 index 000000000..bfd296a2d --- /dev/null +++ b/tests/bugs160/pr171953/test/TestExecutable.java @@ -0,0 +1,7 @@ +package test; + +public class TestExecutable implements Executable { + + public void execute() { + } +} diff --git a/tests/src/org/aspectj/systemtest/ajc160/Ajc160Tests.java b/tests/src/org/aspectj/systemtest/ajc160/Ajc160Tests.java index 79dfe4c18..eb6c5a116 100644 --- a/tests/src/org/aspectj/systemtest/ajc160/Ajc160Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc160/Ajc160Tests.java @@ -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");} diff --git a/tests/src/org/aspectj/systemtest/ajc160/ajc160.xml b/tests/src/org/aspectj/systemtest/ajc160/ajc160.xml index bdca3440d..792f59c5d 100644 --- a/tests/src/org/aspectj/systemtest/ajc160/ajc160.xml +++ b/tests/src/org/aspectj/systemtest/ajc160/ajc160.xml @@ -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> |