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
diff --git a/changes.xml b/changes.xml
index 8393c67..1ff1a59 100644
--- a/changes.xml
+++ b/changes.xml
@@ -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.
diff --git a/src/main/org/apache/ant/antunit/antlib.xml b/src/main/org/apache/ant/antunit/antlib.xml
index fb167d1..932258c 100644
--- a/src/main/org/apache/ant/antunit/antlib.xml
+++ b/src/main/org/apache/ant/antunit/antlib.xml
@@ -175,6 +175,7 @@
<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}"/>