]> source.dussan.org Git - aspectj.git/commitdiff
269652: incremental builds and prodding StatefulNameEnvironment
authoraclement <aclement>
Thu, 23 Jul 2009 19:50:21 +0000 (19:50 +0000)
committeraclement <aclement>
Thu, 23 Jul 2009 19:50:21 +0000 (19:50 +0000)
tests/multiIncremental/pr280380/inc1/src/g/AnAspect.aj
tests/multiIncremental/pr280380/inc2/src/g/AnAspect.aj [new file with mode: 0644]
tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java

index c3538cb317d0148341da7e5e21217bf8aa726f77..edd0d76286cea98d88a2c9923f37d0bc59e3c0c4 100644 (file)
@@ -1,7 +1,7 @@
 package g;
 
 import f.AClass;
-import f.*;
+//import f.*;
 
 public aspect AnAspect {
        public int AClass.xxxx;
diff --git a/tests/multiIncremental/pr280380/inc2/src/g/AnAspect.aj b/tests/multiIncremental/pr280380/inc2/src/g/AnAspect.aj
new file mode 100644 (file)
index 0000000..aea980c
--- /dev/null
@@ -0,0 +1,15 @@
+package g;
+
+import f.AClass;
+
+public aspect AnAspect {
+       public int f.AClass.xxxx;
+       
+       public int AClass.y() {
+               return 0;
+       }
+       
+       AClass.new() {
+               this();
+       }
+}  
index ee2b22be4351792eae106d96678e40431986d209..033f45a32696b4ce108e9fe75ef1cba32d176c7f 100644 (file)
@@ -124,21 +124,46 @@ public class MultiProjectIncrementalTests extends AbstractMultiProjectIncrementa
        // printModel(cli);
        // }
 
-       // public void testIncrementalFqItds_280380() throws Exception {
-       // String p = "pr280380";
-       // initialiseProject(p);
-       // build(p);
-       // printModel(p);
-       // alter(p, "inc1");
-       // build(p);
-       // printModel(p);
-       // // Hid:1:(targets=3) =pr280380<f{AClass.java[AClass (aspect declarations) =pr280380<g*AnAspect.aj}AnAspect)AClass.xxxx
-       // // Hid:2:(targets=3) =pr280380<f{AClass.java[AClass (aspect declarations) =pr280380<g*AnAspect.aj}AnAspect)AClass.y
-       // // Hid:3:(targets=3) =pr280380<f{AClass.java[AClass (aspect declarations) =pr280380<g*AnAspect.aj}AnAspect)AClass.AClass_new
-       // // Hid:4:(targets=1) =pr280380<g*AnAspect.aj}AnAspect)AClass.y (declared on) =pr280380<f{AClass.java[AClass
-       // // Hid:5:(targets=1) =pr280380<g*AnAspect.aj}AnAspect)AClass.AClass_new (declared on) =pr280380<f{AClass.java[AClass
-       // // Hid:6:(targets=1) =pr280380<g*AnAspect.aj}AnAspect)AClass.xxxx (declared on) =pr280380<f{AClass.java[AClass
-       // }
+       // just simple incremental build - no code change, just the aspect touched
+       public void testIncrementalFqItds_280380() throws Exception {
+               String p = "pr280380";
+               initialiseProject(p);
+               build(p);
+               // printModel(p);
+               alter(p, "inc1");
+               build(p);
+               // should not be an error about f.AClass not being found
+               assertNoErrors(p);
+               // printModel(p);
+       }
+
+       // modified aspect so target is fully qualified on the incremental change
+       public void testIncrementalFqItds_280380_2() throws Exception {
+               String p = "pr280380";
+               initialiseProject(p);
+               build(p);
+               // printModel(p);
+               assertEquals(6, getModelFor(p).getRelationshipMap().getEntries().size());
+               // Hid:1:(targets=3) =pr280380<f{AClass.java[AClass (aspect declarations) =pr280380<g*AnAspect.aj}AnAspect)AClass.xxxx
+               // Hid:2:(targets=3) =pr280380<f{AClass.java[AClass (aspect declarations) =pr280380<g*AnAspect.aj}AnAspect)AClass.y
+               // Hid:3:(targets=3) =pr280380<f{AClass.java[AClass (aspect declarations) =pr280380<g*AnAspect.aj}AnAspect)AClass.AClass_new
+               // Hid:4:(targets=1) =pr280380<g*AnAspect.aj}AnAspect)AClass.y (declared on) =pr280380<f{AClass.java[AClass
+               // Hid:5:(targets=1) =pr280380<g*AnAspect.aj}AnAspect)AClass.AClass_new (declared on) =pr280380<f{AClass.java[AClass
+               // Hid:6:(targets=1) =pr280380<g*AnAspect.aj}AnAspect)AClass.xxxx (declared on) =pr280380<f{AClass.java[AClass
+
+               alter(p, "inc2");
+               build(p);
+               // should not be an error about f.AClass not being found
+               assertNoErrors(p);
+               // printModel(p);
+               assertEquals(6, getModelFor(p).getRelationshipMap().getEntries().size());
+               // Hid:1:(targets=3) =pr280380<f{AClass.java[AClass (aspect declarations) =pr280380<g*AnAspect.aj}AnAspect)AClass.xxxx
+               // Hid:2:(targets=3) =pr280380<f{AClass.java[AClass (aspect declarations) =pr280380<g*AnAspect.aj}AnAspect)AClass.y
+               // Hid:3:(targets=3) =pr280380<f{AClass.java[AClass (aspect declarations) =pr280380<g*AnAspect.aj}AnAspect)AClass.AClass_new
+               // Hid:4:(targets=1) =pr280380<g*AnAspect.aj}AnAspect)AClass.y (declared on) =pr280380<f{AClass.java[AClass
+               // Hid:5:(targets=1) =pr280380<g*AnAspect.aj}AnAspect)AClass.AClass_new (declared on) =pr280380<f{AClass.java[AClass
+               // Hid:6:(targets=1) =pr280380<g*AnAspect.aj}AnAspect)AClass.xxxx (declared on) =pr280380<f{AClass.java[AClass
+       }
 
        public void testIncrementalCtorItdHandle_280383() throws Exception {
                String p = "pr280383";
@@ -187,6 +212,7 @@ public class MultiProjectIncrementalTests extends AbstractMultiProjectIncrementa
                assertNotNull(ir);
                alter(p, "inc1");
                build(p);
+               printModel(p);
                irm = getModelFor(p).getRelationshipMap();
                List rels = irm.get("=pr276399/src<*X.aj}X&after"); // should be gone after the inc build
                assertNull(rels);