Listing 4 Assertion testing build file
<project name="Anteater-test" default="main">
<taskdef resource="META-INF/Anteater.tasks" />
<typedef resource="META-INF/Anteater.types" />
<property file="properties/example4.properties" />
<group id="local">
<property name="haltonerror" value="false" />
<logger type="xml" todir="${log.dir}" />
</group>
<target name="main" depends="check-website" />
<target name="check-website" depends="init">
<echo>Testing ${url_parser} - No input</echo>
<httpRequest href="${url_parser}" group="local">
<match>
<responseCode value="200" />
</match>
</httpRequest>
<echo>Testing ${url_parser} - With input</echo>
<httpRequest href="${url_parser}" group="local">
<method>POST</method>
<parameter name="user" value="tester1" />
<parameter name="pass" value="badpassword" />
<match>
<responseCode value="200" />
<regexp mustMatch="false" assign="n">Error</regexp>
</match>
</httpRequest>
<echo>Testing ${url_parser} - With empty input</echo>
<httpRequest href="${url_parser}" group="local">
<method>POST</method>
<parameter name="user" value="" />
<parameter name="pass" value="" />
<match>
<responseCode value="200" />
<regexp mustMatch="false" assign="n">Error</regexp>
</match>
</httpRequest>
<ant antfile="${anteater.report}">
<property name="log.dir" location="${log.dir}" />
<property name="report.dir" location="${report.dir}" />
</ant>
</target>
<target name="init" description="Remove results">
<delete dir="${log.dir}" />
</target>
</project>
|