• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Junit Test reports - in Excel

 
Ranch Hand
Posts: 980
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

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

Regards
 
author & internet detective
Posts: 40913
840
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What are you using to run JUnit? Ant or Maven?
 
A Kumar
Ranch Hand
Posts: 980
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Oops forgot to mention the tool..
its Maven that i use..Any friendlier reporting way than the default xml
 
author
Posts: 3281
8
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As a quick shortcut try running mvn site afterwards, it automatically will present you a HTML formatted version.
 
Saloon Keeper
Posts: 24804
172
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
A Kumar
Ranch Hand
Posts: 980
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Generated it with mvn surefire-report:report


Regards
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Martijn Verburg
author
Posts: 3281
8
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Anbu,

Welcome to Javaranch! What steps have you tried so far?
 
anbu arasan
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try running ant with the -v option. That should give a stack trace which might have more information.
 
anbu arasan
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi Johnson ,
thank you, and in linux what is the command for detail stack trace
 
Peter Johnson
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

in linux what is the command for detail stack trace


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

ant -v
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic