samples/primitiveconstants/build.xml
changeset 263 7e8e995065c5
parent 128 8ef997796d0a
child 264 312188b7ba93
     1.1 --- a/samples/primitiveconstants/build.xml	Sat Jun 14 09:55:09 2008 +0200
     1.2 +++ b/samples/primitiveconstants/build.xml	Sat Jun 14 18:51:38 2008 +0200
     1.3 @@ -3,6 +3,7 @@
     1.4      <target name="clean">
     1.5          <delete dir="build"/>
     1.6      </target>
     1.7 +    <target name="test" depends="run"/>
     1.8      
     1.9      <target name="compile" depends="build"/>
    1.10      <target name="build">
    1.11 @@ -22,10 +23,12 @@
    1.12          <echo level="info" message="Running the Implementation against Version 1.0 of the API. This should succeeds."/>
    1.13          <antcall target="-run-one">
    1.14              <param name="version" value="api1.0"/>
    1.15 +            <param name="result" value="0"/>
    1.16          </antcall>
    1.17          <echo level="info" message="Running the Implementation against Version 2.0 of the API. This should fail."/>
    1.18          <antcall target="-run-one">
    1.19              <param name="version" value="api2.0"/>
    1.20 +            <param name="result" value="1"/>
    1.21          </antcall>
    1.22      </target>
    1.23  
    1.24 @@ -35,8 +38,15 @@
    1.25      <target name="-run-one">
    1.26          <fail message="You need to specify API version number" unless="version"/>
    1.27          <java classpath="build/${version}/classes:build/impl/classes" classname="impl.Impl"
    1.28 -            failonerror="true"
    1.29 +            resultproperty="result.real" failonerror="false"
    1.30          />
    1.31 +        <fail message="Unexpected failure for ${version}: ${result.real}">
    1.32 +            <condition>
    1.33 +                <not>
    1.34 +                    <equals arg1="${result}" arg2="${result.real}"/>
    1.35 +                </not>
    1.36 +            </condition>
    1.37 +        </fail>
    1.38      </target>
    1.39      
    1.40      <target name="-build-one">