ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sbaill...@apache.org
Subject cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/junit JUnitTestRunner.java XMLResultAggregator.java
Date Sat, 15 Dec 2001 00:28:47 GMT
sbailliez    01/12/14 16:28:47

  Modified:    src/main/org/apache/tools/ant/taskdefs/optional/junit
                        JUnitTestRunner.java XMLResultAggregator.java
  Log:
  Take advantage of StringUtils
  
  Revision  Changes    Path
  1.15      +2 -5      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner.java
  
  Index: JUnitTestRunner.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- JUnitTestRunner.java	2001/12/09 13:38:18	1.14
  +++ JUnitTestRunner.java	2001/12/15 00:28:47	1.15
  @@ -57,6 +57,7 @@
   import org.apache.tools.ant.AntClassLoader;
   import org.apache.tools.ant.Project;
   import org.apache.tools.ant.BuildException;
  +import org.apache.tools.ant.util.StringUtils;
   
   import junit.framework.TestListener;
   import junit.framework.TestResult;
  @@ -477,11 +478,7 @@
        * Scott M. Stirling.
        */
       public static String getFilteredTrace(Throwable t) {
  -        StringWriter stringWriter = new StringWriter();
  -        PrintWriter writer = new PrintWriter(stringWriter);
  -        t.printStackTrace(writer);
  -        StringBuffer buffer = stringWriter.getBuffer();
  -        String trace = buffer.toString();
  +        String trace = StringUtils.getStackTrace(t);
           return JUnitTestRunner.filterStack(trace);
       }
   
  
  
  
  1.8       +2 -3      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/XMLResultAggregator.java
  
  Index: XMLResultAggregator.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/XMLResultAggregator.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- XMLResultAggregator.java	2001/11/27 18:04:53	1.7
  +++ XMLResultAggregator.java	2001/12/15 00:28:47	1.8
  @@ -76,6 +76,7 @@
   import org.apache.tools.ant.BuildException;
   import org.apache.tools.ant.types.FileSet;
   import org.apache.tools.ant.util.DOMElementWriter;
  +import org.apache.tools.ant.util.StringUtils;
   
   
   /**
  @@ -269,9 +270,7 @@
                   // a testcase might have failed and write a zero-length document,
                   // It has already failed, but hey.... mm. just put a warning
                   log("The file " + files[i] + " is not a valid XML document. It is possibly
corrupted.", Project.MSG_WARN);
  -                StringWriter sw = new StringWriter();
  -                e.printStackTrace(new PrintWriter(sw));
  -                log(sw.toString(), Project.MSG_DEBUG);
  +                log(StringUtils.getStackTrace(e), Project.MSG_DEBUG);
               } catch (IOException e){
                   log("Error while accessing file " + files[i] + ": " + e.getMessage(), Project.MSG_ERR);
               }
  
  
  

--
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