diff options
Diffstat (limited to 'test/antunit/property/propertycopy.xml')
-rw-r--r-- | test/antunit/property/propertycopy.xml | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/test/antunit/property/propertycopy.xml b/test/antunit/property/propertycopy.xml new file mode 100644 index 0000000..87f5d6e --- /dev/null +++ b/test/antunit/property/propertycopy.xml @@ -0,0 +1,42 @@ +<project name="propertycopy" + xmlns:au="antlib:org.apache.ant.antunit" + xmlns:antcontrib="antlib:net.sf.antcontrib"> + <import file="../common.xml" /> + + <target name="testCopy"> + <property name="org" value="MyOrg" /> + <property name="org.MyOrg.DisplayName" value="My Organiziation" /> + <antcontrib:propertycopy name="displayName" from="org.${org}.DisplayName" /> + + <au:assertPropertyEquals name="displayName" + value="${org.MyOrg.DisplayName}" + message="displayName failed" /> + </target> + + <target name="testSilent"> + <antcontrib:propertycopy name="foo" from="bar" silent="true"/> + <au:assertTrue> + <not> + <isset property="foo" /> + </not> + </au:assertTrue> + </target> + + <target name="testNotSilent"> + <au:expectfailure expectedmessage="Property 'bar' is not defined."> + <antcontrib:propertycopy name="foo" from="bar"/> + </au:expectfailure> + </target> + + <target name="testMissingName"> + <au:expectfailure expectedmessage="You must specify a property to set."> + <antcontrib:propertycopy from="bar"/> + </au:expectfailure> + </target> + + <target name="testMissingFrom"> + <au:expectfailure expectedmessage="Missing the 'from' attribute."> + <antcontrib:propertycopy name="foo"/> + </au:expectfailure> + </target> +</project>
\ No newline at end of file |