diff options
author | mattinger <[email protected]> | 2007-01-10 16:44:39 +0000 |
---|---|---|
committer | mattinger <[email protected]> | 2007-01-10 16:44:39 +0000 |
commit | 78dca04381301a66ee977808e4ee0bb3dc5a7290 (patch) | |
tree | d0abe5c24b277cd4059681b0bf70b7b8fac0da37 /test/antunit/property | |
parent | 029cd4b9bc7d4b73f024b9191f2db44fd3edec32 (diff) |
first batch of antunit based test files.
git-svn-id: file:///home/sven/projects/JOGL/temp/ant-contrib/svn/ant-contrib-code/branches/ant-1.7.0-upgrade@70 32d7a393-a5a9-423c-abd3-5d954feb1f2f
Diffstat (limited to 'test/antunit/property')
-rw-r--r-- | test/antunit/property/propertycopy.xml | 42 | ||||
-rw-r--r-- | test/antunit/property/propertyslector.xml | 44 |
2 files changed, 86 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 diff --git a/test/antunit/property/propertyslector.xml b/test/antunit/property/propertyslector.xml new file mode 100644 index 0000000..016f159 --- /dev/null +++ b/test/antunit/property/propertyslector.xml @@ -0,0 +1,44 @@ +<project name="propertycopy" + xmlns:au="antlib:org.apache.ant.antunit" + xmlns:antcontrib="antlib:net.sf.antcontrib"> + <import file="../common.xml" /> + + <property name="module.Module1.id" value="1" /> + <property name="module.Module1.name" value="Module 1" /> + <property name="module.Module2.id" value="2" /> + <property name="module.Module2.name" value="Module 2" /> + <property name="module.Module2.foo.id" value="3" /> + <property name="module.Module2.foo.name" value="Module 3" /> + + <target name="testGrouping0"> + <antcontrib:propertyselector property="module.list" + match="module\.([^\.]*)\.id" + delimiter="," + casesensitive="false" /> + + <au:assertTrue> + <and> + <contains string="${module.list}" substring="module.Module1.id" /> + <contains string="${module.list}" substring="module.Module2.id" /> + <not><contains string="${module.list}" substring="module.Module3.foo.id" /></not> + </and> + </au:assertTrue> + </target> + + <target name="testGrouping1"> + <antcontrib:propertyselector property="module.list" + match="module\.([^\.]*)\.id" + select="\1" + delimiter="," + casesensitive="false" /> + <au:assertTrue> + <and> + <not><contains string="${module.list}" substring="module." /></not> + <not><contains string="${module.list}" substring=".id" /></not> + <contains string="${module.list}" substring="Module1" /> + <contains string="${module.list}" substring="Module2" /> + <not><contains string="${module.list}" substring="Module3" /></not> + </and> + </au:assertTrue> + </target> +</project>
\ No newline at end of file |