Two Laptop Bag*
The moose likes Ant, Maven and Other Build Tools and the fly likes Log only junit failed tests to text file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Log only junit failed tests to text file" Watch "Log only junit failed tests to text file" New topic
Author

Log only junit failed tests to text file

Leo Aug
Greenhorn

Joined: Sep 02, 2012
Posts: 7
Hi


I have four tests, executed junit on it. 2 and 4 tests are failed. I need to log only failed test cases in to text file.

So that I can send email of only failed test log.
---------------------------------------------------------------------------------------------------------
<target name="RunUnitTests" >
<junit printsummary="yes" fork="yes" maxmemory="256M" haltonfailure="no" failureproperty="junit.failure" showoutput="yes" >
<!-- <classpath refid="java.class.path" /> -->

<classpath>
<pathelement pssath="${basedir}\bin\java" />
</classpath>

<batchtest fork="yes" todir="${result.dir}">
<formatter type="xml" usefile="true" />
<formatter type="brief" usefile="true" />
</batchtest>
</junit>
</target>
---------------------------------------------------------------------------------------------------------
The log should not contain any data of successful test , it should only have brief data of failed test cases.
---------------------------------------------------------------------------------------------------------
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Log only junit failed tests to text file