aboutsummaryrefslogtreecommitdiffstats
path: root/ajde
diff options
context:
space:
mode:
authormkersten <mkersten>2004-07-27 17:38:25 +0000
committermkersten <mkersten>2004-07-27 17:38:25 +0000
commitc143eb5ec12a8ee9cf480e8bf4a4e12acef38d40 (patch)
tree888e6e219f36aff83236a774e22f82e5b3c51f43 /ajde
parent00882c7b5a504224c714175e5b70f1591ba0722f (diff)
downloadaspectj-c143eb5ec12a8ee9cf480e8bf4a4e12acef38d40.tar.gz
aspectj-c143eb5ec12a8ee9cf480e8bf4a4e12acef38d40.zip
Added declare parents relationship test, party commented out and waiting on Andy's merge.
Diffstat (limited to 'ajde')
-rw-r--r--ajde/testsrc/org/aspectj/ajde/AsmRelationshipsTest.java29
1 files changed, 27 insertions, 2 deletions
diff --git a/ajde/testsrc/org/aspectj/ajde/AsmRelationshipsTest.java b/ajde/testsrc/org/aspectj/ajde/AsmRelationshipsTest.java
index 3f16c6264..407ad1004 100644
--- a/ajde/testsrc/org/aspectj/ajde/AsmRelationshipsTest.java
+++ b/ajde/testsrc/org/aspectj/ajde/AsmRelationshipsTest.java
@@ -12,8 +12,11 @@
package org.aspectj.ajde;
import java.util.Iterator;
+import java.util.List;
-import org.aspectj.asm.*;
+import org.aspectj.asm.AsmManager;
+import org.aspectj.asm.IProgramElement;
+import org.aspectj.asm.IRelationship;
// TODO: check for return types
public class AsmRelationshipsTest extends AjdeTestCase {
@@ -25,11 +28,32 @@ public class AsmRelationshipsTest extends AjdeTestCase {
super(name);
}
+ public void testDeclareParents() {
+ IProgramElement aspect = AsmManager.getDefault().getHierarchy().findElementForType(null, "DeclareCoverage");
+// System.err.println(aspect.getChildren());
+
+ IProgramElement dp = manager.getHierarchy().findElementForLabel(
+ aspect,
+ IProgramElement.Kind.DECLARE_PARENTS,
+ "declare parents: Point");
+
+ assertNotNull(dp);
+ List relations = manager.getRelationshipMap().get(dp);
+
+// assertTrue(false);
+
+// assertTrue(rel.getTargets().size() > 0);
+//
+// checkDeclareMapping("DeclareCoverage", "Point", ,
+// "Point", "matched by", "matches declare",
+// IProgramElement.Kind.DECLARE_PARENTS);
+ }
+
public void testDeclareWarningAndError() {
checkDeclareMapping("DeclareCoverage", "Point", "declare warning: \"Illegal call.\"",
"method-call(void Point.setX(int))", "matched by", "matches declare", IProgramElement.Kind.DECLARE_WARNING);
}
-
+
public void testInterTypeDeclarations() {
checkInterTypeMapping("InterTypeDecCoverage", "Point", "Point.xxx", "Point",
"declared on", "aspect declarations", IProgramElement.Kind.INTER_TYPE_FIELD);
@@ -55,6 +79,7 @@ public class AsmRelationshipsTest extends AjdeTestCase {
IProgramElement beforeExecNode = manager.getHierarchy().findElementForLabel(aspect, kind, beforeExec);
assertNotNull(beforeExecNode);
IRelationship rel = manager.getRelationshipMap().get(beforeExecNode, IRelationship.Kind.DECLARE, forwardRelName);
+ assertTrue(rel.getTargets().size() > 0);
String handle = (String)rel.getTargets().get(0);
assertEquals(manager.getHierarchy().findElementForHandle(handle).toString(), to);