aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoracolyer <acolyer>2005-11-08 18:16:25 +0000
committeracolyer <acolyer>2005-11-08 18:16:25 +0000
commitf6968e6f134df55243c451e45c303600560e6d04 (patch)
treebf03d8d9c72eac969cc2445effb51a35462d4a64
parentc439e326284d2ffdf4898a50a3d0d5f6a6e99ef1 (diff)
downloadaspectj-f6968e6f134df55243c451e45c303600560e6d04.tar.gz
aspectj-f6968e6f134df55243c451e45c303600560e6d04.zip
tests for pr104220 - poor toString implementations for adviceexecution join points.
-rw-r--r--tests/bugs150/Pr104220.aj29
-rw-r--r--tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java4
-rw-r--r--tests/src/org/aspectj/systemtest/ajc150/ajc150.xml12
3 files changed, 45 insertions, 0 deletions
diff --git a/tests/bugs150/Pr104220.aj b/tests/bugs150/Pr104220.aj
new file mode 100644
index 000000000..a48861387
--- /dev/null
+++ b/tests/bugs150/Pr104220.aj
@@ -0,0 +1,29 @@
+// pr104220 - adviceexecution joinpoint toString forms
+
+public aspect Pr104220 {
+
+ before() : adviceexecution() && !within(Pr104220) {
+ System.out.println(thisJoinPoint.getKind());
+ System.out.println(thisJoinPoint.toString());
+ System.out.println(thisJoinPoint.toShortString());
+ System.out.println(thisJoinPoint.toLongString());
+ }
+
+ public static void main(String[] args) {
+ new C().foo();
+ }
+
+}
+
+class C {
+
+ public void foo() {}
+
+}
+
+aspect SomeAspect {
+
+ before() : execution(* foo(..)) {}
+
+}
+
diff --git a/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java b/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java
index 3f7d593b2..ce90c37a2 100644
--- a/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java
+++ b/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java
@@ -674,6 +674,10 @@ public class Ajc150Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
runTest("Anonymous types and nome matching");
}
+ public void testAdviceExecutionJPToStringForms() {
+ runTest("adviceexecution join point toString forms");
+ }
+
// helper methods.....
public SyntheticRepository createRepos(File cpentry) {
diff --git a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml
index ea7922081..02ad64b6b 100644
--- a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml
+++ b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml
@@ -37,6 +37,18 @@
</run>
</ajc-test>
+ <ajc-test dir="bugs150" pr="104220" title="adviceexecution join point toString forms">
+ <compile files="Pr104220.aj"/>
+ <run class="Pr104220">
+ <stdout>
+ <line text="adviceexecution"/>
+ <line text="adviceexecution(void SomeAspect.before())"/>
+ <line text="adviceexecution(SomeAspect.before())"/>
+ <line text="adviceexecution(void SomeAspect.before())"/>
+ </stdout>
+ </run>
+ </ajc-test>
+
<ajc-test dir="bugs150/pr113066" title="possible static imports bug - 1">
<compile files="Consts.java,TestNPE.java" options="-1.5"/>
</ajc-test>