aboutsummaryrefslogtreecommitdiffstats
path: root/tests/bugs166
diff options
context:
space:
mode:
authoraclement <aclement>2009-09-04 17:39:50 +0000
committeraclement <aclement>2009-09-04 17:39:50 +0000
commitb58e76c68d96811cbe9b1d4f8c0e245a81d66e5a (patch)
treeb9781a1e1a8d6f03f04af2682d8d6498179f06a0 /tests/bugs166
parentb29f8393e988bbfb4db28c5051bf036ef6551aa2 (diff)
downloadaspectj-b58e76c68d96811cbe9b1d4f8c0e245a81d66e5a.tar.gz
aspectj-b58e76c68d96811cbe9b1d4f8c0e245a81d66e5a.zip
288635: cce munger
Diffstat (limited to 'tests/bugs166')
-rw-r--r--tests/bugs166/pr288635/org/tests/atann/AddAnnotations.aj7
-rw-r--r--tests/bugs166/pr288635/org/tests/atann/AddITDDoMethod.aj9
-rw-r--r--tests/bugs166/pr288635/org/tests/atann/InterceptTraceds.aj13
-rw-r--r--tests/bugs166/pr288635/org/tests/atann/TestClass.java21
-rw-r--r--tests/bugs166/pr288635/org/tests/atann/Traced.java14
5 files changed, 64 insertions, 0 deletions
diff --git a/tests/bugs166/pr288635/org/tests/atann/AddAnnotations.aj b/tests/bugs166/pr288635/org/tests/atann/AddAnnotations.aj
new file mode 100644
index 000000000..a43a6d7b6
--- /dev/null
+++ b/tests/bugs166/pr288635/org/tests/atann/AddAnnotations.aj
@@ -0,0 +1,7 @@
+package org.tests.atann;
+
+public aspect AddAnnotations {
+
+ declare @method : public int *do*(..) : @Traced;
+
+}
diff --git a/tests/bugs166/pr288635/org/tests/atann/AddITDDoMethod.aj b/tests/bugs166/pr288635/org/tests/atann/AddITDDoMethod.aj
new file mode 100644
index 000000000..7202a15bf
--- /dev/null
+++ b/tests/bugs166/pr288635/org/tests/atann/AddITDDoMethod.aj
@@ -0,0 +1,9 @@
+package org.tests.atann;
+
+public aspect AddITDDoMethod {
+
+ public int TestClass.doAnother() {
+ return 2;
+ }
+
+}
diff --git a/tests/bugs166/pr288635/org/tests/atann/InterceptTraceds.aj b/tests/bugs166/pr288635/org/tests/atann/InterceptTraceds.aj
new file mode 100644
index 000000000..77eed521e
--- /dev/null
+++ b/tests/bugs166/pr288635/org/tests/atann/InterceptTraceds.aj
@@ -0,0 +1,13 @@
+package org.tests.atann;
+
+public aspect InterceptTraceds {
+
+ before(Traced t) : execution(@Traced * *.*(..)) && @annotation(t) {
+ if (t != null) {
+ System.out.println("Executing " + thisJoinPoint + " on level " + t.level());
+ } else {
+ System.out.println("Annotation was null on " + thisJoinPoint);
+ }
+ }
+
+}
diff --git a/tests/bugs166/pr288635/org/tests/atann/TestClass.java b/tests/bugs166/pr288635/org/tests/atann/TestClass.java
new file mode 100644
index 000000000..f7265f792
--- /dev/null
+++ b/tests/bugs166/pr288635/org/tests/atann/TestClass.java
@@ -0,0 +1,21 @@
+package org.tests.atann;
+
+public class TestClass {
+
+ @Traced
+ public String doAnnotated() {
+ return "annotated";
+ }
+
+ public int doITDAnnotation() {
+ return 1;
+ }
+
+ public static void main(String[] args) {
+ TestClass tc = new TestClass();
+ tc.doAnnotated();
+ tc.doITDAnnotation();
+ tc.doAnother();
+ }
+
+}
diff --git a/tests/bugs166/pr288635/org/tests/atann/Traced.java b/tests/bugs166/pr288635/org/tests/atann/Traced.java
new file mode 100644
index 000000000..77fd94afe
--- /dev/null
+++ b/tests/bugs166/pr288635/org/tests/atann/Traced.java
@@ -0,0 +1,14 @@
+package org.tests.atann;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.METHOD)
+public @interface Traced {
+
+ String level() default "debug";
+
+}