ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From k...@apache.org
Subject svn commit: r537347 - /ant/core/trunk/src/tests/antunit/taskdefs/echoxml-test.xml
Date Sat, 12 May 2007 06:16:08 GMT
Author: kevj
Date: Fri May 11 23:16:08 2007
New Revision: 537347

URL: http://svn.apache.org/viewvc?view=rev&rev=537347
Log:
-new antunit test for echoxml

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

Added: ant/core/trunk/src/tests/antunit/taskdefs/echoxml-test.xml
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/antunit/taskdefs/echoxml-test.xml?view=auto&rev=537347
==============================================================================
--- ant/core/trunk/src/tests/antunit/taskdefs/echoxml-test.xml (added)
+++ ant/core/trunk/src/tests/antunit/taskdefs/echoxml-test.xml Fri May 11 23:16:08 2007
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="utf-8"?>
+<project default="antunit" xmlns:au="antlib:org.apache.ant.antunit">
+
+  <!-- note relies on antunit built from svn trunk (1.1-alpha) -->
+  <import file="../antunit-base.xml"/>
+	
+  <target name="setUp">
+	<property name="file" location="${java.io.tmpdir}/echoed.xml"/>
+  	<echoxml file="${file}">
+  	  <project>
+  	    <property name="foo" value="bar" />
+  	    <fail message="$$$${foo}=$${foo}">
+  	      <condition>
+  	        <istrue value="${mustfail}" />
+  	      </condition>
+  	    </fail>
+  	  </project>
+  	</echoxml>
+  </target>
+	
+  <target name="tearDown">
+    <delete file="${file}"/>
+  </target>	
+
+  <target name="testPass">
+	<ant antfile="${file}"/>
+  </target>
+	
+  <target name="testFail">
+  	<au:expectfailure expectedmessage="${foo}=bar" message="Should have thrown an exception">
+      <ant antfile="${file}">
+        <property name="mustfail" value="true" />
+      </ant>
+  	</au:expectfailure>
+  </target>
+	
+  <target name="testEmpty">
+  	<au:expectfailure expectedmessage="No nested XML specified" message="Should have thrown
an exception">
+      <echoxml />
+  	</au:expectfailure>
+  </target>
+	
+  <target name="test-ns"> <!-- comment this if you don't have the svn trunk of antunit
-->
+	<echoxml file="${file}" xmlns:a="antlib:a">
+		 <a:something />
+  	</echoxml>
+  	<au:assertResourceContains resource="${file}" value="a:something"/>
+  </target>
+</project>
\ No newline at end of file



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


Mime
View raw message