From 813c038cb5bb67faa82bd34bde9493766968c25b Mon Sep 17 00:00:00 2001 From: aclement Date: Tue, 26 Apr 2011 16:10:56 +0000 Subject: [PATCH] 343001: testcode and fix: when faulting in binary aspects, fill in decp parents --- .../tools/MultiProjectIncrementalTests.java | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java b/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java index 55a8213a7..5408f7ae2 100644 --- a/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java +++ b/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java @@ -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; -- 2.39.5