]> source.dussan.org Git - aspectj.git/commitdiff
265729: fault in binary aspects for itds/decps and search for them correctly
authoraclement <aclement>
Tue, 24 Feb 2009 19:17:31 +0000 (19:17 +0000)
committeraclement <aclement>
Tue, 24 Feb 2009 19:17:31 +0000 (19:17 +0000)
tests/src/org/aspectj/systemtest/ajc164/Ajc164Tests.java
tests/src/org/aspectj/systemtest/ajc164/ajc164.xml
tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java

index 6de409bdd0b3b26fbcebe8b3d2fa9bbceec9ab69..6e6542370c30f10c56d2c75843a75c4e70c1fe2b 100644 (file)
@@ -32,13 +32,17 @@ import org.aspectj.testing.XMLBasedAjcTestCase;
 
 public class Ajc164Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
 
-       public void testAnnoInherited_pr265695() {
-               runTest("anno inherited");
-       }
-
+       // public void testAnnoInherited_pr265695() {
+       // runTest("anno inherited");
+       // }
+       //
        // public void testAnnoInherited_pr265695_2() {
        // runTest("new syntax for inherited anno - 1");
        // }
+       //
+       // public void testAnnoInherited_pr265695_3() {
+       // runTest("new syntax for inherited anno - 3");
+       // }
 
        public void testParserProblemSubArrayPatterns_pr148508() {
                runTest("parser problem for array subtypes");
index 11acc297908387958257a499b5d87a3a3799c682..c2a62e69fdc0da1c2f5a195828ea646ef28bbda1 100644 (file)
    
    <ajc-test dir="bugs164/pr265695" title="new syntax for inherited anno - 1">
      <compile files="AspNew.aj" options="-1.5 -showWeaveInfo">
-       <message kind="weave" line="22" text="foo"/>
+       <message kind="weave" text="Join point"/>
+     </compile>
+   </ajc-test>
+   
+   <ajc-test dir="bugs164/pr265695" title="new syntax for inherited anno - 3">
+     <compile files="AspNew2.aj" options="-1.5 -showWeaveInfo">
+       <message kind="weave" text="Join point"/>
      </compile>
    </ajc-test>
     
index 4282ae5afe221ceee2d2c93adaf62c418c1d5306..9a54cbd166f63d3cddc25492a52abdb91f1a764c 100644 (file)
@@ -50,6 +50,55 @@ import org.aspectj.util.FileUtil;
  */
 public class MultiProjectIncrementalTests extends AbstractMultiProjectIncrementalAjdeInteractionTestbed {
 
+       public void testPR265729() {
+               AjdeInteractionTestbed.VERBOSE = true;
+               String lib = "pr265729_lib";
+               initialiseProject(lib);
+               // addClasspathEntryChanged(lib, getProjectRelativePath(p1, "bin").toString());
+               build(lib);
+               checkWasFullBuild();
+
+               String cli = "pr265729_client";
+               initialiseProject(cli);
+
+               addClasspathEntry(cli, new File("../lib/junit/junit.jar"));
+               configureAspectPath(cli, getProjectRelativePath(lib, "bin"));
+               build(cli);
+               checkWasFullBuild();
+
+               IProgramElement root = getModelFor(cli).getHierarchy().getRoot();
+
+               dumptree(root, 0);
+               PrintWriter pw = new PrintWriter(System.out);
+               try {
+                       getModelFor(cli).dumprels(pw);
+                       pw.flush();
+               } catch (Exception e) {
+               }
+               IRelationshipMap irm = getModelFor(cli).getRelationshipMap();
+               IRelationship ir = (IRelationship) irm.get("=pr265729_client<be.cronos.aop{App.java[App").get(0);
+               // This type should be affected by an ITD and a declare parents
+               // could be either way round
+               String h1 = (String) ir.getTargets().get(0);
+               String h2 = (String) ir.getTargets().get(1);
+
+               // For ITD: public void I.g(String s) {}
+               // Node in tree: I.g(java.lang.String) [inter-type method]
+               // Handle: =pr265729_client<be.cronos.aop{App.java}X)I.g)QString;
+
+               if (h1.endsWith("parents")) {
+                       assertEquals("=pr265729_client/binaries<be.cronos.aop.aspects*InterTypeAspect.aj}InterTypeAspect`declare parents", h1);
+                       assertEquals(
+                                       "=pr265729_client/binaries<be.cronos.aop.aspects*InterTypeAspect.aj}InterTypeAspect)InterTypeAspectInterface.foo)I",
+                                       h2);
+               } else {
+                       assertEquals("=pr265729_client/binaries<be.cronos.aop.aspects*InterTypeAspect.aj}InterTypeAspect`declare parents", h2);
+                       assertEquals(
+                                       "=pr265729_client/binaries<be.cronos.aop.aspects*InterTypeAspect.aj}InterTypeAspect)InterTypeAspectInterface.foo)I",
+                                       h1);
+               }
+       }
+
        public void testXmlConfiguredProject() {
                AjdeInteractionTestbed.VERBOSE = true;
                String p = "xmlone";
@@ -627,7 +676,8 @@ public class MultiProjectIncrementalTests extends AbstractMultiProjectIncrementa
                // File sourceFolderTwo = getProjectRelativePath("MultiSource", "src2");
                // File sourceFolderThree = getProjectRelativePath("MultiSource",
                // "src3");
-               addSourceFolderForSourceFile("MultiSource", getProjectRelativePath("MultiSource", "src1/CodeOne.java"), "src1");
+               // src1 source folder slashed as per 264563
+               addSourceFolderForSourceFile("MultiSource", getProjectRelativePath("MultiSource", "src1/CodeOne.java"), "src1/");
                addSourceFolderForSourceFile("MultiSource", getProjectRelativePath("MultiSource", "src2/CodeTwo.java"), "src2");
                addSourceFolderForSourceFile("MultiSource", getProjectRelativePath("MultiSource", "src3/pkg/CodeThree.java"), "src3");
                build("MultiSource");