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";
}
}
public List getAllOutputLocations() {
- if(allOutputLocations == null) {
+ if (allOutputLocations == null) {
allOutputLocations = new ArrayList();
initLocations();
allOutputLocations.add(classOutputLoc);
public File getDefaultOutputLocation() {
return classOutputLoc;
}
-
+
private void initLocations() {
if (classOutputLoc == null) {
classOutputLoc = new File(testProjectOutputPath);
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();
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