diff options
author | aclement <aclement> | 2006-07-04 16:53:37 +0000 |
---|---|---|
committer | aclement <aclement> | 2006-07-04 16:53:37 +0000 |
commit | 4a8b8532694b79c106efd1eb70070e71174b6f1a (patch) | |
tree | a5d6e894e69bb05a76f3c4f5e14a37adc61aa2be /tests/bugs153/pr149096 | |
parent | 6becfea965f575ea82af8581d8551b4ed5537ed8 (diff) | |
download | aspectj-4a8b8532694b79c106efd1eb70070e71174b6f1a.tar.gz aspectj-4a8b8532694b79c106efd1eb70070e71174b6f1a.zip |
testcode for 149305, 149096, 149305
Diffstat (limited to 'tests/bugs153/pr149096')
-rw-r--r-- | tests/bugs153/pr149096/SimpleTracing.aj | 32 | ||||
-rw-r--r-- | tests/bugs153/pr149096/TestMain.aj | 16 | ||||
-rw-r--r-- | tests/bugs153/pr149096/aop-pr149096.xml | 10 |
3 files changed, 58 insertions, 0 deletions
diff --git a/tests/bugs153/pr149096/SimpleTracing.aj b/tests/bugs153/pr149096/SimpleTracing.aj new file mode 100644 index 000000000..a865ed97e --- /dev/null +++ b/tests/bugs153/pr149096/SimpleTracing.aj @@ -0,0 +1,32 @@ +import org.aspectj.lang.JoinPoint; + +public abstract aspect SimpleTracing { + private Tracer tracer = new Tracer(); + + public abstract pointcut scope(); + + public pointcut anyExec() : + execution(* *(..)) || execution(new(..)) || adviceexecution(); + + public pointcut inTracing() : anyExec() && cflow(within(Tracer)); + + public pointcut trace() : scope() && anyExec() && !inTracing(); + + before() : trace() { + tracer.enter(thisJoinPoint); + } + + after() : trace() { + tracer.exit(thisJoinPoint); + } + + class Tracer { + public void enter(JoinPoint jp) { + System.out.println("trace enter: " + jp.getSignature().toString()); + } + + public void exit(JoinPoint jp) { + System.out.println("trace exit: " + jp.getSignature().toString()); + } + } +} diff --git a/tests/bugs153/pr149096/TestMain.aj b/tests/bugs153/pr149096/TestMain.aj new file mode 100644 index 000000000..90b1cf6e7 --- /dev/null +++ b/tests/bugs153/pr149096/TestMain.aj @@ -0,0 +1,16 @@ +public class TestMain { + public static void main(String args[]) { + TestMain main = new TestMain(); + System.out.println(main.foo()); + System.out.println(main.foo()); + System.out.println(new TestMain().foo()); + System.out.println(main.foo()); + } + + public Object foo() { + return ctr; + } + + Integer ctr = new Integer(0); +} + diff --git a/tests/bugs153/pr149096/aop-pr149096.xml b/tests/bugs153/pr149096/aop-pr149096.xml new file mode 100644 index 000000000..ba987f808 --- /dev/null +++ b/tests/bugs153/pr149096/aop-pr149096.xml @@ -0,0 +1,10 @@ +<aspectj> + <weaver> + <dump within="*"/> + </weaver> + <aspects> + <concrete-aspect name="TestTracing" extends="SimpleTracing"> + <pointcut name="scope" expression="within(TestMain)"/> + </concrete-aspect> + </aspects> +</aspectj> |