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, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> Does a formatter produce that output?
>
> Jan
>
> >-----Ursprüngliche Nachricht-----
> >Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im
> >Auftrag von Paul Barry
> >Gesendet: Samstag, 11. Februar 2006 03:17
> >An: [email protected]
> >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: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>