ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Barry <m...@paulbarry.com>
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
tests">
    <!-- 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">
      <classpath>
        <path refid="project.classpath"/>
        <path location="${bin.dir}"/>
      </classpath>
      <formatter type="xml"/>
      <formatter type="brief" usefile="false"/>
      <test name="com.mycompany.project.FullTestSuite" todir="${
test.logs.dir}"/>
    </junit>

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

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:

test:
    [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 -
com.mycompany.project.dao.sqlmap.TrainingApprovalDaoSqlMapImplTest().loadContextLocations:119
- Loading config for: /com/mycompany/project/dao/jdbc-datasource-context.xml
,/com/mycompany/project/dao/sqlmap/trainingApprovalDao-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
stdout.

On 2/13/06, Jan.Materne@rzf.fin-nrw.de <Jan.Materne@rzf.fin-nrw.de> wrote:
>
> Does a formatter produce that output?
>
> Jan
>
> >-----Urspr√ľngliche Nachricht-----
> >Von: pauljbarry3@gmail.com [mailto:pauljbarry3@gmail.com] Im
> >Auftrag von Paul Barry
> >Gesendet: Samstag, 11. Februar 2006 03:17
> >An: user@ant.apache.org
> >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: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>

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