Browse Source

looking at how xml properties get expanded

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@497387 13f79535-47bb-0310-9956-ffa450edef68
master
Steve Loughran 18 years ago
parent
commit
ca13f52a19
2 changed files with 43 additions and 0 deletions
  1. +27
    -0
      src/tests/antunit/taskdefs/xmlproperty-test.xml
  2. +16
    -0
      src/tests/antunit/taskdefs/xmlproperty.inline-expansion.xml

+ 27
- 0
src/tests/antunit/taskdefs/xmlproperty-test.xml View File

@@ -6,6 +6,7 @@
<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"/>
@@ -13,5 +14,31 @@
<equals arg1="original" arg2="${root.element.value}"/>
</au:assertTrue>
</target>

<target name="testInlineExpansion">
<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>
<au:assertPropertyEquals name="app.p" value="${app.n}"/>
<au:assertPropertyEquals name="app.n" value="n"/>
<au:assertPropertyEquals name="app.o" value="n"/>
<au:assertPropertyEquals name="app.m" value="n"/>
<au:assertEquals actual="${app.n}" expected="n"/>
<au:assertEquals actual="${app.o}" expected="n"/>
<au:assertEquals actual="${app.m}" expected="n"/>
<fail>
<not>
</not>
</fail>
</target>
</project>


+ 16
- 0
src/tests/antunit/taskdefs/xmlproperty.inline-expansion.xml View File

@@ -0,0 +1,16 @@
<root-tag>
<!--used to check that the ordering of attribute expansion/eval is the order of
declaration in the build file, not alphabetical

expectations are
p : ${app.n}
n : n
o : n
m : n
-->
<app
p="${app.n}"
n="n"
o="${app.n}"
m="${app.n}"/>
</root-tag>

Loading…
Cancel
Save