The JUnit Report macro displays a summary of JUnit test results from a directory accessible by the Confluence server. JUnit is a unit testing framework which allows programmers to ensure that individual units of Java source code are functioning correctly.
The JUnit Report macro appears as shown in the screenshot below.
Screenshot: The JUnit Report macro in Confluence

When generating reports from the JUnit Report macro, set the Apache Ant formatter to 'XML'.
Using the JUnit Report Macro
To add the JUnit Report macro to a page:
Parameters
When editing, you can click on the macro placeholder and choose Edit to display the parameters for this macro in the Macro Browser.
Parameters are options that you can set for Confluence macros to control the content or format of the macro output. The table below lists parameters for this macro that can be set in the Macro Browser.
Parameter | Default | Description |
|---|---|---|
URL of the test result XML file | None | URL of a particular test result XML file. Is overridden by the Directory (URL) of your test result files parameter if you use both. Example, from a Confluence instance: For Confluence installations without anonymous user access, you can specify logon credentials as part of this parameter in the form of URL parameters:
|
Directory (URL) of your test result files | None | URL of a directory containing your test result files. This must be a directory name and not the XML file itself. Overrides the URL of the test result XML file parameter if you use both. Example, for a local drive: Example, for a network drive: |
Report Detail | all | Detail for the report. Can be all, fixture, summary or failuresonly. |
| Debug | None | Shows the content of failures, as well as the error messages. |
Related Topics
Take me back to the Confluence User's Guide.







5 Comments
Hide/Show CommentsMay 05, 2011
Anonymous
Hi,
I use an automated testing tool which produces as well JUnit xml reports - as output. However, if there is any of test cases failing, the report fails to show on a Confluence page, using
Snippets from the JUnit output report, containing errors
Can you please tell me details about the parser of junitreport macro? Or an example of a "correct" xml file? Or what's wrong in the above example? If I take out the testsuite containing the <error> tags - report will be successfully printed, if I put them back - nothing is shown on Confluence page, not even an error message.
Thanks for your help.
May 31, 2011
Jonas B. Nielsen
Hello,
Did you add the macro by clicking the little macro icon in the editor? I am no expert and I do not no the origins
of the error message, but perhaps you need to check whether the macro is available at all, this can be done
by using the graphical wizard described here.
jonasbn
May 31, 2011
Jonas B. Nielsen
I would love to see a Hello World like example of how this works. I can get the report to render something not
resembling the actual test results but more a default template, so I wonder if the JUnit report format I use is
different from the expected?
Feel free to browse: The Confluence instance where it is used or the actual report XML file
The report does hold more than one suite, but I have not seen any examples indicating that this is not allowed.
Jun 01, 2011
Jonas B. Nielsen
It seems the macro does not support multiple test suites in a single file. I am currently evaluating the XSD,
but I am very unsure whether the XSD I am looking at is contemporary (ref: http://glite.cvs.cern.ch/cgi-bin/glite.cgi/org.glite.testing.unit/config/). I have changed the contents of the XML file mentioned above, so it does not
have the wrapping testsuites tags and multiple testsuite tags and then it works like a charm. My only issue with
this is that I need to change the whole continuous integration set up to split output into single files and I am not
sure this is the best way since the rest of my toolchain seems to have no issues.
Jun 07, 2011
Edwin Dawson [Atlassian Technical Writer]
Hi there Jonas,
Unfortunately I can't help you with this particular issue, but you might want to consider posting a question on Atlassian Answers. There, more people are watching the discussions and could well have the information that you need.
You could also create a feature request on our issue tracker for the Confluence developers.
Alternatively, you could always open a support request at http://support.atlassian.com, where our support engineers will be able to get back to you quickly.
I hope this helps.
Best Regards,
Edwin Dawson
Technical Writing Team Leader
Atlassian
http://www.atlassian.com
Add Comment