ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Barry <>
Subject Re: junit printsummary and showoutput
Date Mon, 13 Feb 2006 15:44:08 GMT
Thanks for your help.  The formatter does appear to be producing that
output.  Here is my target:

  <target name="test" depends="compile-tests" description="Runs JUnit
    <!-- Check that junit.jar is in $ANT_HOME/lib -->
    <available classname="junit.framework.TestCase" property="junit.present
    <fail unless="junit.present"
        message="Please copy lib/junit.jar into ${env.ANT_HOME}/lib"/>
    <mkdir dir="${test.logs.dir}"/>
    <junit printsummary="off" fork="true" forkmode="once" showoutput="false"
        errorProperty="test.failed" failureProperty="test.failed">
        <path refid="project.classpath"/>
        <path location="${bin.dir}"/>
      <formatter type="xml"/>
      <formatter type="brief" usefile="false"/>
      <test name="com.mycompany.project.FullTestSuite" todir="${

    <fail if="test.failed">
      Unit tests failed. For error messages, check the log files in
      ${test.logs.dir} or run "ant test-reports"
          to generate reports at ${test.reports.dir}.</fail>

The output I'm seeing is the junit summary and then the log4j output
generated by the code called within the tests, which looks like this:

    [junit] Testsuite: com.mycompany.project.FullTestSuite
    [junit] Tests run: 71, Failures: 0, Errors: 0, Time elapsed: 1.282 sec

    [junit] ------------- Standard Output ---------------
    [junit]     0 -  INFO -
- Loading config for: /com/mycompany/project/dao/jdbc-datasource-context.xml
    ... <Lots of ouput, removed for the sake of brevity> ...
    [junit] ------------- ---------------- ---------------

Then, in the logs/TEST-com.mycompany.project.FullTestSuite.xml file, there
is a <system-out> element that contains all the same content from the

On 2/13/06, <> wrote:
> Does a formatter produce that output?
> Jan
> >-----Urspr√ľngliche Nachricht-----
> >Von: [] Im
> >Auftrag von Paul Barry
> >Gesendet: Samstag, 11. Februar 2006 03:17
> >An:
> >Betreff: junit printsummary and showoutput
> >
> >I have a junit task with printsummary="off" and
> >showoutput="false", yet I still get the output and summary.
> >What values should I use to supress the output of the unit tests?
> >
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message