diff options
author | aclement <aclement> | 2006-10-03 14:30:21 +0000 |
---|---|---|
committer | aclement <aclement> | 2006-10-03 14:30:21 +0000 |
commit | 7b831ff7356725b9872a9635d1e0eeb035f2790b (patch) | |
tree | 4f91fdbd2b9e0ece6ddc1aabaaf6d3fff8f59482 /tests/ltw | |
parent | a67ec0d3c573b37b0d1bbc8b2400da430dfb2faa (diff) | |
download | aspectj-7b831ff7356725b9872a9635d1e0eeb035f2790b.tar.gz aspectj-7b831ff7356725b9872a9635d1e0eeb035f2790b.zip |
test and fixes for 152366: support AND in include/exclude/dump
Diffstat (limited to 'tests/ltw')
-rw-r--r-- | tests/ltw/inclExcl/aop-aspectinclexcl.xml | 10 | ||||
-rw-r--r-- | tests/ltw/inclExcl/aop-exclude.xml | 9 | ||||
-rw-r--r-- | tests/ltw/inclExcl/aop-include.xml | 10 | ||||
-rw-r--r-- | tests/ltw/inclExcl/pkg/Main.aj | 46 | ||||
-rw-r--r-- | tests/ltw/inclExcl/pkg/sub/Foo.aj | 5 | ||||
-rw-r--r-- | tests/ltw/inclExcl/tracing/Tracer.aj | 7 | ||||
-rw-r--r-- | tests/ltw/inclExcl/tracing/staticinit/Tracer.aj | 7 | ||||
-rw-r--r-- | tests/ltw/inclExcl/tracing/staticinit/sub/Tracer.aj | 7 |
8 files changed, 101 insertions, 0 deletions
diff --git a/tests/ltw/inclExcl/aop-aspectinclexcl.xml b/tests/ltw/inclExcl/aop-aspectinclexcl.xml new file mode 100644 index 000000000..5f4c88d50 --- /dev/null +++ b/tests/ltw/inclExcl/aop-aspectinclexcl.xml @@ -0,0 +1,10 @@ +<aspectj> +<aspects> +<aspect name="tracing.Tracer"/> +<aspect name="tracing.staticinit.Tracer"/> +<aspect name="tracing.staticinit.sub.Tracer"/> +<include within="tracing..* AND !tracing.staticinit.sub..*"/> +<exclude within="tracing..* AND !tracing.staticinit..*"/> +</aspects> +</aspectj> + diff --git a/tests/ltw/inclExcl/aop-exclude.xml b/tests/ltw/inclExcl/aop-exclude.xml new file mode 100644 index 000000000..b13fcf099 --- /dev/null +++ b/tests/ltw/inclExcl/aop-exclude.xml @@ -0,0 +1,9 @@ +<aspectj> +<weaver> +<exclude within="pkg..* AND !pkg.sub..*"/> +</weaver> +<aspects> +<aspect name="tracing.Tracer"/> +</aspects> +</aspectj> + diff --git a/tests/ltw/inclExcl/aop-include.xml b/tests/ltw/inclExcl/aop-include.xml new file mode 100644 index 000000000..afdac0f49 --- /dev/null +++ b/tests/ltw/inclExcl/aop-include.xml @@ -0,0 +1,10 @@ +<aspectj> +<weaver> +<include within="pkg..* AND !pkg.sub..*"/> +<dump within="pkg..* AND !pkg.sub..*"/> +</weaver> +<aspects> +<aspect name="tracing.Tracer"/> +</aspects> +</aspectj> + diff --git a/tests/ltw/inclExcl/pkg/Main.aj b/tests/ltw/inclExcl/pkg/Main.aj new file mode 100644 index 000000000..6cf8ae986 --- /dev/null +++ b/tests/ltw/inclExcl/pkg/Main.aj @@ -0,0 +1,46 @@ +package pkg; + +import java.io.File; + +public class Main { + public static void main(String argz[]) { + foo(); + } + + public static void foo() { + (new pkg.sub.Foo()).foo(); + + File dumpDir = new File("_ajdump"); + lsLR(dumpDir); + + // the LTW harness should clean up _ajdump files! + cleanup(dumpDir); + } + + public static void lsLR(File dir) { + String[] files = dir.list(); + if (files == null) return; + for (int i=0; i<files.length; i++) { + File f = new File(dir, files[i]); + if (f.isFile()) { + System.err.println(files[i]); + } else { + lsLR(f); + } + } + } + + public static void cleanup(File dir) { + String[] files = dir.list(); + if (files == null) return; + for (int i=0; i<files.length; i++) { + File f = new File(dir, files[i]); + if (f.isFile()) { + f.delete(); + } else { + cleanup(f); + } + } + dir.delete(); + } +} diff --git a/tests/ltw/inclExcl/pkg/sub/Foo.aj b/tests/ltw/inclExcl/pkg/sub/Foo.aj new file mode 100644 index 000000000..f93bcf259 --- /dev/null +++ b/tests/ltw/inclExcl/pkg/sub/Foo.aj @@ -0,0 +1,5 @@ +package pkg.sub; + +public class Foo { + public void foo() {} +} diff --git a/tests/ltw/inclExcl/tracing/Tracer.aj b/tests/ltw/inclExcl/tracing/Tracer.aj new file mode 100644 index 000000000..691eefcbe --- /dev/null +++ b/tests/ltw/inclExcl/tracing/Tracer.aj @@ -0,0 +1,7 @@ +package tracing; + +public aspect Tracer { + before() : execution(* foo()) { + System.err.println(thisJoinPoint); + } +} diff --git a/tests/ltw/inclExcl/tracing/staticinit/Tracer.aj b/tests/ltw/inclExcl/tracing/staticinit/Tracer.aj new file mode 100644 index 000000000..8ceebd2a8 --- /dev/null +++ b/tests/ltw/inclExcl/tracing/staticinit/Tracer.aj @@ -0,0 +1,7 @@ +package tracing.staticinit; + +public aspect Tracer { + before() : staticinitialization(pkg..*) { + System.err.println(thisJoinPoint); + } +} diff --git a/tests/ltw/inclExcl/tracing/staticinit/sub/Tracer.aj b/tests/ltw/inclExcl/tracing/staticinit/sub/Tracer.aj new file mode 100644 index 000000000..2cc3d628a --- /dev/null +++ b/tests/ltw/inclExcl/tracing/staticinit/sub/Tracer.aj @@ -0,0 +1,7 @@ +package tracing.staticinit.sub; + +public aspect Tracer { + before() : staticinitialization(pkg..*) { + System.err.println("sub: "+thisJoinPoint); + } +} |