]> source.dussan.org Git - aspectj.git/commitdiff
271201: inpath handles
authoraclement <aclement>
Mon, 6 Apr 2009 19:23:40 +0000 (19:23 +0000)
committeraclement <aclement>
Mon, 6 Apr 2009 19:23:40 +0000 (19:23 +0000)
tests/src/org/aspectj/systemtest/incremental/tools/IncrementalOutputLocationManagerTests.java
tests/src/org/aspectj/systemtest/incremental/tools/MoreOutputLocationManagerTests.java
tests/src/org/aspectj/systemtest/incremental/tools/MultiProjTestOutputLocationManager.java
tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java
tests/src/org/aspectj/systemtest/incremental/tools/OutputLocationManagerTests.java

index 9a04de9d959fb041a57919fb8b5349856ba1404b..0c13b154bac8bf15f9fe1a7e960092a6b4711cdf 100644 (file)
@@ -12,7 +12,9 @@ package org.aspectj.systemtest.incremental.tools;
 
 import java.io.File;
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.List;
+import java.util.Map;
 
 import org.aspectj.ajde.core.IOutputLocationManager;
 
@@ -50,6 +52,10 @@ public class IncrementalOutputLocationManagerTests extends AbstractMultiProjectI
 
                public void reportFileRemove(String outputfile, int filetype) {
                }
+               
+               public Map getInpathMap() {
+                       return Collections.EMPTY_MAP;
+               }
 
                public File getOutputLocationForClass(File compilationUnit) {
                        String path = compilationUnit.getAbsolutePath();
index 5540612910c5fc4591c5c696914ae8627d10c51c..610e6ba81a07ffc65533c0a394edab36637fa94d 100644 (file)
@@ -12,6 +12,7 @@ package org.aspectj.systemtest.incremental.tools;
 
 import java.io.File;
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
@@ -338,6 +339,11 @@ public class MoreOutputLocationManagerTests extends AbstractMultiProjectIncremen
                public File getOutputLocationForClass(File compilationUnit) {
                        return outputLoc;
                }
+               
+               public Map getInpathMap() {
+                       return Collections.EMPTY_MAP;
+               }
+
 
                public File getOutputLocationForResource(File resource) {
                        return outputLoc;
index 2549bee63b3e788b8f713cd7b8ab813fad4fe0ee..a5e93a8249191adb44eda029fadf34b86726ea56 100644 (file)
@@ -13,6 +13,7 @@ package org.aspectj.systemtest.incremental.tools;
 import java.io.File;
 import java.io.IOException;
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -40,6 +41,11 @@ public class MultiProjTestOutputLocationManager implements IOutputLocationManage
                initLocations();
                return classOutputLoc;
        }
+       
+       public Map getInpathMap() {
+               return Collections.EMPTY_MAP;
+       }
+
 
        public File getOutputLocationForResource(File resource) {
                initLocations();
index 9bca0f0dbd08f017721ac6ad8be6c98462a5e82d..234c6333bcc35f26ee4cff8f94994fd10d2db384 100644 (file)
@@ -2815,6 +2815,78 @@ public class MultiProjectIncrementalTests extends AbstractMultiProjectIncrementa
                
 //             alter(p,"inc1");
 //             build(p);
+               dumptree(root, 0);
+               PrintWriter pw = new PrintWriter(System.out);
+               try {
+                 getModelFor(p).dumprels(pw);
+                 pw.flush();
+               } catch (Exception e) {
+               }
+               List l = getModelFor(p).getRelationshipMap().get("=inpathHandles/;<codep(Code.class[Code");
+               assertNotNull(l);
+       }
+       
+       public void testInpathHandles_WithInpathMap_271201() throws Exception {
+               AjdeInteractionTestbed.VERBOSE=true;
+               String p = "inpathHandles";
+               initialiseProject(p);
+
+               String inpathTestingDir = getWorkingDir() + File.separator + "inpathHandles";
+               String inpathDir = inpathTestingDir + File.separator + "binpath";// + File.separator+ "codep";
+               // String expectedOutputDir = inpathTestingDir + File.separator + "bin";
+
+               // set up the inpath to have the directory on it's path
+               System.out.println(inpathDir);
+               File f = new File(inpathDir);
+               Set s = new HashSet();
+               s.add(f);
+               Map m = new HashMap();
+               m.put(f,"wibble");              
+               configureOutputLocationManager(p,new TestOutputLocationManager(getProjectRelativePath(p, ".").toString(),m));
+
+               configureInPath(p, s);
+               build(p);
+
+               IProgramElement root = getModelFor(p).getHierarchy().getRoot();
+               
+//             alter(p,"inc1");
+//             build(p);
+               dumptree(root, 0);
+               PrintWriter pw = new PrintWriter(System.out);
+               try {
+                 getModelFor(p).dumprels(pw);
+                 pw.flush();
+               } catch (Exception e) {
+               }
+               List l = getModelFor(p).getRelationshipMap().get("=inpathHandles/;wibble<codep(Code.class[Code");
+               assertNotNull(l);
+       }
+       
+       // warning about cant change parents of Object is fine
+//     public void testInpathJars_271201() throws Exception {
+//             AjdeInteractionTestbed.VERBOSE=true;
+//             String p = "inpathJars";
+//             initialiseProject(p);
+//
+//             String inpathTestingDir = getWorkingDir() + File.separator + "inpathJars";
+//             String inpathDir = inpathTestingDir + File.separator + "code.jar";
+//             // String expectedOutputDir = inpathTestingDir + File.separator + "bin";
+//
+//             // set up the inpath to have the directory on it's path
+//             System.out.println(inpathDir);
+//             File f = new File(inpathDir);
+//             Set s = new HashSet();
+//             s.add(f);
+//             Map m = new HashMap();
+//             m.put(f,"Gibble");              
+//             configureOutputLocationManager(p,new TestOutputLocationManager(getProjectRelativePath(p, ".").toString(),m));
+//             configureInPath(p, s);
+//             build(p);
+//
+//             IProgramElement root = getModelFor(p).getHierarchy().getRoot();
+//             
+////           alter(p,"inc1");
+////           build(p);
 //             dumptree(root, 0);
 //             PrintWriter pw = new PrintWriter(System.out);
 //             try {
@@ -2822,10 +2894,10 @@ public class MultiProjectIncrementalTests extends AbstractMultiProjectIncrementa
 //               pw.flush();
 //             } catch (Exception e) {
 //             }
-               List l = getModelFor(p).getRelationshipMap().get("=inpathHandles/;<codep(Code.class[Code");
-               assertNotNull(l);
-               System.out.println(l.get(0));
-       }
+//             List l = getModelFor(p).getRelationshipMap().get("=inpathJars/;Gibble<codep(Code.class[Code");
+//             assertNotNull(l);
+//             System.out.println(l.get(0));
+//     }
 
        // --- helper code ---
 
index 579faa43004aa85838185f808a78c13b2fb325d7..2de3976dbe06fe4bc82cbac7a831696a112d52d5 100644 (file)
@@ -13,6 +13,7 @@ package org.aspectj.systemtest.incremental.tools;
 
 import java.io.File;
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -104,6 +105,11 @@ public class OutputLocationManagerTests extends AbstractMultiProjectIncrementalA
 
                public void reportFileRemove(String outputfile, int filetype) {
                }
+               
+               public Map getInpathMap() {
+                       return Collections.EMPTY_MAP;
+               }
+
 
                public File getOutputLocationForClass(File compilationUnit) {
                        String relativePath = "";