You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by st...@apache.org on 2006/03/16 15:00:03 UTC

svn commit: r386330 - in /ant/core/trunk/src: etc/testcases/core/extended-taskdef.xml testcases/org/apache/tools/ant/ExtendedTaskdefTest.java

Author: stevel
Date: Thu Mar 16 06:00:00 2006
New Revision: 386330

URL: http://svn.apache.org/viewcvs?rev=386330&view=rev
Log:
No, it isnt the fact that I declare things through a property file either.

Modified:
    ant/core/trunk/src/etc/testcases/core/extended-taskdef.xml
    ant/core/trunk/src/testcases/org/apache/tools/ant/ExtendedTaskdefTest.java

Modified: ant/core/trunk/src/etc/testcases/core/extended-taskdef.xml
URL: http://svn.apache.org/viewcvs/ant/core/trunk/src/etc/testcases/core/extended-taskdef.xml?rev=386330&r1=386329&r2=386330&view=diff
==============================================================================
--- ant/core/trunk/src/etc/testcases/core/extended-taskdef.xml (original)
+++ ant/core/trunk/src/etc/testcases/core/extended-taskdef.xml Thu Mar 16 06:00:00 2006
@@ -5,6 +5,7 @@
 
   </description>
   <property name="src" value="Foo.java"/>
+  <property name="taskdefs" value="tasks.properties"/>
 
   <target name="write" >
     <echo file="${src}">
@@ -17,6 +18,9 @@
         }
       }
     </echo>
+    <propertyfile file="${taskdefs}">
+      <entry key="foo2" value="Foo"/>
+    </propertyfile>
   </target>
 
   <target name="compile" depends="write">
@@ -32,11 +36,21 @@
     </foo>
   </target>
 
+  <target name="testRun2" depends="compile">
+    <taskdef resource="${taskdefs}" classpath="${basedir}"/>
+    <foo2 maxwait="5" maxwaitunit="second"
+        timeoutproperty="foo">
+      <or/>
+    </foo2>
+  </target>
+
+
   <target name="teardown">
     <delete>
       <fileset dir="${basedir}"
           includes="${src},*.class"/>
     </delete>
+    <delete file="${taskdefs}" />
   </target>
 
 </project>

Modified: ant/core/trunk/src/testcases/org/apache/tools/ant/ExtendedTaskdefTest.java
URL: http://svn.apache.org/viewcvs/ant/core/trunk/src/testcases/org/apache/tools/ant/ExtendedTaskdefTest.java?rev=386330&r1=386329&r2=386330&view=diff
==============================================================================
--- ant/core/trunk/src/testcases/org/apache/tools/ant/ExtendedTaskdefTest.java (original)
+++ ant/core/trunk/src/testcases/org/apache/tools/ant/ExtendedTaskdefTest.java Thu Mar 16 06:00:00 2006
@@ -35,9 +35,30 @@
         configureProject("src/etc/testcases/core/extended-taskdef.xml");
     }
 
+    /**
+     * Automatically calls the target called "tearDown"
+     * from the build file tested if it exits.
+     * <p/>
+     * This allows to use Ant tasks directly in the build file
+     * to clean up after each test. Note that no "setUp" target
+     * is automatically called, since it's trivial to have a
+     * test target depend on it.
+     */
+    protected void tearDown() throws Exception {
+        super.tearDown();
+        executeTarget("teardown");
+    }
+
     public void testRun() throws Exception {
         expectBuildExceptionContaining("testRun",
                 "exception thrown by the subclass",
                 "executing the Foo task");
     }
+
+    public void testRun2() throws Exception {
+        expectBuildExceptionContaining("testRun2",
+                "exception thrown by the subclass",
+                "executing the Foo task");
+    }
+
 }



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