summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ajde.core/testsrc/org/aspectj/ajde/core/TestCompilerConfiguration.java61
1 files changed, 29 insertions, 32 deletions
diff --git a/ajde.core/testsrc/org/aspectj/ajde/core/TestCompilerConfiguration.java b/ajde.core/testsrc/org/aspectj/ajde/core/TestCompilerConfiguration.java
index 5cb3990ec..f4a60a967 100644
--- a/ajde.core/testsrc/org/aspectj/ajde/core/TestCompilerConfiguration.java
+++ b/ajde.core/testsrc/org/aspectj/ajde/core/TestCompilerConfiguration.java
@@ -23,18 +23,15 @@ import org.aspectj.tools.ajc.AjcTests;
import org.aspectj.util.FileUtil;
/**
- * Test implementation of ICompilerConfiguration. Allows users to configure
- * the settings via setter methods. By default returns null for all options
- * except getClasspath(), getJavaOptionsMap() (by default returns that it's
- * 1.3 compliant), getOutputLocationManager(), getSourcePathResources() (it
- * recursively looks for them) and getProjectSourceFiles(). If no source
- * files are specified by the user, then getProjectSourceFiles() returns
- * an empty list.
+ * Test implementation of ICompilerConfiguration. Allows users to configure the settings via setter methods. By default returns null
+ * for all options except getClasspath(), getJavaOptionsMap() (by default returns that it's 1.3 compliant),
+ * getOutputLocationManager(), getSourcePathResources() (it recursively looks for them) and getProjectSourceFiles(). If no source
+ * files are specified by the user, then getProjectSourceFiles() returns an empty list.
*/
public class TestCompilerConfiguration implements ICompilerConfiguration {
private String projectPath;
-
+
private Set aspectpath;
private Set inpath;
private String outjar;
@@ -42,25 +39,22 @@ public class TestCompilerConfiguration implements ICompilerConfiguration {
private String nonStandardOptions;
private List projectSourceFiles = new ArrayList();
private Map sourcePathResources;
-
+
private String srcDirName = "src";
-
+
private IOutputLocationManager outputLoc;
-
+
public TestCompilerConfiguration(String projectPath) {
this.projectPath = projectPath;
}
-
+
public Set getAspectPath() {
return aspectpath;
}
public String getClasspath() {
- return projectPath
- + File.pathSeparator
- + System.getProperty("sun.boot.class.path")
- + File.pathSeparator
- + AjcTests.aspectjrtClasspath();
+ return projectPath + File.pathSeparator + System.getProperty("sun.boot.class.path") + File.pathSeparator
+ + AjcTests.aspectjrtClasspath();
}
public Set getInpath() {
@@ -70,8 +64,8 @@ public class TestCompilerConfiguration implements ICompilerConfiguration {
public Map getJavaOptionsMap() {
if (javaOptions == null) {
javaOptions = new Hashtable();
- javaOptions.put(JavaOptions.COMPLIANCE_LEVEL,JavaOptions.VERSION_13);
- javaOptions.put(JavaOptions.SOURCE_COMPATIBILITY_LEVEL,JavaOptions.VERSION_13);
+ javaOptions.put(JavaOptions.COMPLIANCE_LEVEL, JavaOptions.VERSION_13);
+ javaOptions.put(JavaOptions.SOURCE_COMPATIBILITY_LEVEL, JavaOptions.VERSION_13);
}
return javaOptions;
}
@@ -94,31 +88,31 @@ public class TestCompilerConfiguration implements ICompilerConfiguration {
public List getProjectSourceFiles() {
return projectSourceFiles;
}
-
+
public List getProjectSourceFilesChanged() {
return null;
}
+ public void configurationRead() {
+ }
+
public Map getSourcePathResources() {
if (sourcePathResources == null) {
sourcePathResources = new HashMap();
- /* Allow the user to override the testProjectPath by using sourceRoots */
+ /* Allow the user to override the testProjectPath by using sourceRoots */
File[] srcBase = new File[] { new File(projectPath + File.separator + srcDirName) };
-
+
for (int j = 0; j < srcBase.length; j++) {
File[] fromResources = FileUtil.listFiles(srcBase[j], new FileFilter() {
public boolean accept(File pathname) {
String name = pathname.getName().toLowerCase();
- return !name.endsWith(".class")
- && !name.endsWith(".java")
- && !name.endsWith(".aj")
- && !name.endsWith(".lst")
- && !name.endsWith(".jar");
+ return !name.endsWith(".class") && !name.endsWith(".java") && !name.endsWith(".aj")
+ && !name.endsWith(".lst") && !name.endsWith(".jar");
}
});
for (int i = 0; i < fromResources.length; i++) {
- String normPath = FileUtil.normalizedPath(fromResources[i] ,srcBase[j]);
+ String normPath = FileUtil.normalizedPath(fromResources[i], srcBase[j]);
sourcePathResources.put(normPath, fromResources[i]);
}
@@ -127,7 +121,6 @@ public class TestCompilerConfiguration implements ICompilerConfiguration {
return sourcePathResources;
}
-
// -------------------- setter methods useful for testing ---------------
public void setAspectPath(Set aspectPath) {
this.aspectpath = aspectPath;
@@ -144,7 +137,7 @@ public class TestCompilerConfiguration implements ICompilerConfiguration {
public void setJavaOptions(Map javaOptions) {
this.javaOptions = javaOptions;
}
-
+
public void setNonStandardOptions(String options) {
this.nonStandardOptions = options;
}
@@ -156,9 +149,13 @@ public class TestCompilerConfiguration implements ICompilerConfiguration {
public void setSourcePathResources(Map sourcePathResources) {
this.sourcePathResources = sourcePathResources;
}
-
+
public void setSourceDir(String srcDirName) {
this.srcDirName = srcDirName;
}
-
+
+ public int getConfigurationChanges() {
+ return ICompilerConfiguration.EVERYTHING;
+ }
+
}