ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r1225447 - /ant/antlibs/antunit/trunk/docs/assertions.html
Date Thu, 29 Dec 2011 06:26:05 GMT
Author: bodewig
Date: Thu Dec 29 06:26:04 2011
New Revision: 1225447

URL: http://svn.apache.org/viewvc?rev=1225447&view=rev
Log:
assertResourceExists doesn't work with Ant 1.7.x and never will, document workaround.  PR
52332.

Modified:
    ant/antlibs/antunit/trunk/docs/assertions.html

Modified: ant/antlibs/antunit/trunk/docs/assertions.html
URL: http://svn.apache.org/viewvc/ant/antlibs/antunit/trunk/docs/assertions.html?rev=1225447&r1=1225446&r2=1225447&view=diff
==============================================================================
--- ant/antlibs/antunit/trunk/docs/assertions.html (original)
+++ ant/antlibs/antunit/trunk/docs/assertions.html Thu Dec 29 06:26:04 2011
@@ -322,6 +322,21 @@
       <assertResourceExists resource="${ant.home}/lib/ant.jar"/>
     </pre>
 
+    <h3>Ant 1.7.x Note</h3>
+
+    <p><code>assertResourceExists</code> relies on Ant 1.8.0 or later,
+      it doesn't work with Ant 1.7.x.  You can simulate the assertion
+      using the <code>resourceExists</code> condition
+      and <code>assertTrue</code>, for example</p>
+
+    <pre>
+      &lt;au:assertTrue message="Expected resource '${ant.home}/lib/ant.jar' to exist"&gt;
+        &lt;au:resourceExists&gt;
+          &lt;file file="${ant.home}/lib/ant.jar"/&gt;
+        &lt;/au:resourceExists&gt;
+      &lt;/au:assertTrue&gt;
+    </pre>
+
     <h2><a name="assertResourceDoesntExist">assertResourceDoesntExist</a></h2>
 
     <p><em>Since AntUnit 1.2</em></p>
@@ -359,6 +374,21 @@
       &lt;assertResourceDoesntExist resource="${ant.home}/lib/ant.jar"/&gt;
     </pre>
 
+    <h3>Ant 1.7.x Note</h3>
+
+    <p><code>assertResourceDoesntExist</code> relies on Ant 1.8.0 or later,
+      it doesn't work with Ant 1.7.x.  You can simulate the assertion
+      using the <code>resourceExists</code> condition
+      and <code>assertFalse</code>, for example</p>
+
+    <pre>
+      &lt;au:assertFalse message="Didn't expect resource '${ant.home}/lib/ant.jar' to
exist"&gt;
+        &lt;au:resourceExists&gt;
+          &lt;file file="${ant.home}/lib/ant.jar"/&gt;
+        &lt;/au:resourceExists&gt;
+      &lt;/au:assertFalse&gt;
+    </pre>
+
     <h2><a name="assertDestIsUptodate">assertDestIsUptodate</a></h2>
 
     <p>Asserts that a dest file is more recent than the source



Mime
View raw message