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 JUnit, set the Apache Ant formatter to 'XML'.
On this page:
To insert the JUnit report macro into a page using the Macro Browser,
|
Once you've found the JUnit report macro, fill in the URL fields and click 'insert' to add it to your page. |
To insert the JUnit report macro into a page using the Wiki Markup Editor,
Enter the junitreport code tags into your document as follows.
{junitreport:directory=file:///*directory*/} |
Parameter |
Default |
Description |
|---|---|---|
Directory (URL) of your test result files |
None |
URL of a directory containing your test result files. |
Report Detail |
'fixture' |
Detail for report. Can be 'all', 'fixture', 'summary' or 'failuresonly'. |
URL of the test result XML file |
None |
URL of a particular test result XML file. For Confluence installations without anonymous user access, you can specify logon credentials as part of this parameter in the form of URL parameters:
|
( |
None |
Shows the content of failures, as well as the error messages. |
Loading JUnit reports from a local drive
{junitreport:directory=file:///C:/TEMP/} |
Must be a directory name and not the XML file itself.
Loading JUnit reports from a network drive
{junitreport:url=http://*host*/*path*} |
Loading JUnit reports from a Confluence instance
{junitreport:url=http://yourConfluenceInstance.com/download/attachments/<page id>/file.xml} |
Loading JUnit reports from a Confluence instance without anonymous user access
If your Confluence instance is not accessible by anonymous users, specify logon credentials with the os_username and os_password URL parameters (as part of the macro's url parameter). In this case, we are specifying a username of "admin" and a password of "admin".
{junitreport:url=http://yourConfluenceInstance.com/download/attachments/<page id>/file.xml?os_username=admin&os_password=admin} |
If you use both the |
Take me back to the Confluence User's Guide.