This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
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’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: Log only junit failed tests to text file
 
It's not a secret anymore!