summaryrefslogtreecommitdiffstats
path: root/testing
diff options
context:
space:
mode:
authoraclement <aclement>2005-10-14 07:23:40 +0000
committeraclement <aclement>2005-10-14 07:23:40 +0000
commit8982544f13eb5cb082ca19db2bd2c5f77b1e5965 (patch)
treed7e4c96b17ce76331686fc3cab53326d0087f039 /testing
parent51a0fe4edd56a626ef5570e43bd2225be0dcb4dd (diff)
downloadaspectj-8982544f13eb5cb082ca19db2bd2c5f77b1e5965.tar.gz
aspectj-8982544f13eb5cb082ca19db2bd2c5f77b1e5965.zip
Code for enhancement 107741: Updated WeavingURLClassLoader (thanks to Matthew Webster for the patch)
Diffstat (limited to 'testing')
-rw-r--r--testing/.classpath101
-rw-r--r--testing/newsrc/org/aspectj/testing/RunSpec.java34
-rw-r--r--testing/newsrc/org/aspectj/testing/XMLBasedAjcTestCase.java1
-rw-r--r--testing/src/org/aspectj/testing/harness/bridge/JavaRun.java2
4 files changed, 56 insertions, 82 deletions
diff --git a/testing/.classpath b/testing/.classpath
index be4d3e954..223b01f9b 100644
--- a/testing/.classpath
+++ b/testing/.classpath
@@ -1,84 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="src" path="src">
- <attributes>
- </attributes>
- </classpathentry>
- <classpathentry kind="src" path="testsrc">
- <attributes>
- </attributes>
- </classpathentry>
- <classpathentry sourcepath="JRE_SRC" kind="var" path="JRE_LIB">
- <attributes>
- </attributes>
- </classpathentry>
- <classpathentry sourcepath="/lib/ant/ant-src.zip" kind="lib" path="/lib/ant/lib/ant.jar">
- <attributes>
- </attributes>
- </classpathentry>
- <classpathentry sourcepath="/lib/junit/junit-src.jar" kind="lib" path="/lib/junit/junit.jar">
- <attributes>
- </attributes>
- </classpathentry>
- <classpathentry kind="lib" path="/lib/jdiff/jdiff.jar">
- <attributes>
- </attributes>
- </classpathentry>
- <classpathentry kind="lib" path="/lib/regexp/jakarta-regexp-1.2.jar">
- <attributes>
- </attributes>
- </classpathentry>
- <classpathentry kind="src" path="/bridge">
- <attributes>
- </attributes>
- </classpathentry>
- <classpathentry kind="src" path="/util">
- <attributes>
- </attributes>
- </classpathentry>
- <classpathentry kind="src" path="/testing-client">
- <attributes>
- </attributes>
- </classpathentry>
- <classpathentry kind="lib" path="/lib/ant/lib/xercesImpl.jar">
- <attributes>
- </attributes>
- </classpathentry>
- <classpathentry kind="lib" path="/lib/ant/lib/xml-apis.jar">
- <attributes>
- </attributes>
- </classpathentry>
- <classpathentry exported="true" sourcepath="/lib/commons/commons-src.zip" kind="lib" path="/lib/commons/commons.jar">
- <attributes>
- </attributes>
- </classpathentry>
- <classpathentry kind="src" path="/testing-util">
- <attributes>
- </attributes>
- </classpathentry>
- <classpathentry kind="src" path="/ajde">
- <attributes>
- </attributes>
- </classpathentry>
- <classpathentry kind="src" path="/asm">
- <attributes>
- </attributes>
- </classpathentry>
- <classpathentry kind="src" path="/taskdefs">
- <attributes>
- </attributes>
- </classpathentry>
- <classpathentry kind="src" path="newsrc">
- <attributes>
- </attributes>
- </classpathentry>
- <classpathentry kind="src" path="/org.aspectj.ajdt.core">
- <attributes>
- </attributes>
- </classpathentry>
- <classpathentry combineaccessrules="false" kind="src" path="/weaver">
- <attributes>
- </attributes>
- </classpathentry>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="src" path="testsrc"/>
+ <classpathentry sourcepath="JRE_SRC" kind="var" path="JRE_LIB"/>
+ <classpathentry sourcepath="/lib/ant/ant-src.zip" kind="lib" path="/lib/ant/lib/ant.jar"/>
+ <classpathentry sourcepath="/lib/junit/junit-src.jar" kind="lib" path="/lib/junit/junit.jar"/>
+ <classpathentry kind="lib" path="/lib/jdiff/jdiff.jar"/>
+ <classpathentry kind="lib" path="/lib/regexp/jakarta-regexp-1.2.jar"/>
+ <classpathentry kind="src" path="/bridge"/>
+ <classpathentry kind="src" path="/util"/>
+ <classpathentry kind="src" path="/testing-client"/>
+ <classpathentry kind="lib" path="/lib/ant/lib/xercesImpl.jar"/>
+ <classpathentry kind="lib" path="/lib/ant/lib/xml-apis.jar"/>
+ <classpathentry exported="true" sourcepath="/lib/commons/commons-src.zip" kind="lib" path="/lib/commons/commons.jar"/>
+ <classpathentry kind="src" path="/testing-util"/>
+ <classpathentry kind="src" path="/ajde"/>
+ <classpathentry kind="src" path="/asm"/>
+ <classpathentry kind="src" path="/taskdefs"/>
+ <classpathentry kind="src" path="newsrc"/>
+ <classpathentry kind="src" path="/org.aspectj.ajdt.core"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/weaver"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/loadtime"/>
<classpathentry kind="output" path="bin"/>
</classpath>
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");
diff --git a/testing/src/org/aspectj/testing/harness/bridge/JavaRun.java b/testing/src/org/aspectj/testing/harness/bridge/JavaRun.java
index 223a0c8a6..cbf353fac 100644
--- a/testing/src/org/aspectj/testing/harness/bridge/JavaRun.java
+++ b/testing/src/org/aspectj/testing/harness/bridge/JavaRun.java
@@ -25,7 +25,7 @@ import org.aspectj.testing.xml.SoftMessage;
import org.aspectj.testing.xml.XMLWriter;
import org.aspectj.util.FileUtil;
import org.aspectj.util.LangUtil;
-import org.aspectj.weaver.WeavingURLClassLoader;
+import org.aspectj.weaver.loadtime.WeavingURLClassLoader;
import java.io.*;
import java.lang.reflect.*;