ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/junit JUnitTask.java
Date Mon, 07 Jan 2002 15:41:10 GMT
bodewig     02/01/07 07:41:10

  Modified:    src/main/org/apache/tools/ant AntClassLoader.java
               src/main/org/apache/tools/ant/taskdefs/optional/junit
                        JUnitTask.java
  Log:
  Don't lie about the CLASSPATH being used - build.sysclasspath changes
  everything.
  
  Revision  Changes    Path
  1.36      +18 -0     jakarta-ant/src/main/org/apache/tools/ant/AntClassLoader.java
  
  Index: AntClassLoader.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/AntClassLoader.java,v
  retrieving revision 1.35
  retrieving revision 1.36
  diff -u -r1.35 -r1.36
  --- AntClassLoader.java	28 Oct 2001 21:25:26 -0000	1.35
  +++ AntClassLoader.java	7 Jan 2002 15:41:10 -0000	1.36
  @@ -399,6 +399,24 @@
       }
           
       /**
  +     * 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
        * found on the given classpath will not be referred to the base class loader
        * but will cause a classNotFoundException.
  
  
  
  1.27      +3 -2      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java
  
  Index: JUnitTask.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- JUnitTask.java	9 Dec 2001 13:38:18 -0000	1.26
  +++ JUnitTask.java	7 Jan 2002 15:41:10 -0000	1.27
  @@ -564,9 +564,10 @@
               AntClassLoader cl = null;
               Path classpath = commandline.getClasspath();
               if (classpath != null) {
  -                log("Using CLASSPATH " + classpath, Project.MSG_VERBOSE);
  -
                   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
                   cl.addSystemPackageRoot("junit");
                   // will cause trouble in JDK 1.1 if omitted
  
  
  

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message