ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From peterrei...@apache.org
Subject svn commit: r491014 - /ant/core/trunk/src/tests/antunit/taskdefs/whichresource-test.xml
Date Fri, 29 Dec 2006 14:11:14 GMT
Author: peterreilly
Date: Fri Dec 29 06:11:13 2006
New Revision: 491014

URL: http://svn.apache.org/viewvc?view=rev&rev=491014
Log:
tests for classpathref attribute of whichresource

Added:
    ant/core/trunk/src/tests/antunit/taskdefs/whichresource-test.xml

Added: ant/core/trunk/src/tests/antunit/taskdefs/whichresource-test.xml
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/antunit/taskdefs/whichresource-test.xml?view=auto&rev=491014
==============================================================================
--- ant/core/trunk/src/tests/antunit/taskdefs/whichresource-test.xml (added)
+++ ant/core/trunk/src/tests/antunit/taskdefs/whichresource-test.xml Fri Dec 29 06:11:13 2006
@@ -0,0 +1,42 @@
+<project default="all" xmlns:au="antlib:org.apache.ant.antunit">
+  <property name="ant-build" location="../../../../build"/>
+  <property name="build-dir" 
+            location="${ant-build}/ant-unit/whichresource/build"/>
+
+  <target name="init">
+    <delete quiet="yes" dir="${build-dir}"/>
+    <mkdir dir="${build-dir}"/>
+    <javac srcdir="javac-dir/good-src" destdir="${build-dir}"/>
+    <path id="whichresource-build" path="${build-dir}"/>
+  </target>
+  
+  <target name="test-reference" depends="init">
+    <whichresource
+      property="whichresource.prop"
+      class="Simple"
+      classpathref="whichresource-build"/>
+
+    <au:assertTrue>
+      <contains string="${whichresource.prop}"
+                substring="Simple.class"/>
+    </au:assertTrue>
+  </target>
+
+  <target name="test-not-present" depends="init">
+    <whichresource
+      property="whichresource2.prop"
+      class="ClassNotPresent"
+      classpathref="whichresource-build"/>
+
+    <au:assertFalse>
+      <isset property="whichresource.prop2"/>
+    </au:assertFalse>
+  </target>
+
+  <target name="all">
+    <au:antunit>
+      <fileset file="${ant.file}"/>
+      <au:plainlistener/>
+    </au:antunit>
+  </target>
+</project>



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message