• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Junit Test reports - in Excel

 
A Kumar
Ranch Hand
Posts: 980
  • Mark post as helpful
  • send pies
  • 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
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34973
379
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
Oops forgot to mention the tool..
its Maven that i use..Any friendlier reporting way than the default xml
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As a quick shortcut try running mvn site afterwards, it automatically will present you a HTML formatted version.
 
Tim Holloway
Saloon Keeper
Posts: 18302
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator

Generated it with mvn surefire-report:report


Regards
 
anbu arasan
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • 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
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
hi Johnson ,
thank you, and in linux what is the command for detail stack trace
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic