blob: 9a2e0480b81d27549f21b7408f2660fa9e9b15ef [file] [log] [blame]
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<html>
<head>
<meta http-equiv="Content-Language" content="en-us"></meta>
<link rel="stylesheet" type="text/css" href="style.css">
<title>XMLListener AntUnit Listener</title>
</head>
<body>
<h2><a name="xmllistener">XML AntUnit Listener</a></h2>
<h3>Description</h3>
<p>Writes reports similar to the "xml" JUnit formatter. Some
information that appears as attributes for the JUnit formatter has
been turned into elements to allow streaming of the report.</p>
<p>The AntUnit distribution comes with two XSLT stylesheets (in
the etc subdirectory of the binary or the src/etc directory of the
source release) that can be used together with Ant's
&lt;junitreport&gt; task to create reports about your AntUnit
tests.</p>
<h3>Parameters</h3>
<table border="1" cellpadding="2" cellspacing="0">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
</tr>
<tr>
<td valign="top">toDir</td>
<td valign="top">Directory where testreports will be written
to. Defaults to the project's basedir.</td>
<td align="center">No.</td>
</tr>
<tr>
<td valign="top">logLevel</td>
<td valign="top">Log level for messages from the tests to
include in the report. Must be one of: none, error, warn,
warning, info, verbose, and debug. Messages at the given level
or below will be included.</td>
<td align="center">No. Default is 'none'.</td>
</tr>
</table>
<h3>Examples</h3>
<pre>
&lt;au:antunit failonerror="false" errorproperty="antunit-failure">
&lt;fileset dir="${tests}" includes="*.xml"/>
&lt;au:xmllistener toDir="${reportsdir}"/>
&lt;/au:antunit>
&lt;junitreport>
&lt;fileset dir="${reportsdir}" includes="*.xml"/>
&lt;report format="frames" styledir="${antunit-styles}"
todir="${reportsdir}-frames"/>
&lt;/junitreport>
&lt;fail if="antunit-failure">At least one test has failed&lt;/fail>
</pre>
<p>Runs AntUnit on all XML files in the directory
<code>${tests}</code> writing XML reports to the directory
<code>${reportsdir}</code> (which must exist upfront). Based on
the XML reports a consolidated HTML frame report is created in
<code>${reportsdir}-frames</code> using the stylesheets mentioned
above. <code>${antunit-styles}</code> must point to the directory
containing the stylesheets.</p>
</body>
</html>