<?xml version="1.0" encoding="ISO-8859-1"?>
<project name="loadproperties-test" 
         basedir="." 
         default="testPrefixedProperties">

  <target name="init">
  </target>

  <target name="testPrefixedProperties" depends="init">
    <property name="server" value="localhost"/>
    <echo file="properties.tmp">
#http.@PORT@ = 90
http.@PORT@ = 80
http.@SERVER@ = ${server}
    </echo>
    <loadproperties srcFile="properties.tmp">
      <filterchain>
        <striplinecomments>
          <comment value="#"/>
        </striplinecomments>
        <prefixlines prefix="server1."/>
        <replacetokens>
          <token key="PORT" value="port"/>
          <token key="SERVER" value="server"/>
        </replacetokens>
        <expandproperties/>
      </filterchain>
    </loadproperties>
    <property name="server1.http.url" 
      value="http://${server1.http.server}:${server1.http.port}"/>
  </target>

  <target name="cleanup">
    <delete file="properties.tmp"/>
  </target>

</project>
