diff options
author | acolyer <acolyer> | 2005-09-12 10:04:51 +0000 |
---|---|---|
committer | acolyer <acolyer> | 2005-09-12 10:04:51 +0000 |
commit | f5030e64039e19f562423d9c8b7f7b4587ecdea7 (patch) | |
tree | d8b0a8a4fafb47a0ac90dc4a5dd50a644a821adb /tests | |
parent | 64d74013c685a815cbe3565f71747103177daf20 (diff) | |
download | aspectj-f5030e64039e19f562423d9c8b7f7b4587ecdea7.tar.gz aspectj-f5030e64039e19f562423d9c8b7f7b4587ecdea7.zip |
tests and fix for pr108903 - MUST process from super aspect to sub aspect when finding declares
Diffstat (limited to 'tests')
7 files changed, 74 insertions, 2 deletions
diff --git a/tests/bugs150/pr108903/com/designpattern/decorator/HeaderDecorator.aj b/tests/bugs150/pr108903/com/designpattern/decorator/HeaderDecorator.aj new file mode 100644 index 000000000..fe9f12b88 --- /dev/null +++ b/tests/bugs150/pr108903/com/designpattern/decorator/HeaderDecorator.aj @@ -0,0 +1,19 @@ +/** + * + */ +package com.designpattern.decorator; + +public aspect HeaderDecorator extends OrderDecorator +{ + + void around(Order order) : print(order) + { + printHeader(order); + proceed(order); + } + + private void printHeader(Order order) + { + System.out.println("XYZ Incorporated\nDate of Sale:"); + } +} diff --git a/tests/bugs150/pr108903/com/designpattern/decorator/Main.java b/tests/bugs150/pr108903/com/designpattern/decorator/Main.java new file mode 100644 index 000000000..580150e79 --- /dev/null +++ b/tests/bugs150/pr108903/com/designpattern/decorator/Main.java @@ -0,0 +1,11 @@ +package com.designpattern.decorator; + +public class Main { + private static Order order; + + public static void main(String[] args) { + order = new SalesOrder(); + order.print(); + + } +} diff --git a/tests/bugs150/pr108903/com/designpattern/decorator/Order.java b/tests/bugs150/pr108903/com/designpattern/decorator/Order.java new file mode 100644 index 000000000..8ab3a8eb5 --- /dev/null +++ b/tests/bugs150/pr108903/com/designpattern/decorator/Order.java @@ -0,0 +1,9 @@ +package com.designpattern.decorator; + +public abstract class Order { + + public void print() { + System.out.print("Order.print()") ; + } + +} diff --git a/tests/bugs150/pr108903/com/designpattern/decorator/OrderDecorator.aj b/tests/bugs150/pr108903/com/designpattern/decorator/OrderDecorator.aj new file mode 100644 index 000000000..0c4926bee --- /dev/null +++ b/tests/bugs150/pr108903/com/designpattern/decorator/OrderDecorator.aj @@ -0,0 +1,17 @@ +/** + * + */ +package com.designpattern.decorator; + +public abstract aspect OrderDecorator +{ + protected pointcut print(Order order) : target(order) && call(public void print()); + + declare parents : SalesOrder extends Order ; + + public void SalesOrder.print() + { + super.print(); + } + +} diff --git a/tests/bugs150/pr108903/com/designpattern/decorator/SalesOrder.java b/tests/bugs150/pr108903/com/designpattern/decorator/SalesOrder.java new file mode 100644 index 000000000..2dd0add5c --- /dev/null +++ b/tests/bugs150/pr108903/com/designpattern/decorator/SalesOrder.java @@ -0,0 +1,5 @@ +package com.designpattern.decorator; + +public class SalesOrder { + +} diff --git a/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java b/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java index 29d58d31f..41105f06d 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java @@ -405,7 +405,11 @@ public class Ajc150Tests extends org.aspectj.testing.XMLBasedAjcTestCase { public void testSuperCallInITD() { runTest("super call in ITD"); } - + + public void testSuperCallInITDPart2() { + runTest("super call in ITD - part 2"); + } + public void testNoUnusedParameterWarningsForSyntheticAdviceArgs() { runTest("no unused parameter warnings for synthetic advice args"); } @@ -417,6 +421,8 @@ public class Ajc150Tests extends org.aspectj.testing.XMLBasedAjcTestCase { public void testCantFindTypeErrorWithGenericReturnTypeOrParameter() { runTest("cant find type error with generic return type or parameter"); } + + // currently failing... // public void testNoVerifyErrorOnGenericCollectionMemberAccess() { diff --git a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml index 3e44ba7f1..cbd07c281 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml +++ b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml @@ -542,7 +542,12 @@ </compile> <run class="pr105181"/> </ajc-test> - + + <ajc-test dir="bugs150/pr108903" pr="108903" title="super call in ITD - part 2"> + <compile files="com/designpattern/decorator/HeaderDecorator.aj,com/designpattern/decorator/Main.java,com/designpattern/decorator/Order.java,com/designpattern/decorator/OrderDecorator.aj,com/designpattern/decorator/SalesOrder.java" options="-1.5" > + </compile> + </ajc-test> + <!-- ============================================================================ --> <!-- ============================================================================ --> |