ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject svn commit: r477939 - in /ant/core/trunk/src: etc/testcases/taskdefs/dependset.xml tests/antunit/taskdefs/dependset-test.xml tests/junit/org/apache/tools/ant/taskdefs/DependSetTest.java
Date Tue, 21 Nov 2006 22:39:47 GMT
Author: mbenson
Date: Tue Nov 21 14:39:46 2006
New Revision: 477939

URL: http://svn.apache.org/viewvc?view=rev&rev=477939
Log:
antunit-ize and FIX (they were severely broken) DependSet tests

Added:
    ant/core/trunk/src/tests/antunit/taskdefs/dependset-test.xml   (with props)
Removed:
    ant/core/trunk/src/etc/testcases/taskdefs/dependset.xml
    ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/DependSetTest.java

Added: ant/core/trunk/src/tests/antunit/taskdefs/dependset-test.xml
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/antunit/taskdefs/dependset-test.xml?view=auto&rev=477939
==============================================================================
--- ant/core/trunk/src/tests/antunit/taskdefs/dependset-test.xml (added)
+++ ant/core/trunk/src/tests/antunit/taskdefs/dependset-test.xml Tue Nov 21 14:39:46 2006
@@ -0,0 +1,101 @@
+<?xml version="1.0"?>
+
+<project name="dependset-test" xmlns:au="antlib:org.apache.ant.antunit">
+
+  <target name="test1">
+    <au:expectfailure expectedMessage="At least one set of source resources must be specified">
+      <dependset />
+    </au:expectfailure>
+  </target>
+
+  <target name="test2">
+    <au:expectfailure expectedMessage="At least one set of target files must be specified">
+      <dependset>
+        <srcfilelist dir="." files="test2.tmp" />
+      </dependset>
+    </au:expectfailure>
+  </target>
+
+  <target name="test3">
+    <au:expectfailure expectedMessage="At least one set of source resources must be specified">
+      <dependset>
+        <targetfileset dir="." includes="test3.tmp" />
+      </dependset>
+    </au:expectfailure>
+  </target>
+
+  <target name="test4">
+    <touch file="test4.tmp" />
+    <dependset>
+      <srcfilelist dir="." files="test4.tmp" />
+      <targetfileset id="targetfs" dir="." includes="i-do-not-exist" />
+    </dependset>
+  </target>
+
+  <target name="test5">
+    <touch file="older.tmp" />
+    <sleep seconds="3" />
+    <touch file="newer.tmp" />
+    <dependset>
+      <srcfilelist dir="." files="newer.tmp" />
+      <targetfilelist dir="." files="older.tmp" />
+    </dependset>
+    <au:assertFalse>
+      <available file="older.tmp" />
+    </au:assertFalse>
+  </target>
+
+  <target name="test6">
+    <touch file="older.tmp" />
+    <sleep seconds="3" />
+    <touch file="newer.tmp" />
+    <dependset>
+      <sources>
+        <file file="newer.tmp" />
+      </sources>
+      <targets>
+        <filelist dir="." files="older.tmp" />
+      </targets>
+    </dependset>
+    <au:assertFalse>
+      <available file="older.tmp" />
+    </au:assertFalse>
+  </target>
+
+  <target name="test7">
+    <touch file="older.tmp" />
+    <dependset>
+      <sources>
+        <propertyresource name="thereisnosuchproperty" />
+      </sources>
+      <targets>
+        <filelist dir="." files="older.tmp" />
+      </targets>
+    </dependset>
+    <au:assertFalse>
+      <available file="older.tmp" />
+    </au:assertFalse>
+  </target>
+
+  <target name="test8">
+    <touch file="older.tmp" />
+    <property name="foo" value="bar" />
+    <dependset>
+      <sources>
+        <propertyresource name="foo" />
+      </sources>
+      <targets>
+        <filelist dir="." files="older.tmp" />
+      </targets>
+    </dependset>
+    <au:assertTrue>
+      <available file="older.tmp" />
+    </au:assertTrue>
+  </target>
+
+  <target name="tearDown"> 
+    <delete file="test4.tmp" />
+    <delete file="older.tmp" />
+    <delete file="newer.tmp" />
+  </target>
+</project>

Propchange: ant/core/trunk/src/tests/antunit/taskdefs/dependset-test.xml
------------------------------------------------------------------------------
    svn:eol-style = native



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


Mime
View raw message