ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@locus.apache.org
Subject cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/junit PlainJUnitResultFormatter.java SummaryJUnitResultFormatter.java XMLJUnitResultFormatter.java
Date Wed, 20 Sep 2000 12:41:10 GMT
bodewig     00/09/20 05:41:10

  Modified:    .        build.xml
               src/main/org/apache/tools/ant/taskdefs/optional/junit
                        PlainJUnitResultFormatter.java
                        SummaryJUnitResultFormatter.java
                        XMLJUnitResultFormatter.java
  Log:
  Formatter would close System.out (preventing further output)
  
  Revision  Changes    Path
  1.77      +2 -12     jakarta-ant/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/build.xml,v
  retrieving revision 1.76
  retrieving revision 1.77
  diff -u -r1.76 -r1.77
  --- build.xml	2000/09/20 11:31:43	1.76
  +++ build.xml	2000/09/20 12:41:08	1.77
  @@ -277,7 +277,7 @@
     <!-- =================================================================== -->
     <!-- Compile testcases                                                   -->
     <!-- =================================================================== -->
  -  <target name="compiletests" depends="jar">
  +  <target name="compiletests" depends="jar" if="junit.present">
       <mkdir dir="${build.tests}"/>
   
       <javac srcdir="${src.tests.dir}"
  @@ -288,16 +288,6 @@
           <pathelement location="${lib.dir}/${name}.jar" />
           <path refid="classpath" />
         </classpath>
  -      <include name="**/*.java"/>
  -      <exclude name="**/AllJUnitTests.java" unless="junit.present" />
  -      <exclude name="**/EnumeratedAttributeTest.java" unless="junit.present" />
  -      <exclude name="**/IntrospectionHelperTest.java" unless="junit.present" />
  -      <exclude name="**/PathTest.java" unless="junit.present" />
  -      <exclude name="**/CommandlineTest.java" unless="junit.present" />
  -      <exclude name="**/CommandlineJavaTest.java" unless="junit.present" />
  -      <exclude name="**/ProjectTest.java" unless="junit.present" />
  -      <exclude name="**/PatternSetTest.java" unless="junit.present" />
  -      <exclude name="**/FileSetTest.java" unless="junit.present" />
       </javac>
      </target>
   
  @@ -305,7 +295,7 @@
     <!-- Run testcase                                                        -->
     <!-- =================================================================== -->
     <target name="runtests" depends="compiletests" if="junit.present">
  -    <junit printsummary="yes" fork="yes" haltonfailure="yes">
  +    <junit printsummary="no" fork="yes" haltonfailure="yes">
         <classpath>
           <pathelement location="${lib.dir}/${name}.jar" />
           <pathelement location="${build.tests}" />
  
  
  
  1.2       +5 -3      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/PlainJUnitResultFormatter.java
  
  Index: PlainJUnitResultFormatter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/PlainJUnitResultFormatter.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- PlainJUnitResultFormatter.java	2000/08/09 13:12:13	1.1
  +++ PlainJUnitResultFormatter.java	2000/09/20 12:41:09	1.2
  @@ -138,9 +138,11 @@
               } catch (IOException ioex) {
                   throw new BuildException("Unable to write output", ioex);
               } finally {
  -                try {
  -                    out.close();
  -                } catch (IOException e) {}
  +                if (out != System.out && out != System.err) {
  +                    try {
  +                        out.close();
  +                    } catch (IOException e) {}
  +                }
               }
           }
       }
  
  
  
  1.3       +5 -3      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/SummaryJUnitResultFormatter.java
  
  Index: SummaryJUnitResultFormatter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/SummaryJUnitResultFormatter.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- SummaryJUnitResultFormatter.java	2000/08/09 13:12:13	1.2
  +++ SummaryJUnitResultFormatter.java	2000/09/20 12:41:09	1.3
  @@ -127,9 +127,11 @@
           } catch (IOException ioex) {
               throw new BuildException("Unable to write summary output", ioex);
           } finally {
  -            try {
  -                out.close();
  -            } catch (IOException e) {}
  +            if (out != System.out && out != System.err) {
  +                try {
  +                    out.close();
  +                } catch (IOException e) {}
  +            }
           }
       }
   }
  
  
  
  1.3       +6 -4      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/XMLJUnitResultFormatter.java
  
  Index: XMLJUnitResultFormatter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/XMLJUnitResultFormatter.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- XMLJUnitResultFormatter.java	2000/08/09 13:12:13	1.2
  +++ XMLJUnitResultFormatter.java	2000/09/20 12:41:09	1.3
  @@ -142,10 +142,12 @@
               } catch(IOException exc) {
                   throw new BuildException("Unable to write log file", exc);
               } finally {
  -                if (wri != null) {
  -                    try {
  -                        wri.close();
  -                    } catch (IOException e) {}
  +                if (out != System.out && out != System.err) {
  +                    if (wri != null) {
  +                        try {
  +                            wri.close();
  +                        } catch (IOException e) {}
  +                    }
                   }
               }
           }
  
  
  

Mime
View raw message