|
- <?xml version="1.0"?>
-
- <project name="case-test" default="test" basedir=".">
-
- <property name="value" value="task.xml" />
-
- <target name="init">
- <taskdef name="antlib" classname="org.apache.tools.ant.taskdefs.Antlib" />
- <antlib file="../../build/case_contrib.jar" />
- </target>
-
- <target name="test" depends="init,case,test1,test2,test3">
- <echo message="Value=${value}" />
- </target>
-
- <target name="case" >
- <case property="value" >
- <when value="task.xml" property="value.xml" />
- </case>
- <case property="location" >
- <when value="loc" property="location.fail" />
- <when value="" property="location.fail" />
- <else property="location.unset" />
- </case>
- </target>
-
- <target name="test1" if="value.xml">
- <echo message="Value equals to itself" />
- </target>
-
- <target name="test2" if="location.fail">
- <fail message="Location passed" />
- </target>
-
- <target name="test3" if="location.unset">
- <echo message="Location does not exists" />
- </target>
-
- </project>
|