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/other-systems/util | |
parent | fafae443719b26159ab2d7dac1c9b46b5e00b671 (diff) | |
download | aspectj-144143c2970a1e874d74cdbd0f8c622d4282a3c3.tar.gz aspectj-144143c2970a1e874d74cdbd0f8c622d4282a3c3.zip |
initial version
Diffstat (limited to 'tests/other-systems/util')
-rw-r--r-- | tests/other-systems/util/AroundAll.java | 11 | ||||
-rw-r--r-- | tests/other-systems/util/Trace.java | 37 | ||||
-rw-r--r-- | tests/other-systems/util/TraceAll.java | 3 | ||||
-rw-r--r-- | tests/other-systems/util/TraceCalls.java | 3 | ||||
-rw-r--r-- | tests/other-systems/util/TraceMembers.java | 3 | ||||
-rw-r--r-- | tests/other-systems/util/TraceSets.java | 3 |
6 files changed, 60 insertions, 0 deletions
diff --git a/tests/other-systems/util/AroundAll.java b/tests/other-systems/util/AroundAll.java new file mode 100644 index 000000000..2b57c39fb --- /dev/null +++ b/tests/other-systems/util/AroundAll.java @@ -0,0 +1,11 @@ +aspect AroundAll { + pointcut targets(Object o): + execution(!abstract !native * *(..)) && this(o) && Pcds.withinMe(); + + Object around(Object thisObj): targets(thisObj) { + if (true) { + throw new RuntimeException("not meant to run"); + } + return proceed(thisObj); + } +} diff --git a/tests/other-systems/util/Trace.java b/tests/other-systems/util/Trace.java new file mode 100644 index 000000000..72aa89b20 --- /dev/null +++ b/tests/other-systems/util/Trace.java @@ -0,0 +1,37 @@ +import java.io.Serializable; + +abstract aspect Trace { + abstract pointcut targets(); + + /* + * toString() can throw exceptions, so we'll print + * the java.lang.Class instead. + */ + + before (): targets() { + System.out.println("entering " + thisJoinPoint); + } + after (): targets() { + System.out.println("exiting " + + thisJoinPointStaticPart); + } + + after () throwing (Throwable t): targets() { + System.out.println("throwing " + t); + } + + after () throwing (java.io.IOException ioe): targets() { + System.out.println("throwing " + ioe); + } + + after () returning (Object o): targets() { + System.out.println("returning " + (o!=null ? o.getClass() : null)); + } + + + private static int initCounter() { + return 0; + } + + //private int Serializable.counter = initCounter(); +} diff --git a/tests/other-systems/util/TraceAll.java b/tests/other-systems/util/TraceAll.java new file mode 100644 index 000000000..0c5b0e8c8 --- /dev/null +++ b/tests/other-systems/util/TraceAll.java @@ -0,0 +1,3 @@ +aspect TraceAll extends Trace { + pointcut targets(): call(!native * *(..)) && Pcds.myTarget(); +} diff --git a/tests/other-systems/util/TraceCalls.java b/tests/other-systems/util/TraceCalls.java new file mode 100644 index 000000000..9ecfc2417 --- /dev/null +++ b/tests/other-systems/util/TraceCalls.java @@ -0,0 +1,3 @@ +aspect TraceCalls extends Trace { + pointcut targets(): Pcds.withinMe() && (call(* *(..)) || call(new(..))); +} diff --git a/tests/other-systems/util/TraceMembers.java b/tests/other-systems/util/TraceMembers.java new file mode 100644 index 000000000..5f663d0c4 --- /dev/null +++ b/tests/other-systems/util/TraceMembers.java @@ -0,0 +1,3 @@ +aspect TraceMembers extends Trace { + pointcut targets(): Pcds.withinMe() && execution(!abstract !native * *(..)); +} diff --git a/tests/other-systems/util/TraceSets.java b/tests/other-systems/util/TraceSets.java new file mode 100644 index 000000000..69d1e873b --- /dev/null +++ b/tests/other-systems/util/TraceSets.java @@ -0,0 +1,3 @@ +aspect TraceSets extends Trace { + pointcut targets(): Pcds.withinMe() && set(* *..*.*); +} |