diff options
author | aclement <aclement> | 2005-10-14 07:23:40 +0000 |
---|---|---|
committer | aclement <aclement> | 2005-10-14 07:23:40 +0000 |
commit | 8982544f13eb5cb082ca19db2bd2c5f77b1e5965 (patch) | |
tree | d7e4c96b17ce76331686fc3cab53326d0087f039 /testing/newsrc | |
parent | 51a0fe4edd56a626ef5570e43bd2225be0dcb4dd (diff) | |
download | aspectj-8982544f13eb5cb082ca19db2bd2c5f77b1e5965.tar.gz aspectj-8982544f13eb5cb082ca19db2bd2c5f77b1e5965.zip |
Code for enhancement 107741: Updated WeavingURLClassLoader (thanks to Matthew Webster for the patch)
Diffstat (limited to 'testing/newsrc')
-rw-r--r-- | testing/newsrc/org/aspectj/testing/RunSpec.java | 34 | ||||
-rw-r--r-- | testing/newsrc/org/aspectj/testing/XMLBasedAjcTestCase.java | 1 |
2 files changed, 34 insertions, 1 deletions
diff --git a/testing/newsrc/org/aspectj/testing/RunSpec.java b/testing/newsrc/org/aspectj/testing/RunSpec.java index cb0d497a8..0716b8362 100644 --- a/testing/newsrc/org/aspectj/testing/RunSpec.java +++ b/testing/newsrc/org/aspectj/testing/RunSpec.java @@ -12,11 +12,13 @@ package org.aspectj.testing; import java.io.File; +import java.io.IOException; import java.util.ArrayList; import java.util.List; import java.util.StringTokenizer; import org.aspectj.tools.ajc.AjcTestCase; +import org.aspectj.util.FileUtil; /** * @author colyer @@ -34,6 +36,7 @@ public class RunSpec implements ITestStep { private AjcTest myTest; private OutputSpec stdErrSpec; private OutputSpec stdOutSpec; + private String ltwFile; public RunSpec() { } @@ -46,7 +49,9 @@ public class RunSpec implements ITestStep { System.err.println("Warning, message spec for run command is currently ignored (org.aspectj.testing.RunSpec)"); } String[] args = buildArgs(); - AjcTestCase.RunResult rr = inTestCase.run(getClassToRun(),args,getClasspath()); +// System.err.println("? execute() inTestCase='" + inTestCase + "', ltwFile=" + ltwFile); + boolean useLtw = copyLtwFile(inTestCase.getSandboxDirectory()); + AjcTestCase.RunResult rr = inTestCase.run(getClassToRun(),args,getClasspath(),useLtw); if (stdErrSpec != null) { stdErrSpec.matchAgainst(rr.getStdErr()); } @@ -102,6 +107,14 @@ public class RunSpec implements ITestStep { public void setClassToRun(String classToRun) { this.classToRun = classToRun; } + + public String getLtwFile() { + return ltwFile; + } + + public void setLtwFile(String ltwFile) { + this.ltwFile = ltwFile; + } private String[] buildArgs() { if (options == null) return new String[0]; @@ -112,4 +125,23 @@ public class RunSpec implements ITestStep { } return ret; } + + private boolean copyLtwFile (File sandboxDirectory) { + boolean useLtw = false; + + if (ltwFile != null) { + File from = new File(baseDir,ltwFile); + File to = new File(sandboxDirectory,"META-INF" + File.separator + "aop.xml"); +// System.out.println("RunSpec.copyLtwFile() from=" + from.getAbsolutePath() + " to=" + to.getAbsolutePath()); + try { + FileUtil.copyFile(from,to); + useLtw = true; + } + catch (IOException ex) { + ex.printStackTrace(); + } + } + + return useLtw; + } } diff --git a/testing/newsrc/org/aspectj/testing/XMLBasedAjcTestCase.java b/testing/newsrc/org/aspectj/testing/XMLBasedAjcTestCase.java index 22cb30338..58a5f0d33 100644 --- a/testing/newsrc/org/aspectj/testing/XMLBasedAjcTestCase.java +++ b/testing/newsrc/org/aspectj/testing/XMLBasedAjcTestCase.java @@ -166,6 +166,7 @@ public abstract class XMLBasedAjcTestCase extends AjcTestCase { digester.addSetNext("suite/ajc-test/compile","addTestStep","org.aspectj.testing.ITestStep"); digester.addObjectCreate("suite/ajc-test/run",RunSpec.class); digester.addSetProperties("suite/ajc-test/run","class","classToRun"); + digester.addSetProperties("suite/ajc-test/run","ltw","ltwFile"); digester.addSetNext("suite/ajc-test/run","addTestStep","org.aspectj.testing.ITestStep"); digester.addObjectCreate("*/message",ExpectedMessageSpec.class); digester.addSetProperties("*/message"); |