aspose file tools*
The moose likes Ant, Maven and Other Build Tools and the fly likes Junit Test reports - in Excel 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 "Junit Test reports - in Excel" Watch "Junit Test reports - in Excel" New topic
Author

Junit Test reports - in Excel

A Kumar
Ranch Hand

Joined: Jul 04, 2004
Posts: 979
Hi,

How can i have a friendlier xls sheet for generating junit test reports rather than the
default xml format.

Regards
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 31079
    
163

What are you using to run JUnit? Ant or Maven?


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
A Kumar
Ranch Hand

Joined: Jul 04, 2004
Posts: 979
Oops forgot to mention the tool..
its Maven that i use..Any friendlier reporting way than the default xml
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

As a quick shortcut try running mvn site afterwards, it automatically will present you a HTML formatted version.


Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16308
    
  22

Maven hooks into SureFire Reports, and you can probably set an option.

Or, if you can't find an option that suits you, add an XSLT to convert the XML to the desired file format.

The more common usage is to have Maven generate the test results as HTML so that they can be published to a web server where the whole team can see them. Excel documents are inherently selfish.


Customer surveys are for companies who didn't pay proper attention to begin with.
A Kumar
Ranch Hand

Joined: Jul 04, 2004
Posts: 979

Generated it with mvn surefire-report:report


Regards
anbu arasan
Greenhorn

Joined: Feb 09, 2010
Posts: 5
i am using ant tool for juint test case and i want to generate excel report for test case, please explain step by step

thanks in advance


Regards,
Anbarasan
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

Anbu,

Welcome to Javaranch! What steps have you tried so far?
anbu arasan
Greenhorn

Joined: Feb 09, 2010
Posts: 5
thanks for quick response. first i run the junit test cases classs and it generate regarding xml files. after that i add the junitreport tag in build.xml file, then i run the script it will ask for the xalan2 or xalan1 jar file then i download the jar file and put it in ant/lib directory and i set the path, again i run the script, now it will throw the following error

[junitreport] Using Xalan version: Xalan Java 2.7.1

[junitreport] XSL-1000: (Fatal Error) Error while parsing XSL file (null).

BUILD FAILED
file:C:/EUC/GLOS/build.xml:64: Errors while applying transformations: XSL-1000:
(Fatal Error) Error while parsing XSL file (null).

please help me to resolve this and also i want to generate excel formet junit report

this is my junit configuration
<target name="testsuite" depends="compile" description="Running Test Suite">
<delete dir="${GLOS}/build"/>
<mkdir dir="${GLOS}/build"/>
<junit printsummary="yes" haltonfailure="no" fork="yes" maxmemory="512m">
<classpath>
<fileset dir="${GLOS}/web-inf/lib"/>
</classpath>

<formatter type="xml"/>
<batchtest fork="yes" todir="${GLOS}/build">
<fileset dir="${GLOS}/src">
<include name="**/*Testc*.java"/>
<exclude name="**/CosTest.java"/>
</fileset>
</batchtest>
</junit>
<junitreport todir="./reports">
<fileset dir="${GLOS}/build">
<include name="TEST-*.xml"/>
</fileset>
<report format="frames" todir="./report/html1"/>
</junitreport>
<fail if="tests.failed">
*******************************************************
*******************************************************
One or more tests failed. Check the output...
*******************************************************
*******************************************************
</fail>

</target>

thanks
anbu arasan
Greenhorn

Joined: Feb 09, 2010
Posts: 5
hi All,

when i generate the html report i am getting this error, help me to solve this problem

[junitreport] Using Xalan version: Xalan Java 2.7.1

[junitreport] XSL-1000: (Fatal Error) Error while parsing XSL file (null).

BUILD FAILED
file:C:/EUC/GLOS/build.xml:64: Errors while applying transformations: XSL-1000:
(Fatal Error) Error while parsing XSL file (null).
thanks in advance
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5845
    
    7

Try running ant with the -v option. That should give a stack trace which might have more information.


JBoss In Action
anbu arasan
Greenhorn

Joined: Feb 09, 2010
Posts: 5
hi Johnson ,
thank you, and in linux what is the command for detail stack trace
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5845
    
    7

in linux what is the command for detail stack trace

I already answered this - the '-v' option to ant:

ant -v
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Junit Test reports - in Excel