aboutsummaryrefslogtreecommitdiffstats
path: root/tests/new/AfterThrowingNonThrowable.java
diff options
context:
space:
mode:
authorwisberg <wisberg>2002-12-16 18:51:06 +0000
committerwisberg <wisberg>2002-12-16 18:51:06 +0000
commit144143c2970a1e874d74cdbd0f8c622d4282a3c3 (patch)
treeb12383d3d9e76c7e1f25f7fbec83051ef17f81fb /tests/new/AfterThrowingNonThrowable.java
parentfafae443719b26159ab2d7dac1c9b46b5e00b671 (diff)
downloadaspectj-144143c2970a1e874d74cdbd0f8c622d4282a3c3.tar.gz
aspectj-144143c2970a1e874d74cdbd0f8c622d4282a3c3.zip
initial version
Diffstat (limited to 'tests/new/AfterThrowingNonThrowable.java')
-rw-r--r--tests/new/AfterThrowingNonThrowable.java44
1 files changed, 44 insertions, 0 deletions
diff --git a/tests/new/AfterThrowingNonThrowable.java b/tests/new/AfterThrowingNonThrowable.java
new file mode 100644
index 000000000..108d2cd7a
--- /dev/null
+++ b/tests/new/AfterThrowingNonThrowable.java
@@ -0,0 +1,44 @@
+
+import org.aspectj.testing.Tester;
+import java.util.*;
+
+/** @testcase PR#832 after throwing advice with non-throwable formal */
+public class AfterThrowingNonThrowable {
+
+ public static void main(String[] args) {
+ U.ee("after() throwing (Object o) : call(void C.run())");
+ U.ee("run()");
+ C c = new C();
+ boolean gotError = false;
+ try {
+ c.run();
+ } catch (Error e) {
+ gotError = true;
+ }
+ Tester.check(gotError, "failed to get error");
+ Tester.checkAllEvents();
+ }
+}
+
+class C {
+ public void run() {
+ U.e("run()");
+ throw new Error("");
+ }
+}
+
+class U {
+ static void e(String event) {
+ //System.err.println(event);
+ Tester.event(event);
+ }
+ static void ee(String event) {
+ Tester.expectEvent(event);
+ }
+}
+
+aspect A {
+ after() throwing (Object o) : call(void C.run()) {
+ U.e("after() throwing (Object o) : call(void C.run())");
+ }
+}