Author: bodewig
Date: Fri Aug 22 08:29:46 2008
New Revision: 688096

URL: http://svn.apache.org/viewvc?rev=688096&view=rev
Log:
document assertResourceContains

Modified:
    ant/antlibs/antunit/trunk/docs/assertions.html
    ant/antlibs/antunit/trunk/src/main/org/apache/ant/antunit/antlib.xml

Modified: ant/antlibs/antunit/trunk/docs/assertions.html
URL: 
http://svn.apache.org/viewvc/ant/antlibs/antunit/trunk/docs/assertions.html?rev=688096&r1=688095&r2=688096&view=diff
==============================================================================
--- ant/antlibs/antunit/trunk/docs/assertions.html (original)
+++ ant/antlibs/antunit/trunk/docs/assertions.html Fri Aug 22 08:29:46 2008
@@ -633,6 +633,44 @@
         </tr>
     </table>
 
+    <h2><a name="assertResourceContains">assertResourceContains</a></h2>
+
+    <p>Asserts that a resource's content includes a given string.</p>
+
+    <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">resource</td>
+        <td valign="top">Location of the resource to load.</td>
+        <td valign="top" align="center">Yes</td>
+      </tr>
+      <tr>
+        <td valign="top">value</td>
+        <td valign="top">The text to search for.</td>
+        <td valign="top" align="center">Yes</td>
+      </tr>
+        <tr>
+          <td valign="top">casesensitive</td>
+          <td valign="top">
+            Perform a case sensitive match.
+            Default is true.
+          </td>
+          <td align="center">No.</td>
+        </tr>
+      <tr>
+        <td valign="top">message</td>
+        <td valign="top">Message for the exception if the condition
+          doesn't hold true.  Defaults to "Expected resource
+          '<em>resource</em>' to contain value '<em>value</em>' but
+          was '<em>content of resource</em>'".</td>
+        <td align="center">No.</td>
+      </tr>
+    </table>
+
     <hr/>
   </body>
 </html>

Modified: ant/antlibs/antunit/trunk/src/main/org/apache/ant/antunit/antlib.xml
URL: 
http://svn.apache.org/viewvc/ant/antlibs/antunit/trunk/src/main/org/apache/ant/antunit/antlib.xml?rev=688096&r1=688095&r2=688096&view=diff
==============================================================================
--- ant/antlibs/antunit/trunk/src/main/org/apache/ant/antunit/antlib.xml 
(original)
+++ ant/antlibs/antunit/trunk/src/main/org/apache/ant/antunit/antlib.xml Fri 
Aug 22 08:29:46 2008
@@ -132,16 +132,29 @@
   </macrodef>
 
   <macrodef name="assertResourceContains">
-       <attribute name="resource"/>
-       <attribute name="value"/>
-       <attribute name="casesensitive" default="true"/>
-       <attribute name="message"
-         default="Expected resource '@{resource}' to contain value '@{value}' 
but was '[EMAIL PROTECTED]'"/>
-    <sequential>
-         <au:assertTrue message="@{message}">
-           <resourcecontains resource="@{resource}" substring="@{value}"/>
-         </au:assertTrue>
-       </sequential>
+    <attribute name="resource"/>
+    <attribute name="value"/>
+    <attribute name="casesensitive" default="true"/>
+    <attribute name="message"
+              default="Expected resource '@{resource}' to contain value 
'@{value}' but was '[EMAIL PROTECTED]'"/>
+    <sequential>
+      <au:assertTrue message="@{message}">
+       <resourcecontains resource="@{resource}" substring="@{value}"/>
+      </au:assertTrue>
+    </sequential>
+  </macrodef>
+
+  <macrodef name="assertResourceDoesntContain">
+    <attribute name="resource"/>
+    <attribute name="value"/>
+    <attribute name="casesensitive" default="true"/>
+    <attribute name="message"
+              default="Didn't expect resource '@{resource}' to contain value 
'@{value}' but was '[EMAIL PROTECTED]'"/>
+    <sequential>
+      <au:assertFalse message="@{message}">
+       <resourcecontains resource="@{resource}" substring="@{value}"/>
+      </au:assertFalse>
+    </sequential>
   </macrodef>
 
   <macrodef name="assertDestIsUptodate" backtrace="false">


Reply via email to