| <?xml version="1.0"?> |
| <!-- |
| Licensed to the Apache Software Foundation (ASF) under one or more |
| contributor license agreements. See the NOTICE file distributed with |
| this work for additional information regarding copyright ownership. |
| The ASF licenses this file to You under the Apache License, Version 2.0 |
| (the "License"); you may not use this file except in compliance with |
| the License. You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
| --> |
| <project default="antunit" xmlns:au="antlib:org.apache.ant.antunit" |
| xmlns:props="antlib:org.apache.ant.props"> |
| |
| <target name="antunit"> |
| <au:antunit> |
| <fileset file="${ant.file}" /> |
| </au:antunit> |
| </target> |
| |
| <target name="setUp"> |
| <propertyhelper> |
| <props:nested /> |
| </propertyhelper> |
| </target> |
| |
| <target name="testNonNested" depends="setUp"> |
| <property name="foo" value="foo.value" /> |
| <au:assertTrue> |
| <equals arg1="${foo}" arg2="foo.value" /> |
| </au:assertTrue> |
| </target> |
| |
| <target name="testNested" depends="setUp"> |
| <property name="foo" value="foo.value" /> |
| <property name="var" value="foo" /> |
| <au:assertTrue> |
| <equals arg1="${${var}}" arg2="foo.value" /> |
| </au:assertTrue> |
| </target> |
| |
| <target name="testMultiNested" depends="setUp"> |
| <property name="foo" value="foo.value" /> |
| <property name="var1" value="f" /> |
| <property name="var2" value="oo" /> |
| <au:assertTrue> |
| <equals arg1="${${var1}${var2}}" arg2="foo.value" /> |
| </au:assertTrue> |
| </target> |
| |
| <target name="testDoubleNested" depends="setUp"> |
| <property name="foo" value="foo.value" /> |
| <property name="var" value="foo" /> |
| <property name="var.var" value="var" /> |
| <au:assertTrue> |
| <equals arg1="${${${var.var}}}" arg2="foo.value" /> |
| </au:assertTrue> |
| </target> |
| |
| <target name="testMixedNested" depends="setUp"> |
| <property name="foo" value="foo.value" /> |
| <property name="var" value="f" /> |
| <property name="var.var" value="v" /> |
| <au:assertTrue> |
| <equals arg1="${${${var.var}ar}oo}" arg2="foo.value" /> |
| </au:assertTrue> |
| </target> |
| |
| <target name="testUnbalanced" depends="setUp"> |
| <property name="foo" value="foo.value" /> |
| <property name="var" value="foo" /> |
| <property name="var.var" value="var" /> |
| <au:assertTrue> |
| <equals arg1="${${${var.var}}" arg2="${${${var.var}}" /> |
| </au:assertTrue> |
| </target> |
| |
| <target name="testNestedDoubleDollar" depends="setUp"> |
| <property name="$$" value="$$.value" /> |
| <au:assertTrue> |
| <and> |
| <equals arg1="${$$}" arg2="$$.value" /> |
| <equals arg1="${$$}" arg2="${$}" /> |
| </and> |
| </au:assertTrue> |
| </target> |
| |
| </project> |