| <?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 xmlns:au="antlib:org.apache.ant.antunit"> |
| <description/> |
| <target name="test-empty"> |
| <xmlproperty file="xmlproperty-test.xml"/> |
| <au:assertTrue> |
| <equals arg1="" arg2="${project.description}"/> |
| </au:assertTrue> |
| </target> |
| |
| <target name="test-multi"> |
| <property name="root.element.value" value="original"/> |
| <xmlproperty file="xmlproperty.multi.xml" collapseAttributes="yes"/> |
| <au:assertTrue> |
| <equals arg1="original" arg2="${root.element.value}"/> |
| </au:assertTrue> |
| </target> |
| |
| <target name="load"> |
| <xmlproperty |
| file="xmlproperty.inline-expansion.xml" |
| collapseAttributes="true" |
| keepRoot="false" |
| semanticAttributes="true"/> |
| <echo> |
| element expected actual |
| p $${app.n} ${app.p} |
| n n ${app.n} |
| o n ${app.o} |
| m n ${app.m} |
| </echo> |
| </target> |
| |
| <target name="NotestInlineExpansion" depends="load"> |
| <au:assertPropertyEquals name="app.m" value="n"/> |
| <au:assertPropertyEquals name="app.n" value="n"/> |
| <au:assertPropertyEquals name="app.o" value="n"/> |
| <au:assertPropertyEquals name="app.p" value="$${app.n}"/> |
| <property name="sequence" value="${app.m}${app.n}${app.o}${app.p}"/> |
| <fail> |
| xml attributes are not expanding correctly |
| expected: mnop=nnn$${app.n} |
| actual mnop=${sequence} |
| <condition> |
| <not> |
| <equals arg1="${sequence}" arg2="nnn${app.n}"/> |
| </not> |
| </condition> |
| </fail> |
| </target> |
| </project> |
| |