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.
For security reasons JUnit test result files can only be imported from a specified location in the Confluence server's file system. We recommend administrators create a folder in their Confluence home directory, add the system property confluence.junit.report.directory and specify the location for JUnit test result files to be imported from. JUnit Test result files cannot be imported from the server until this system property is set.
JUnit Report マクロは以下のスクリーンショットのように表示されます。
スクリーンショット: Confluence の JUnit レポート マクロ

注:JUnit レポート マクロからレポートを生成する場合は、Apache Ant フォーマッターを「XML」に設定します。
ページに JUnit レポート マクロを追加するには:
パラメーター | 必須 | 既定 | 説明 |
|---|---|---|---|
テスト結果 XML ファイルの URL | directory または url パラメータを含める必要があります | なし | 特定のテスト結果 XML ファイルの URL。両方を使用している場合は、テスト結果 XML ファイルのディレクトリ (URL) が上書きされます。 Confluence インスタンスからの例: 匿名ユーザー アクセスのない Confluence インストールの場合、URL パラメーター形式でこのパラメーターの一部としてログイン資格情報を指定できます。
|
テスト結果ファイルのディレクトリ (URL) | directory または url パラメータを含める必要があります | なし | テスト結果ファイルを含むディレクトリの URL。XML ファイル自体ではなく、ディレクトリ名にする必要があります。両方を使用している場合は、テスト結果 XML ファイルの URL が上書きされます。 Example, ネットワーク ドライブでの例: |
レポートの詳細 | いいえ | すべて | レポートの詳細すべて、固定、概要 または failuresonly を使用できます。 |
デバッグ(debug) | いいえ | なし | 障害の内容とともに、エラー メッセージを表示します。 |
次の例は、Confluence ページの基本的なマークアップを調べたり、編集したりする上級ユーザー向けに提供されています。
マクロ名: junitreport
マクロ本文: なし。
<ac:structured-macro ac:name="junitreport">
<ac:parameter ac:name="reportdetail">summary</ac:parameter>
<ac:parameter ac:name="directory">
<ri:url ri:value="http://confluence.com/download/attachments/123/"/>
</ac:parameter>
<ac:parameter ac:name="debug">true</ac:parameter>
<ac:parameter ac:name="url">
<ri:url ri:value="http://confluence.com/download/attachments/123/file.xml"/>
</ac:parameter>
</ac:structured-macro> |
ローカル ドライブから JUnit レポートをロードする:
{junitreport:directory=file:///C:/TEMP/} |
ネットワーク ドライブから JUnit レポートをロードする:
{junitreport:url=http://*host*/*path*} |
Confluence サイトから JUnit レポートをロードする:
{junitreport:url=http://yourConfluenceInstance.com/download/attachments/<page id>/file.xml} |
認証が必要な Confluence サイトから JUnit レポートをロードする:
お使いの Confluence サイトが匿名ユーザーによるアクセスを許可していない場合、ログイン資格情報である os_username および os_password URL パラメータを、マクロの url パラメータの一部として指定します。ここでは、ユーザー名 "admin"、パスワード "secret" を指定しています。
{junitreport:url=http://yourConfluenceInstance.com/download/attachments/<page id>/file.xml?os_username=admin&os_password=secret} |