diff options
author | mattinger <[email protected]> | 2007-01-10 18:20:53 +0000 |
---|---|---|
committer | mattinger <[email protected]> | 2007-01-10 18:20:53 +0000 |
commit | 391a3b1becbcb9b778b8f86ff11793123ec04f78 (patch) | |
tree | db1fb364d218df157b6fd5381f571b2680ed3e60 /test/antunit/property/variable.xml | |
parent | 0ed6d4f5c09949a8e8f465ae707fa688083f9a99 (diff) |
finishing property test.xml files.
git-svn-id: file:///home/sven/projects/JOGL/temp/ant-contrib/svn/ant-contrib-code/branches/ant-1.7.0-upgrade@74 32d7a393-a5a9-423c-abd3-5d954feb1f2f
Diffstat (limited to 'test/antunit/property/variable.xml')
-rw-r--r-- | test/antunit/property/variable.xml | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/test/antunit/property/variable.xml b/test/antunit/property/variable.xml new file mode 100644 index 0000000..acd3ad1 --- /dev/null +++ b/test/antunit/property/variable.xml @@ -0,0 +1,72 @@ +<project name="propertycopy" + xmlns:au="antlib:org.apache.ant.antunit" + xmlns:antcontrib="antlib:net.sf.antcontrib"> + <import file="../common.xml" /> + + <!-- use like a standard property --> + <target name="test1"> + <antcontrib:var name="x" value="6" /> + <au:assertPropertyEquals name="x" value="6" /> + </target> + + <!-- use like a standard property --> + <target name="test2"> + <antcontrib:var name="x" value="12" /> + <au:assertPropertyEquals name="x" value="12" /> + </target> + + <!-- can append to itself --> + <target name="test3"> + <antcontrib:var name="x" value="12" /> + <antcontrib:var name="x" value="6 + ${x}" /> <!-- 6 + 12 --> + <au:assertPropertyEquals name="x" value="6 + 12" /> + </target> + + <!-- property can't override --> + <target name="test4"> + <antcontrib:var name="x" value="6" /> + <property name="x" value="12" /> + <au:assertPropertyEquals name="x" value="6" /> + </target> + + <!-- can append multiple times --> + <target name="test5"> + <antcontrib:var name="str" value="I" /> + <antcontrib:var name="str" value="${str} am" /> + <antcontrib:var name="str" value="${str} a" /> + <antcontrib:var name="str" value="${str} string." /> + <au:assertPropertyEquals name="str" value="I am a string." /> + </target> + + <!-- property can't override --> + <target name="test6"> + <antcontrib:var name="x" value="blue" /> + <tstamp> + <format property="x" pattern="EEEE" /> + </tstamp> + <antcontrib:var name="x" value="Today is ${x}."/> + <au:assertPropertyEquals name="x" value="Today is blue." /> + </target> + + <!-- can override property --> + <target name="test7"> + <property name="x" value="12" /> + <antcontrib:var name="x" value="6" /> + <au:assertPropertyEquals name="x" value="6" /> + </target> + + <target name="test9"> + <property name="i" value="2"/> + <antcontrib:var name="i" unset="true"/> + <au:assertTrue> + <not><isset property="i" /></not> + </au:assertTrue> + </target> + + <target name="test10"> + <antcontrib:var name="x" value="test"/> + <antcontrib:var name="x" unset="true"/> + <property name="x" value="xxx"/> + <au:assertPropertyEquals name="x" value="xxx" /> + </target> +</project>
\ No newline at end of file |