ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 44530] junit task with forkmode= once and xml formatter does not save all system.out
Date Sat, 22 Mar 2008 23:44:28 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=44530


Peter Reilly <peterreilly@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO




--- Comment #1 from Peter Reilly <peterreilly@apache.org>  2008-03-22 16:44:28 PST ---
I have tested this and do not see the problem
build file:
<project name="x" default="run">
  <target name="run">
    <path id="t.path">
      <path path="build/classes"/>
      <fileset dir="lib" includes="*.jar"/>
    </path>
    <mkdir dir="build/classes"/>
    <mkdir dir="build/test/reports"/>
    <javac srcdir="src" destdir="build/classes"
           target="1.5" source="1.5" debug="yes"
           classpathref="t.path"/>

    <junit fork="true" forkmode="once" showoutput="true">
      <formatter type="brief" usefile="false"/>
      <classpath refid="t.path"/>
      <formatter type="xml"/>
      <batchtest todir="build/test/reports">
        <fileset dir="src" includes="**/*Test.java"/>
      </batchtest>
    </junit>
  </target>

  <target name="clean">
    <delete dir="build"/>
  </target>
</project>
and the java files:
peter/T1TEst.java:package peter;

import org.junit.*;

public class T1Test {
    @Test
    public void t1() {
        System.out.println("T1Test::t1");
    }
}
and
package peter;

import org.junit.*;

public class T2Test {
    @Test
    public void t2() {
        System.out.println("T2Test::t2");
    }
}

The xml reports contain the stdout from each test.


I have seen something similar with (shudder) Log4j

At the each of each test, the std output copy is closed
*unless* one uses the follow attribute in the log4j.properties
file.
# attributes for stdout appender
# need to set follow for stdout as it gets moved around in junit tests
log4j.appender.STDOUT.follow=true

Setting to NEEDINFO, it would be nice to have a complete
tar.gz or zip file showing the problem.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

Mime
View raw message