aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorjhugunin <jhugunin>2003-02-13 22:24:56 +0000
committerjhugunin <jhugunin>2003-02-13 22:24:56 +0000
commit19c3e16d2212bdd41144da2150c8ef46b4a759a5 (patch)
treebc60f252d4b8259bba3b532a68c8137cfbadaaaf /tests
parentd15eb325fc77d9f1eb0ac9ec1f6886562d531105 (diff)
downloadaspectj-19c3e16d2212bdd41144da2150c8ef46b4a759a5.tar.gz
aspectj-19c3e16d2212bdd41144da2150c8ef46b4a759a5.zip
fixed Bug 31423: adviceexecution not working
Diffstat (limited to 'tests')
-rw-r--r--tests/ajcTests.xml6
-rw-r--r--tests/bugs/AdviceExec.java31
2 files changed, 37 insertions, 0 deletions
diff --git a/tests/ajcTests.xml b/tests/ajcTests.xml
index 15864594a..ab1a6fe0d 100644
--- a/tests/ajcTests.xml
+++ b/tests/ajcTests.xml
@@ -5573,4 +5573,10 @@
<run class="test.Test3"/>
</ajc-test>
+ <ajc-test dir="bugs" pr="31423"
+ title="Pointcut adviceexecution() does not work">
+ <compile files="AdviceExec.java"/>
+ <run class="AdviceExec"/>
+ </ajc-test>
+
</suite>
diff --git a/tests/bugs/AdviceExec.java b/tests/bugs/AdviceExec.java
new file mode 100644
index 000000000..7d28f28fe
--- /dev/null
+++ b/tests/bugs/AdviceExec.java
@@ -0,0 +1,31 @@
+// for Bug#: 31423
+import org.aspectj.testing.Tester;
+
+
+public class AdviceExec {
+ public static void main(String[] args) {
+ Tester.checkEqual(Aspect1.ran, 2, "Aspect1 ran");
+ Tester.checkEqual(Aspect2.ran, 2, "Aspect2 ran");
+ }
+}
+
+aspect Aspect1 {
+ static int ran = 0;
+ before() : execution(* AdviceExec.*(..)) {
+ //System.out.println("Reached " + thisJoinPoint);
+ ran++;
+ }
+
+ void around(): execution(* AdviceExec.*(..)) {
+ ran++;
+ proceed();
+ }
+}
+
+aspect Aspect2 {
+ static int ran = 0;
+ before() : adviceexecution() && !within(Aspect2) {
+ //System.out.println("Reached " + thisJoinPoint);
+ ran++;
+ }
+}