]> source.dussan.org Git - aspectj.git/commitdiff
242797: latest fixes for using * rather than ? in sigs
authoraclement <aclement>
Fri, 19 Sep 2008 00:14:48 +0000 (00:14 +0000)
committeraclement <aclement>
Fri, 19 Sep 2008 00:14:48 +0000 (00:14 +0000)
tests/src/org/aspectj/systemtest/incremental/tools/MultiProjTestOutputLocationManager.java
tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java

index dcaab43b6ae396dc12a9ef9cf52093490528cd6b..d48c5f2cd8649d432fe6a85b48fdfbc4881a81c9 100644 (file)
@@ -20,19 +20,18 @@ import java.util.Map;
 import org.aspectj.ajde.core.IOutputLocationManager;
 
 /**
- * An IOutputLocationManager which by default sends all output to the 
- * testProjectPath\bin directory. However, there are getter methods which
- * enable sending resources and classes to different output dirs. Doesn't
- * enable sending different classes to different output locations.
+ * An IOutputLocationManager which by default sends all output to the testProjectPath\bin directory. However, there are getter
+ * methods which enable sending resources and classes to different output dirs. Doesn't enable sending different classes to
+ * different output locations.
  */
 public class MultiProjTestOutputLocationManager implements IOutputLocationManager {
 
-       private String testProjectOutputPath;
+       private final String testProjectOutputPath;
        private File classOutputLoc;
        private File resourceOutputLoc;
-       private Map sourceFolders = new HashMap();
+       private final Map sourceFolders = new HashMap();
        private List allOutputLocations;
-       
+
        public MultiProjTestOutputLocationManager(String testProjectPath) {
                this.testProjectOutputPath = testProjectPath + File.separator + "bin";
        }
@@ -48,7 +47,7 @@ public class MultiProjTestOutputLocationManager implements IOutputLocationManage
        }
 
        public List getAllOutputLocations() {
-               if(allOutputLocations == null) {
+               if (allOutputLocations == null) {
                        allOutputLocations = new ArrayList();
                        initLocations();
                        allOutputLocations.add(classOutputLoc);
@@ -62,7 +61,7 @@ public class MultiProjTestOutputLocationManager implements IOutputLocationManage
        public File getDefaultOutputLocation() {
                return classOutputLoc;
        }
-       
+
        private void initLocations() {
                if (classOutputLoc == null) {
                        classOutputLoc = new File(testProjectOutputPath);
@@ -71,30 +70,28 @@ public class MultiProjTestOutputLocationManager implements IOutputLocationManage
                        resourceOutputLoc = new File(testProjectOutputPath);
                }
        }
-       
+
        // -------------- setter methods useful for testing -------------
        public void setOutputLocForClass(File f) {
                classOutputLoc = f;
        }
-       
-       public void setSourceFolderFor(File sourceFile,String sourceFolder) {
+
+       public void setSourceFolderFor(File sourceFile, String sourceFolder) {
                try {
-                       System.out.println("Stored against "+sourceFile.getCanonicalPath());
-                       sourceFolders.put(sourceFile.getCanonicalPath(),sourceFolder);
+                       sourceFolders.put(sourceFile.getCanonicalPath(), sourceFolder);
                } catch (IOException e) {
                        e.printStackTrace();
                        throw new RuntimeException(e);
                }
        }
-       
+
        public void setOutputLocForResource(File f) {
                resourceOutputLoc = f;
        }
 
        public String getSourceFolderForFile(File sourceFile) {
                try {
-                       System.out.println("Looked up against "+sourceFile.getCanonicalPath());
-                       String f = (String)sourceFolders.get(sourceFile.getCanonicalPath());
+                       String f = (String) sourceFolders.get(sourceFile.getCanonicalPath());
                        return f;
                } catch (IOException e) {
                        e.printStackTrace();
index 11c0697438f8d97efe45d44f856bcbd85c198048..5ba55016365bcbe39537b6a19b23612072b69856 100644 (file)
@@ -291,6 +291,28 @@ public class MultiProjectIncrementalTests extends AbstractMultiProjectIncrementa
                checkForError("P1", "invalid aspectpath entry");
        }
 
+       // incorrect use of '?' when it should be '*'
+       public void testAspectPath_pr242797_c46() {
+               String bug = "pr242797_1";
+               String bug2 = "pr242797_2";
+               initialiseProject(bug);
+               initialiseProject(bug2);
+               configureAspectPath(bug2, getProjectRelativePath(bug, "bin"));
+               build(bug);
+               build(bug2);
+       }
+
+       // 
+       public void testAspectPath_pr242797_c41() {
+               String bug = "pr242797_3";
+               String bug2 = "pr242797_4";
+               initialiseProject(bug);
+               initialiseProject(bug2);
+               configureAspectPath(bug2, getProjectRelativePath(bug, "bin"));
+               build(bug);
+               build(bug2);
+       }
+
        /**
         * Build a project containing a resource - then mark the resource readOnly(), then do an inc-compile, it will report an error
         * about write access to the resource in the output folder being denied