• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how to customize junit reports?

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am creating junit report using ant task <junitreport>.
Is there a way to make some ant property task value(for ex: <property name=some_name value=some_value/>) appear in the junit reports?
 
author & internet detective
Posts: 41860
908
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
Rakesh,
Welcome to CodeRanch!

Not automatically. You could write your own logic to add the property after the report is generated though. It's just HTML. Or even generate your report from the XML - that would be more work though and only if you had a major customization.
 
Rakesh Khob
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you Jeanne for your reply.
The html file that is created from junitreport task, to customize it I guess I'll have to edit junit-frames.xsl
How exactly can I access the value attribute of property task in this .xsl file?
 
Jeanne Boyarsky
author & internet detective
Posts: 41860
908
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
Not necessarily. If I was only making one small change to the junit report, I'd use Ant to update the HTML file after it is generated by junitreport. This technique sounds easier in your case as well.
 
Rakesh Khob
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hey Thank you very much Jeanne.
I made the changes in the HTML file through ant and it worked the way I wanted.
thank you.
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I am trying to achive the same thing (get a custom JUnit report). However, considering the variable info that I am trying to add in the JUnit report, I don't really want to do it by modifying the HTML with an ANT task. My intention is to add, somehow in the JUnit XML report, additinal tags/nodes (one or more depending on the test run).

I've read a post where suggest using System.out to print lines and they are going to be available in the XML report. However, it is not helpfull since they are not being displayed as additional tags in the xml report.

Once I have the XML report with the custom tags, I am going to use XSLT ANT task to generate a custom HTML report which is going to consider the info from the additional tags and they are going to be displayed in the report as new conlumns or as links to some other resources (depending on the test that is being run).

Is there a way to achieve this? Any other ideas? Please need help

Thanks,
Leo
 
Rakesh Khob
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Leo,
did you try editing .xsl file?
 
Leo Fc
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Rakesh,

Thanks for your quick reply.

I think editing/creating the .XSL file is the next step. First I need to have the XML with the additional/custom tags/nodes that stores the additional info that I need to display in the report.

Thanks,
Leo
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic