|
|
@@ -0,0 +1,77 @@ |
|
|
|
<?xml version="1.0"?>
|
|
|
|
<project name="location-test" basedir="." default="all"
|
|
|
|
xmlns:au="antlib:org.apache.ant.antunit">
|
|
|
|
|
|
|
|
<property name="ant.build.dir" location="../../../../../build"/>
|
|
|
|
<property name="working.dir"
|
|
|
|
location="${ant.build.dir}/ant-unit/location-dir"/>
|
|
|
|
<property name="classes.dir" location="${working.dir}/classes"/>
|
|
|
|
|
|
|
|
<target name="all">
|
|
|
|
<au:antunit>
|
|
|
|
<fileset file="${ant.file}"/>
|
|
|
|
<au:plainlistener/>
|
|
|
|
</au:antunit>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="setUp">
|
|
|
|
<mkdir dir="${classes.dir}"/>
|
|
|
|
<javac srcdir="src" destdir="${classes.dir}" debug="yes"/>
|
|
|
|
<taskdef name="echo-location" classname="task.EchoLocation"
|
|
|
|
classpath="${classes.dir}"/>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="define">
|
|
|
|
<taskdef name="echoloc"
|
|
|
|
classname="task.EchoLocation">
|
|
|
|
<classpath>
|
|
|
|
<pathelement location="${classes.dir}" />
|
|
|
|
<pathelement path="${java.class.path}"/>
|
|
|
|
</classpath>
|
|
|
|
</taskdef>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="macrodef" depends="define">
|
|
|
|
<macrodef name="echoloc2" backtrace="false">
|
|
|
|
<sequential>
|
|
|
|
<echoloc/>
|
|
|
|
</sequential>
|
|
|
|
</macrodef>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="presetdef" depends="define">
|
|
|
|
<presetdef name="echoloc3">
|
|
|
|
<echoloc/>
|
|
|
|
</presetdef>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="tearDown">
|
|
|
|
<delete dir="${working.dir}"/>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="test-plain-task">
|
|
|
|
<echo id="echo">Hello</echo>
|
|
|
|
<au:assertLogContains text="Hello"/>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="test-standalone-type">
|
|
|
|
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="test-condition-task">
|
|
|
|
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="test-macrodef-wrapped-task" depends="macrodef">
|
|
|
|
<echo id="echo3">Hello</echo>
|
|
|
|
<echoloc2/>
|
|
|
|
<au:assertLogContains text="Line: "/>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="test-presetdef-wrapped-task" depends="presetdef">
|
|
|
|
<echo id="echo4">Hello</echo>
|
|
|
|
<echoloc3/>
|
|
|
|
<au:assertLogContains text="Line: "/>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
</project> |