| <?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"> |
| |
| <import file="../antunit-base.xml" /> |
| |
| <target name="testNestedText"> |
| <property name="foo">bar</property> |
| <au:assertPropertyEquals name="foo" value="bar"/> |
| </target> |
| |
| <target name="testNoNestedTextButValueAttribute"> |
| <property name="foo" value="bar"> |
| </property> |
| <au:assertPropertyEquals name="foo" value="bar"/> |
| </target> |
| |
| <target name="testNestedTextAndValueAttribute"> |
| <au:expectfailure> |
| <property name="foo" value="bar"> |
| hello |
| </property> |
| </au:expectfailure> |
| </target> |
| |
| <!-- Ensure we have platform dependent path separator --> |
| <property name="base" location="${basedir}"/> |
| <!-- an existing file as anchor for calculating paths --> |
| <property name="testfile" value="condition${file.separator}antversion-test.xml"/> |
| |
| <target name="testLocation"> |
| <property name="foo" location="${testfile}"/> |
| <au:assertPropertyEquals name="foo" value="${base}${file.separator}${testfile}"/> |
| </target> |
| |
| <target name="testLocationWithRecursive"> |
| <property name="foo" location="${testfile}" relative="false"/> |
| <au:assertPropertyEquals name="foo" value="${base}${file.separator}${testfile}"/> |
| </target> |
| |
| <target name="testRelative"> |
| <property name="foo" location="${testfile}" relative="true"/> |
| <au:assertPropertyEquals name="foo" value="${testfile}"/> |
| </target> |
| |
| <target name="testRelativeBase"> |
| <property name="foo" location="${testfile}" relative="true" basedir="${base}"/> |
| <au:assertPropertyEquals name="foo" value="${testfile}"/> |
| </target> |
| |
| <target name="testRelativeUnderBase"> |
| <property name="foo" location="${testfile}" relative="true" basedir="condition"/> |
| <au:assertPropertyEquals name="foo" value="antversion-test.xml"/> |
| </target> |
| |
| <target name="testRelativeUnderBase2"> |
| <property name="foo" location="${testfile}" relative="true" basedir="cvs"/> |
| <au:assertPropertyEquals name="foo" value="..${file.separator}condition${file.separator}antversion-test.xml"/> |
| </target> |
| |
| <target name="testRelativeOverBase"> |
| <property name="foo" location="${testfile}" relative="true" basedir=".."/> |
| <au:assertPropertyEquals name="foo" value="taskdefs${file.separator}${testfile}"/> |
| </target> |
| |
| <target name="testNestedExpansionHonorsImmutability"> |
| <mkdir dir="${input}"/> |
| <property name="x" value="x"/> |
| <echo file="${input}/x.properties"><![CDATA[ |
| x=y |
| y=$${x} |
| ]]></echo> |
| <property file="${input}/x.properties"/> |
| <au:assertPropertyEquals name="y" value="x"/> |
| </target> |
| </project> |