aboutsummaryrefslogtreecommitdiffstats
path: root/testing/src/test
diff options
context:
space:
mode:
authorAlexander Kriegisch <Alexander@Kriegisch.name>2021-03-11 18:32:56 +0700
committerAlexander Kriegisch <Alexander@Kriegisch.name>2021-03-11 18:34:30 +0700
commitee2817f3e100444b38ed60a39bd745823985bc3e (patch)
tree773eb1e3fbc20f65d82f8b7cc3548d92438ef31e /testing/src/test
parentf7d471f68281185566a3454dc6ac89cfa0c72f10 (diff)
downloadaspectj-ee2817f3e100444b38ed60a39bd745823985bc3e.tar.gz
aspectj-ee2817f3e100444b38ed60a39bd745823985bc3e.zip
Unify classpath handling in CompileSpec & RunSpec
Replace directory separator '/' and surrogate path separator ',' by platform-specific separators File.separatorChar and File.pathSeparatorChar, respectively. Also make sure that replacement occurs during write access, not read access. This was handled differently in both sibling classes. I am not sure if that helps to fix any Linux CI tests, but it is worth a try. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
Diffstat (limited to 'testing/src/test')
-rw-r--r--testing/src/test/java/org/aspectj/testing/CompileSpec.java6
-rw-r--r--testing/src/test/java/org/aspectj/testing/RunSpec.java12
2 files changed, 7 insertions, 11 deletions
diff --git a/testing/src/test/java/org/aspectj/testing/CompileSpec.java b/testing/src/test/java/org/aspectj/testing/CompileSpec.java
index 254f244a0..ac6ac6af2 100644
--- a/testing/src/test/java/org/aspectj/testing/CompileSpec.java
+++ b/testing/src/test/java/org/aspectj/testing/CompileSpec.java
@@ -85,7 +85,7 @@ public class CompileSpec implements ITestStep {
* @param aspectpath The aspectpath to set.
*/
public void setAspectpath(String aspectpath) {
- this.aspectpath = aspectpath.replace(',',File.pathSeparatorChar);
+ this.aspectpath = aspectpath.replace('/', File.separatorChar).replace(',', File.pathSeparatorChar);
}
/**
* @return Returns the classpath.
@@ -97,7 +97,7 @@ public class CompileSpec implements ITestStep {
* @param classpath The classpath to set.
*/
public void setClasspath(String classpath) {
- this.classpath = classpath.replace(',',File.pathSeparatorChar);
+ this.classpath = classpath.replace('/', File.separatorChar).replace(',', File.pathSeparatorChar);
}
public String getModulepath() {
@@ -105,7 +105,7 @@ public class CompileSpec implements ITestStep {
}
public void setModulepath(String modulepath) {
- this.modulepath = modulepath.replace(',', File.pathSeparatorChar);
+ this.modulepath = modulepath.replace('/', File.separatorChar).replace(',', File.pathSeparatorChar);
}
/**
* @return Returns the files.
diff --git a/testing/src/test/java/org/aspectj/testing/RunSpec.java b/testing/src/test/java/org/aspectj/testing/RunSpec.java
index 4f2b03cf8..2fc786593 100644
--- a/testing/src/test/java/org/aspectj/testing/RunSpec.java
+++ b/testing/src/test/java/org/aspectj/testing/RunSpec.java
@@ -135,23 +135,19 @@ public class RunSpec implements ITestStep {
}
public String getClasspath() {
- if (cpath == null)
- return null;
- return this.cpath.replace('/', File.separatorChar).replace(',', File.pathSeparatorChar);
+ return cpath;
}
public String getModulepath() {
- if (mpath == null)
- return null;
- return this.mpath.replace('/', File.separatorChar).replace(',', File.pathSeparatorChar);
+ return mpath;
}
public void setModulepath(String mpath) {
- this.mpath = mpath;
+ this.mpath = mpath.replace('/', File.separatorChar).replace(',', File.pathSeparatorChar);
}
public void setClasspath(String cpath) {
- this.cpath = cpath;
+ this.cpath = cpath.replace('/', File.separatorChar).replace(',', File.pathSeparatorChar);
}
public void addStdErrSpec(OutputSpec spec) {