From cb290a9cc1316ba47f2b673bc5fd474da954d611 Mon Sep 17 00:00:00 2001 From: aclement Date: Fri, 19 Sep 2008 00:14:48 +0000 Subject: [PATCH] 242797: latest fixes for using * rather than ? in sigs --- .../MultiProjTestOutputLocationManager.java | 31 +++++++++---------- .../tools/MultiProjectIncrementalTests.java | 22 +++++++++++++ 2 files changed, 36 insertions(+), 17 deletions(-) diff --git a/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjTestOutputLocationManager.java b/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjTestOutputLocationManager.java index dcaab43b6..d48c5f2cd 100644 --- a/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjTestOutputLocationManager.java +++ b/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjTestOutputLocationManager.java @@ -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(); diff --git a/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java b/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java index 11c069743..5ba550163 100644 --- a/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java +++ b/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java @@ -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 -- 2.39.5