Index: src/org/aspectj/testing/harness/bridge/Sandbox.java =================================================================== RCS file: /home/technology/org.aspectj/modules/testing/src/org/aspectj/testing/harness/bridge/Sandbox.java,v retrieving revision 1.13 diff -u -r1.13 Sandbox.java --- src/org/aspectj/testing/harness/bridge/Sandbox.java 12 May 2005 11:54:29 -0000 1.13 +++ src/org/aspectj/testing/harness/bridge/Sandbox.java 3 May 2006 15:43:15 -0000 @@ -510,7 +510,7 @@ int len = (null == paths ? 0 : paths.length); for (int j = 0; j < len; j++) { File f = paths[j]; - if (FileUtil.hasZipSuffix(f) && (!readable || f.canRead())) { + if (FileUtil.isZipFile(f) && (!readable || f.canRead())) { result.add(f); } } Index: newsrc/org/aspectj/testing/CompileSpec.java =================================================================== RCS file: /home/technology/org.aspectj/modules/testing/newsrc/org/aspectj/testing/CompileSpec.java,v retrieving revision 1.6 diff -u -r1.6 CompileSpec.java --- newsrc/org/aspectj/testing/CompileSpec.java 7 Nov 2005 10:53:34 -0000 1.6 +++ newsrc/org/aspectj/testing/CompileSpec.java 3 May 2006 15:43:15 -0000 @@ -134,8 +134,7 @@ * @param inpath The inpath to set. */ public void setInpath(String inpath) { - this.inpath = inpath.replace(',',File.pathSeparatorChar); - this.inpath = inpath.replace(';',File.pathSeparatorChar); + this.inpath = inpath.replace(',',File.pathSeparatorChar).replace(';',File.pathSeparatorChar); } /** * @return Returns the options. Index: newsrc/org/aspectj/testing/WeaveSpec.java =================================================================== RCS file: /home/technology/org.aspectj/modules/testing/newsrc/org/aspectj/testing/WeaveSpec.java,v retrieving revision 1.2 diff -u -r1.2 WeaveSpec.java --- newsrc/org/aspectj/testing/WeaveSpec.java 5 Oct 2005 12:23:52 -0000 1.2 +++ newsrc/org/aspectj/testing/WeaveSpec.java 3 May 2006 15:43:15 -0000 @@ -62,6 +62,7 @@ } setClasspath("classes.jar"); args = buildArgs(); +// inTestCase.setJarWeaverNext(new CmdLineWeaver()); result = inTestCase.ajc(base,args); inTestCase.assertNoMessages(result,failMessage); createJar(sandbox,"aspects.jar",false); Index: newsrc/org/aspectj/testing/RunSpec.java =================================================================== RCS file: /home/technology/org.aspectj/modules/testing/newsrc/org/aspectj/testing/RunSpec.java,v retrieving revision 1.8 diff -u -r1.8 RunSpec.java --- newsrc/org/aspectj/testing/RunSpec.java 6 Dec 2005 13:02:47 -0000 1.8 +++ newsrc/org/aspectj/testing/RunSpec.java 3 May 2006 15:43:15 -0000 @@ -14,7 +14,9 @@ import java.io.File; import java.io.IOException; import java.util.ArrayList; +import java.util.Enumeration; import java.util.List; +import java.util.Properties; import java.util.StringTokenizer; import org.aspectj.tools.ajc.AjcTestCase; @@ -53,12 +55,49 @@ // System.err.println("? execute() inTestCase='" + inTestCase + "', ltwFile=" + ltwFile); boolean useLtw = copyLtwFile(inTestCase.getSandboxDirectory()); copyXlintFile(inTestCase.getSandboxDirectory()); - AjcTestCase.RunResult rr = inTestCase.run(getClassToRun(),args,getClasspath(),useLtw); - if (stdErrSpec != null) { - stdErrSpec.matchAgainst(rr.getStdErr()); + try { + setSystemProperty("test.base.dir", inTestCase.getSandboxDirectory().getAbsolutePath()); + + AjcTestCase.RunResult rr = inTestCase.run(getClassToRun(),args,getClasspath(),useLtw); + + if (stdErrSpec != null) { + stdErrSpec.matchAgainst(rr.getStdErr()); + } + if (stdOutSpec != null) { + stdOutSpec.matchAgainst(rr.getStdOut()); + } + } finally { + restoreProperties(); } - if (stdOutSpec != null) { - stdOutSpec.matchAgainst(rr.getStdOut()); + } + + /* + * Logic to save/restore system properties. Copied from LTWTests. + * As Matthew noted, need to refactor LTWTests to use this + */ + + private Properties savedProperties = new Properties(); + + public void setSystemProperty (String key, String value) { + Properties systemProperties = System.getProperties(); + copyProperty(key,systemProperties,savedProperties); + systemProperties.setProperty(key,value); + } + + private static void copyProperty (String key, Properties from, Properties to) { + String value = from.getProperty(key,NULL); + to.setProperty(key,value); + } + + private final static String NULL = "null"; + + protected void restoreProperties() { + Properties systemProperties = System.getProperties(); + for (Enumeration enu = savedProperties.keys(); enu.hasMoreElements(); ) { + String key = (String)enu.nextElement(); + String value = savedProperties.getProperty(key); + if (value == NULL) systemProperties.remove(key); + else systemProperties.setProperty(key,value); } } @@ -84,7 +123,7 @@ public String getClasspath() { if (cpath == null) return null; - return this.cpath.replace('/', File.separatorChar); + return this.cpath.replace('/', File.separatorChar).replace(',', File.pathSeparatorChar); } public void setClasspath(String cpath) {