aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authoraclement <aclement>2006-01-26 15:32:48 +0000
committeraclement <aclement>2006-01-26 15:32:48 +0000
commit7e40a6094541d2191f09d810b3330c4858ed8952 (patch)
tree777d77096a21f53726ea5d2ea2794d6d2648cd34 /tests
parent027fe98f13c245e89cc57876dea418d70bff50cb (diff)
downloadaspectj-7e40a6094541d2191f09d810b3330c4858ed8952.tar.gz
aspectj-7e40a6094541d2191f09d810b3330c4858ed8952.zip
helens changes for 125295 - should keep AJDT happy.
Diffstat (limited to 'tests')
-rw-r--r--tests/bugs151/pr125295/pkg/A.aj18
-rw-r--r--tests/bugs151/pr125295/pkg/C.java9
-rw-r--r--tests/src/org/aspectj/systemtest/ajc151/Ajc151Tests.java24
-rw-r--r--tests/src/org/aspectj/systemtest/ajc151/ajc151.xml4
4 files changed, 55 insertions, 0 deletions
diff --git a/tests/bugs151/pr125295/pkg/A.aj b/tests/bugs151/pr125295/pkg/A.aj
new file mode 100644
index 000000000..53aa6bc99
--- /dev/null
+++ b/tests/bugs151/pr125295/pkg/A.aj
@@ -0,0 +1,18 @@
+package pkg;
+
+import org.aspectj.lang.JoinPoint;
+
+public aspect A {
+
+ pointcut p() : within(C) && execution(* *(..));
+
+ before() : p() {
+ }
+
+ after(): execution(void printParameters(..)) {
+ }
+
+ static private void printParameters(JoinPoint jp) {
+ }
+
+}
diff --git a/tests/bugs151/pr125295/pkg/C.java b/tests/bugs151/pr125295/pkg/C.java
new file mode 100644
index 000000000..c03c02777
--- /dev/null
+++ b/tests/bugs151/pr125295/pkg/C.java
@@ -0,0 +1,9 @@
+package pkg;
+
+public class C {
+
+ public void foo(int i, Object o) {
+
+ }
+
+}
diff --git a/tests/src/org/aspectj/systemtest/ajc151/Ajc151Tests.java b/tests/src/org/aspectj/systemtest/ajc151/Ajc151Tests.java
index 12ac259bf..5dda12f07 100644
--- a/tests/src/org/aspectj/systemtest/ajc151/Ajc151Tests.java
+++ b/tests/src/org/aspectj/systemtest/ajc151/Ajc151Tests.java
@@ -14,6 +14,9 @@ import java.io.File;
import junit.framework.Test;
+import org.aspectj.asm.AsmManager;
+import org.aspectj.asm.IHierarchy;
+import org.aspectj.asm.IProgramElement;
import org.aspectj.systemtest.ajc150.GenericsTests;
import org.aspectj.testing.XMLBasedAjcTestCase;
@@ -45,6 +48,27 @@ public class Ajc151Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
GenericsTests.verifyClassSignature(ajc,"ConcreteAspect","LAbstractAspect<LStudent;>;");
}
+ public void testIProgramElementMethods_pr125295() {
+ runTest("new IProgramElement methods");
+ IHierarchy top = AsmManager.getDefault().getHierarchy();
+
+ IProgramElement pe = top.findElementForType("pkg","foo");
+ assertNotNull("Couldn't find 'foo' element in the tree",pe);
+ // check that the defaults return the fully qualified arg
+ assertEquals("foo(int, java.lang.Object)",pe.toLabelString());
+ assertEquals("C.foo(int, java.lang.Object)",pe.toLinkLabelString());
+ assertEquals("foo(int, java.lang.Object)",pe.toSignatureString());
+ // check that can get hold of the non qualified args
+ assertEquals("foo(int, Object)",pe.toLabelString(false));
+ assertEquals("C.foo(int, Object)",pe.toLinkLabelString(false));
+ assertEquals("foo(int, Object)",pe.toSignatureString(false));
+
+ IProgramElement pe2 = top.findElementForType("pkg","printParameters");
+ assertNotNull("Couldn't find 'printParameters' element in the tree",pe2);
+ // the argument is org.aspectj.lang.JoinPoint, check that this is added
+ assertFalse("printParameters method should have arguments",pe2.getParameterTypes().isEmpty());
+ }
+
/////////////////////////////////////////
public static Test suite() {
return XMLBasedAjcTestCase.loadSuite(Ajc151Tests.class);
diff --git a/tests/src/org/aspectj/systemtest/ajc151/ajc151.xml b/tests/src/org/aspectj/systemtest/ajc151/ajc151.xml
index 5dffbdc04..f3d9c5b84 100644
--- a/tests/src/org/aspectj/systemtest/ajc151/ajc151.xml
+++ b/tests/src/org/aspectj/systemtest/ajc151/ajc151.xml
@@ -94,4 +94,8 @@
<run class="ConcreteAspect"/>
</ajc-test>
+ <ajc-test dir="bugs151/pr125295" title="new IProgramElement methods">
+ <compile files="pkg/C.java,pkg/A.aj" options="-emacssym"/>
+ </ajc-test>
+
</suite> \ No newline at end of file