]> source.dussan.org Git - aspectj.git/commitdiff
261380: test and fix
authoraclement <aclement>
Wed, 21 Jan 2009 00:12:57 +0000 (00:12 +0000)
committeraclement <aclement>
Wed, 21 Jan 2009 00:12:57 +0000 (00:12 +0000)
tests/multiIncremental/261380/base/src/test/C.java [new file with mode: 0644]
tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java

diff --git a/tests/multiIncremental/261380/base/src/test/C.java b/tests/multiIncremental/261380/base/src/test/C.java
new file mode 100644 (file)
index 0000000..a7feb0a
--- /dev/null
@@ -0,0 +1,15 @@
+package test;
+
+public class C {
+       public C() {
+               new C(); 
+       }
+       
+//     public static void main(String[] args) {
+//             new C();
+//     }
+}
+
+aspect X {
+    before () : call(public *..C.new()) {}
+}
index 639b54ec0cf7718ff1b011cb7aa8ccc624ed83f6..74710c1c5320075f97af2ee11bc90987836fb936 100644 (file)
@@ -70,6 +70,19 @@ public class MultiProjectIncrementalTests extends AbstractMultiProjectIncrementa
                }
                assertEquals("Should have found the two types in: " + ps, 2, count);
        }
+       
+       public void testConstructorAdvice_pr261380() throws Exception {
+               String p = "261380";
+               initialiseProject(p);
+               build(p);
+               IRelationshipMap irm = getModelFor(p).getRelationshipMap();
+               IRelationship ir = (IRelationship)irm.get("=261380<test{C.java}X&before").get(0);
+               List targets = ir.getTargets();
+               assertEquals(1,targets.size());
+               System.out.println(targets.get(0));
+               String handle = (String) targets.get(0);
+               assertEquals("Expected the handle for the code node inside the constructor decl","=261380<test{C.java[C~C?constructor-call(void test.C.<init>())",handle);
+       }
 
        /*
         * A.aj package pack; public aspect A { pointcut p() : call( C.method before() : p() { // line 7 } }