verify a resource exists prior to validating its contents

git-svn-id: https://svn.apache.org/repos/asf/ant/antlibs/antunit/trunk@1063192 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Stefan Bodewig 2011-01-25 09:43:27 +00:00
parent eb13c80e59
commit 4b7f0604d8
2 changed files with 7 additions and 0 deletions

View File

@ -38,6 +38,12 @@
</properties>
<release version="1.2" date="not-released">
<action type="update" breaks-bwc="true">
assertResourceContains now first validates that the given
resource actually exists using assertResourceExists - this may
lead to a different error message than the ones generated with
AntUnit 1.1.
</action>
<action type="add">
New assertion assertResourceExists and assertResourceDoesntExist
have been added.

View File

@ -175,6 +175,7 @@ under the License.
<attribute name="message"
default="Expected resource '@{resource}' to contain value '@{value}' but was '${@{resource}}'"/>
<sequential>
<au:assertResourceExists resource="@{resource}"/>
<au:fail message="@{message}">
<resourcecontains resource="@{resource}" substring="@{value}"
casesensitive="@{casesensitive}"/>