blob: a224c8677b731edc44d0cde671c6a3c239c9e7a9 [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
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
See the License for the specific language governing permissions and
limitations under the License.
<meta http-equiv="Content-Language" content="en-us"></meta>
<link rel="stylesheet" type="text/css" href="style.css">
<title>expectfailure Task</title>
<h2><a name="expectfailure">expectfailure</a></h2>
<p>Asserts that at least one of the nested tasks throws a
<table border="1" cellpadding="2" cellspacing="0">
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<td valign="top">message</td>
<td valign="top">Message for the exception if the condition
doesn't hold true. Defaults to "Expected build failure" if
expectedMessage hasn't been specified or "Expected build
failure with message '<em>expectedMessage</em>' but was
'<em>actualMessage</em>'" if it has been specified and a
different exception has been thrown.</td>
<td align="center">No.</td>
<td valign="top">expectedMessage</td>
<td valign="top">Used to assert a specific exception message.
The string will be looked for (case-sensitive) in the fault string;
<td align="center">No.</td>
<h3>Parameters specified as nested elements</h3>
<h4>all Ant tasks</h4>
<p>You can use all supported tasks and types as nested element of
this task.</p>
<p>Make the build fail with the message "expected build failure
with message='failed' but was 'passed'":</p>
&lt;expectfailure expectedMessage="failed"&gt;
<p>Make the build fail with the message "expected build failure"
because the nested task doesn't cause a build failure:</p>
&lt;echo&gt;BUILD FAILED&lt;/echo&gt;