ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From co...@apache.org
Subject cvs commit: jakarta-ant/src/testcases/org/apache/tools/ant BuildFileTest.java
Date Tue, 04 Feb 2003 14:26:25 GMT
conor       2003/02/04 06:26:25

  Modified:    src/testcases/org/apache/tools/ant BuildFileTest.java
  Log:
  Capture build test output and error streams into the appropriate
  buffers
  
  PR:	16748
  Submitted by:	John McGrath
  
  Revision  Changes    Path
  1.21      +11 -5     jakarta-ant/src/testcases/org/apache/tools/ant/BuildFileTest.java
  
  Index: BuildFileTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/testcases/org/apache/tools/ant/BuildFileTest.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -w -u -r1.20 -r1.21
  --- BuildFileTest.java	4 Feb 2003 12:58:36 -0000	1.20
  +++ BuildFileTest.java	4 Feb 2003 14:26:24 -0000	1.21
  @@ -254,10 +254,10 @@
               sysOut.flush();
               sysErr.flush();
               outBuffer = new StringBuffer();
  -            PrintStream out = new PrintStream(new AntOutputStream());
  +            PrintStream out = new PrintStream(new AntOutputStream(outBuffer));
               System.setOut(out);
               errBuffer = new StringBuffer();
  -            PrintStream err = new PrintStream(new AntOutputStream());
  +            PrintStream err = new PrintStream(new AntOutputStream(errBuffer));
               System.setErr(err);
               logBuffer = new StringBuffer();
               fullLogBuffer = new StringBuffer();
  @@ -408,9 +408,15 @@
       /**
        * an output stream which saves stuff to our buffer.
        */
  -    private class AntOutputStream extends java.io.OutputStream {
  +    private static class AntOutputStream extends java.io.OutputStream {
  +        private StringBuffer buffer;
  +        
  +        public AntOutputStream( StringBuffer buffer ) {
  +            this.buffer = buffer;
  +        }
  +        
           public void write(int b) {
  -            outBuffer.append((char)b);
  +            buffer.append((char)b);
           }
       }
   
  
  
  

Mime
View raw message