File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Testing and the fly likes JUnit HTML report using Ant Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Engineering » Testing
Bookmark "JUnit HTML report using Ant " Watch "JUnit HTML report using Ant " New topic
Author

JUnit HTML report using Ant

mathyas ma
Greenhorn

Joined: Apr 30, 2010
Posts: 2
Hi all

I am using Ant to build my JUnit through eclipse but I am having some issues to produce HTML Report. If you have some idea please give me some example. Below is the script I have used to produce report but it can't crate report directory. I have the class name "MyTest"
Thank you

<?xml version="1.0" encoding="UTF-8"?>

<project name="MyTest" default="MyTest">

<property name="MyTest sample" value="Hello"/>

<target name="MyTest">
</target>

<fileset dir="./reports">

<include name="TEST-*.xml"/>
</fileset>
<report format="frames" todir="./report/html"/>

</project>
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Try using <mkdir> to actually make the directory first.
mathyas ma
Greenhorn

Joined: Apr 30, 2010
Posts: 2
Thank you David for replaying my post. After adding mkdir the report folder crated in the directory but after running the project my HTML report still empty, any idea how to post the report in the decretory?
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

I don't see anything there that creates JUnit reports.

http://ant.apache.org/manual/OptionalTasks/junit.html
http://ant.apache.org/manual/OptionalTasks/junitreport.html

If you post more XML make sure you UseCodeTags.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JUnit HTML report using Ant