You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Bernhard Voelker <ma...@bernhard-voelker.de> on 2013/10/09 13:21:30 UTC

Duplicate formatters of the same type in junit test corrupting output file

Hi *,

we had a Junit task with an XML formatter defined both on the <junit>
and the <test> level:

  <junit
    fork="true" dir="${basedir}" haltonfailure="no"
    outputtoformatters="no" haltonerror="no" showoutput="no" printsummary="no" >

    <classpath refid="..." />
    <formatter type="xml" />      <!-- *** HERE ... *** -->
    <jvmarg value="-Dlog4j.configuration=file:properties/log4j.properties" />

    <test name="@{junitclass}" outfile="..." >
      <formatter type="xml"/>     <!-- *** AND HERE *** -->
    </test>
  </junit>

Since Ant 1.9, this resulted in garbled output files:
the end was somehow doubled, sometimes only like this:

 like this:

  </testsuite>
  uite>

but in other situations even 2+ doubled lines appeared:

    </testcase>
    <system-out><![CDATA[]]></system-out>
    <system-err><![CDATA[]]></system-err>
  </testsuite>
  ut>
    <system-err><![CDATA[]]></system-err>
  </testsuite>

After removing the second <formatter>, everything was fine again.
Anyone seen this?

Have a nice day,
Berny

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Duplicate formatters of the same type in junit test corrupting output file

Posted by Antoine Levy Lambert <an...@gmx.de>.
Hello Bernhard,

this looks like a bug. You might want to report it in bugzilla.

Regards,

Antoine
On Oct 9, 2013, at 7:21 AM, Bernhard Voelker wrote:

> Hi *,
> 
> we had a Junit task with an XML formatter defined both on the <junit>
> and the <test> level:
> 
>   <junit
>     fork="true" dir="${basedir}" haltonfailure="no"
>     outputtoformatters="no" haltonerror="no" showoutput="no" printsummary="no" >
> 
>     <classpath refid="..." />
>     <formatter type="xml" />      <!-- *** HERE ... *** -->
>     <jvmarg value="-Dlog4j.configuration=file:properties/log4j.properties" />
> 
>     <test name="@{junitclass}" outfile="..." >
>       <formatter type="xml"/>     <!-- *** AND HERE *** -->
>     </test>
>   </junit>
> 
> Since Ant 1.9, this resulted in garbled output files:
> the end was somehow doubled, sometimes only like this:
> 
>  like this:
> 
>   </testsuite>
>   uite>
> 
> but in other situations even 2+ doubled lines appeared:
> 
>     </testcase>
>     <system-out><![CDATA[]]></system-out>
>     <system-err><![CDATA[]]></system-err>
>   </testsuite>
>   ut>
>     <system-err><![CDATA[]]></system-err>
>   </testsuite>
> 
> After removing the second <formatter>, everything was fine again.
> Anyone seen this?
> 
> Have a nice day,
> Berny
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org