diff options
author | wisberg <wisberg> | 2002-12-16 18:51:06 +0000 |
---|---|---|
committer | wisberg <wisberg> | 2002-12-16 18:51:06 +0000 |
commit | 144143c2970a1e874d74cdbd0f8c622d4282a3c3 (patch) | |
tree | b12383d3d9e76c7e1f25f7fbec83051ef17f81fb /tests/new/PR691.java | |
parent | fafae443719b26159ab2d7dac1c9b46b5e00b671 (diff) | |
download | aspectj-144143c2970a1e874d74cdbd0f8c622d4282a3c3.tar.gz aspectj-144143c2970a1e874d74cdbd0f8c622d4282a3c3.zip |
initial version
Diffstat (limited to 'tests/new/PR691.java')
-rw-r--r-- | tests/new/PR691.java | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/tests/new/PR691.java b/tests/new/PR691.java new file mode 100644 index 000000000..b624c4839 --- /dev/null +++ b/tests/new/PR691.java @@ -0,0 +1,49 @@ + +import org.aspectj.testing.*; + +/** @testcase PR#691 around AST type XXX */ +public class PR691 { + public static void main (String[] args) { + Tester.expectEvent("around"); + new MailerTest().run(new TestResult()); + Tester.checkAllEvents(); + } + +} +class TestResult {} +class Message {} +class MailerTest { + public void run(TestResult result) { + new Mailer().sendTextMail(); + } +} +class Mailer { + public void sendTextMail(){ + new Transport().send(new Message()); + } +} +class Transport { public void send(Message m){ } } + +aspect Mail { + pointcut inThisTestCase(MailerTest testCase) : + call(* MailerTest.run(TestResult)) + && target(testCase); + + pointcut flowOfTestCase(MailerTest testCase) : + cflow(inThisTestCase(testCase)); + + pointcut sendMailCall() : call(void Mailer.sendTextMail(..)); + pointcut transportSend(Message msg) : + call(void Transport.send(Message)) && args(msg); + + // no bug if no testCase context + //void around(Message msg) : + // flowOfTestCase(MailerTest) + void around(Message msg, final MailerTest testCase) : + flowOfTestCase(testCase) + && cflow(sendMailCall()) + && transportSend(msg) { + Tester.event("around"); + proceed(msg,testCase); + } +} |