everything. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@270617 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -398,6 +398,24 @@ public class AntClassLoader extends ClassLoader implements BuildListener { | |||||
| pathComponents.addElement(pathComponent); | pathComponents.addElement(pathComponent); | ||||
| } | } | ||||
| /** | |||||
| * The CLASSPATH this classloader will consult. | |||||
| */ | |||||
| public String getClasspath() { | |||||
| StringBuffer sb = new StringBuffer(); | |||||
| boolean firstPass = true; | |||||
| Enumeration enum = pathComponents.elements(); | |||||
| while (enum.hasMoreElements()) { | |||||
| if (!firstPass) { | |||||
| sb.append(System.getProperty("path.separator")); | |||||
| } else { | |||||
| firstPass = false; | |||||
| } | |||||
| sb.append(((File) enum.nextElement()).getAbsolutePath()); | |||||
| } | |||||
| return sb.toString(); | |||||
| } | |||||
| /** | /** | ||||
| * Set this classloader to run in isolated mode. In isolated mode, classes not | * Set this classloader to run in isolated mode. In isolated mode, classes not | ||||
| * found on the given classpath will not be referred to the base class loader | * found on the given classpath will not be referred to the base class loader | ||||
| @@ -564,9 +564,10 @@ public class JUnitTask extends Task { | |||||
| AntClassLoader cl = null; | AntClassLoader cl = null; | ||||
| Path classpath = commandline.getClasspath(); | Path classpath = commandline.getClasspath(); | ||||
| if (classpath != null) { | if (classpath != null) { | ||||
| log("Using CLASSPATH " + classpath, Project.MSG_VERBOSE); | |||||
| cl = new AntClassLoader(null, project, classpath, false); | cl = new AntClassLoader(null, project, classpath, false); | ||||
| log("Using CLASSPATH " + cl.getClasspath(), | |||||
| Project.MSG_VERBOSE); | |||||
| // make sure the test will be accepted as a TestCase | // make sure the test will be accepted as a TestCase | ||||
| cl.addSystemPackageRoot("junit"); | cl.addSystemPackageRoot("junit"); | ||||
| // will cause trouble in JDK 1.1 if omitted | // will cause trouble in JDK 1.1 if omitted | ||||