assertResourceExists doesn't work with Ant 1.7.x and never will, document workaround. PR 52332.

git-svn-id: https://svn.apache.org/repos/asf/ant/antlibs/antunit/trunk@1225447 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Stefan Bodewig 2011-12-29 06:26:04 +00:00
parent e751bcabf6
commit efc648b621
1 changed files with 30 additions and 0 deletions

View File

@ -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