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 /org.aspectj.ajdt.core/testsrc | |
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 'org.aspectj.ajdt.core/testsrc')
-rw-r--r-- | org.aspectj.ajdt.core/testsrc/org/aspectj/tools/ajc/AjcTestCase.java | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/org.aspectj.ajdt.core/testsrc/org/aspectj/tools/ajc/AjcTestCase.java b/org.aspectj.ajdt.core/testsrc/org/aspectj/tools/ajc/AjcTestCase.java index 58ea8e063..14fad2ef5 100644 --- a/org.aspectj.ajdt.core/testsrc/org/aspectj/tools/ajc/AjcTestCase.java +++ b/org.aspectj.ajdt.core/testsrc/org/aspectj/tools/ajc/AjcTestCase.java @@ -28,6 +28,7 @@ import java.util.StringTokenizer; import org.aspectj.bridge.IMessage; import org.aspectj.bridge.ISourceLocation; import org.aspectj.testing.util.TestUtil; +import org.aspectj.weaver.loadtime.WeavingURLClassLoader; import junit.framework.TestCase; @@ -518,7 +519,7 @@ public class AjcTestCase extends TestCase { return lastRunResult; } public void testNothingForAntJUnit() {} - + /** * Run the given class (main method), and return the result in a RunResult. The program runs with * a classpath containing the sandbox directory, runtime, testing-client, bridge, and @@ -527,6 +528,11 @@ public class AjcTestCase extends TestCase { public RunResult run(String className){ return run(className,new String[0],null); } + + public RunResult run(String className, String[] args, String classpath) { + return run(className,args,null,false); + } + /** * Run the given class, and return the result in a RunResult. The program runs with @@ -537,7 +543,7 @@ public class AjcTestCase extends TestCase { * bridge, and util projects will all be appended to the classpath, as will any jars in * the sandbox. */ - public RunResult run(String className, String[] args, String classpath) { + public RunResult run(String className, String[] args, String classpath, boolean useLTW) { lastRunResult = null; StringBuffer cp = new StringBuffer(); if (classpath != null) { @@ -569,8 +575,15 @@ public class AjcTestCase extends TestCase { } catch (Exception malEx) { fail("Bad classpath specification: " + classpath); } - URLClassLoader cLoader = new URLClassLoader(urls,null); - //System.out.println(cLoader.getParent()); + + URLClassLoader cLoader; + if (useLTW) { + cLoader = new WeavingURLClassLoader(urls,null); + } + else { + cLoader = new URLClassLoader(urls,null); + } + try { try { Class testerClass = cLoader.loadClass("org.aspectj.testing.Tester"); |