]> source.dussan.org Git - aspectj.git/commitdiff
343001: testcode and fix: when faulting in binary aspects, fill in decp parents
authoraclement <aclement>
Tue, 26 Apr 2011 16:10:56 +0000 (16:10 +0000)
committeraclement <aclement>
Tue, 26 Apr 2011 16:10:56 +0000 (16:10 +0000)
tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java

index 55a8213a74c621b3d8d3b23d8fc3e5dddbe6b3e6..5408f7ae2791bf45b6e1c59c03c67c83ff8b2aef 100644 (file)
@@ -260,6 +260,31 @@ public class MultiProjectIncrementalTests extends AbstractMultiProjectIncrementa
                assertEquals("{Code=[I]}", thisAspectNode.getDeclareParentsMap().toString());
        }
 
+       public void testBinaryAspectsAndTheModel_343001() throws Exception {
+               String lib = "pr343001_lib";
+               initialiseProject(lib);
+               build(lib);
+               
+               // Check the 'standard build' - the library also has a type affected by the decp so we can check what happens on an 'all source' build
+               IProgramElement theAspect = getModelFor(lib).getHierarchy().findElementForHandleOrCreate("=pr343001_lib<{Super.java'Super",false);
+               assertNotNull(theAspect);
+               IProgramElement sourcelevelDecp = getModelFor(lib).getHierarchy().findElementForHandleOrCreate("=pr343001_lib<{Super.java'Super`declare parents",false);
+               assertNotNull(sourcelevelDecp);
+               assertEquals("[java.io.Serializable]",sourcelevelDecp.getParentTypes().toString());
+               
+               String p = "pr343001";
+               initialiseProject(p);
+               configureAspectPath(p, getProjectRelativePath(lib, "bin"));
+               build(p);
+               
+               IProgramElement theBinaryAspect = getModelFor(p).getHierarchy().findElementForHandleOrCreate("=pr343001/binaries<(Super.class'Super",false);
+               assertNotNull(theBinaryAspect);
+               IProgramElement binaryDecp = getModelFor(p).getHierarchy().findElementForHandleOrCreate("=pr343001/binaries<(Super.class'Super`declare parents",false);
+               assertNotNull(binaryDecp);
+               assertEquals("[java.io.Serializable]",(binaryDecp.getParentTypes()==null?"":binaryDecp.getParentTypes().toString()));
+       }
+
+
        // found whilst looking at 322446 hence that is the testdata name
        public void testAspectInheritance_322664() throws Exception {
                AjdeInteractionTestbed.VERBOSE = true;