]> source.dussan.org Git - aspectj.git/commitdiff
235204: test
authoraclement <aclement>
Tue, 3 Jun 2008 04:38:40 +0000 (04:38 +0000)
committeraclement <aclement>
Tue, 3 Jun 2008 04:38:40 +0000 (04:38 +0000)
tests/bugs161/pr235204/RecursiveCatcher.java [new file with mode: 0644]
tests/src/org/aspectj/systemtest/ajc161/Ajc161Tests.java
tests/src/org/aspectj/systemtest/ajc161/ajc161.xml

diff --git a/tests/bugs161/pr235204/RecursiveCatcher.java b/tests/bugs161/pr235204/RecursiveCatcher.java
new file mode 100644 (file)
index 0000000..4a3bebd
--- /dev/null
@@ -0,0 +1,21 @@
+
+package recursivepackage;
+
+public aspect RecursiveCatcher {
+
+       pointcut recur() : 
+           call(public void 
+                           *.recursiveCall(int));
+
+
+       before(): recur() {
+           // empty
+       }
+
+
+        public void recursiveCall(int i) {  // marker is here
+                                recursiveCall(i);  // marker should be here
+        }
+
+}
+
index e367736243ec79b460cb790aad2ff52af6f58de7..d03eebb5b4ad1bae06995c8747875cdf7cfd4cce 100644 (file)
 package org.aspectj.systemtest.ajc161;
 
 import java.io.File;
+import java.util.Iterator;
+import java.util.Set;
 
 import junit.framework.Test;
 
+import org.aspectj.asm.AsmManager;
+import org.aspectj.asm.IRelationshipMap;
 import org.aspectj.testing.XMLBasedAjcTestCase;
 
 public class Ajc161Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
        
        // AspectJ1.6.1
-       public void testITDPrecedence_pr233838_1() { runTest("itd precedence - 1"); }
+    public void testIncorrectRelationship_pr235204() {
+        runTest("incorrect call relationship");
+        IRelationshipMap irm = AsmManager.getDefault().getRelationshipMap();
+        Set entries = irm.getEntries();
+        String gotit = "";
+        for (Iterator iterator = entries.iterator(); iterator.hasNext();) {
+            Object object = (Object) iterator.next();
+            gotit = (String) object;
+            break;
+        }
+        if (gotit.indexOf("method-call") == -1) {
+            String expected = "<recursivepackage{RecursiveCatcher.java}RecursiveCatcher~recursiveCall~I?method-call(void recursivepackage.RecursiveCatcher.recursiveCall(int))";
+            fail("Expected '" + expected + "' but got '" + gotit + "'");
+        }
+    }
+
+    public void testITDPrecedence_pr233838_1() {
+        runTest("itd precedence - 1"); }
        public void testITDPrecedence_pr233838_2() { runTest("itd precedence - 2"); }
        public void testGetFieldGenerics_pr227401() { runTest("getfield problem with generics");}
        public void testGenericAbstractAspects_pr231478() { runTest("generic abstract aspects"); }
index d75609647d4d9558cf9d1825d741a010e334c507..8a48e58c5080c5b1295cf1862999bd1b7a2a486b 100644 (file)
@@ -3,6 +3,11 @@
 <!-- AspectJ v1.6.1 Tests -->
 <suite>
 
+
+    <ajc-test dir="bugs161/pr235204" title="incorrect call relationship">
+        <compile files="RecursiveCatcher.java" options="-1.5 -emacssym"/>
+    </ajc-test>
+    
     <ajc-test dir="bugs161/pr233838" title="itd precedence - 1">
         <compile files="Z.java" options="-1.5"/>
         <run class="Z">